[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdelibs/kdecore
From: Allen Winter <winter () kde ! org>
Date: 2006-02-01 15:35:01
Message-ID: 1138808101.126237.1619.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 504621 by winterz:
cosmetic, and indentation.
M +32 -28 ksavefile.cpp
M +2 -2 ksavefile.h
--- trunk/KDE/kdelibs/kdecore/ksavefile.cpp #504620:504621
@@ -236,11 +236,11 @@
QString message = g.readEntry( "Message", "Automated KDE Commit" );
int maxnum = g.readEntry( "MaxBackups", 10 );
if ( type.toLower() == "numbered" ) {
- return( numberedBackupFile( qFilename, backupDir, extension, maxnum ) );
- } else if ( type.toLower() == "rcs" ) {
- return( rcsBackupFile( qFilename, backupDir, message ) );
+ return( numberedBackupFile( qFilename, backupDir, extension, maxnum ) );
+ } else if ( type.toLower() == "rcs" ) {
+ return( rcsBackupFile( qFilename, backupDir, message ) );
} else {
- return( simpleBackupFile( qFilename, backupDir, extension ) );
+ return( simpleBackupFile( qFilename, backupDir, extension ) );
}
}
@@ -287,30 +287,34 @@
const QString& backupDir,
const QString& backupMessage )
{
- QString qBackupFilename = qFilename;
- qBackupFilename += QString::fromLatin1( ",v" );
- // Check in the file unlocked with ci
- QProcess ci;
- ci.start("ci", QStringList() << "-u" << qFilename);
- if ( !ci.waitForStarted() )
- return false;
- ci.write(backupMessage.toLatin1());
- ci.write(".");
- ci.closeWriteChannel();
- if( !ci.waitForFinished() )
- return false;
- // Use rcs to unset strict locking
- QProcess rcs;
- rcs.start("rcs", QStringList() << "-U" << qBackupFilename);
- if ( !rcs.waitForFinished() )
- return false;
- // co the current revision to restore permissions
- QProcess co;
- co.start("co", QStringList() << qBackupFilename);
- if ( !co.waitForFinished() )
- return false;
- // TODO: Add moving of backup from/to backupDir
- return true;
+ QString qBackupFilename = qFilename;
+ qBackupFilename += QString::fromLatin1( ",v" );
+
+ // Check in the file unlocked with 'ci'
+ QProcess ci;
+ ci.start( "ci", QStringList() << "-u" << qFilename );
+ if ( !ci.waitForStarted() )
+ return false;
+ ci.write( backupMessage.toLatin1() );
+ ci.write(".");
+ ci.closeWriteChannel();
+ if( !ci.waitForFinished() )
+ return false;
+
+ // Use 'rcs' to unset strict locking
+ QProcess rcs;
+ rcs.start( "rcs", QStringList() << "-U" << qBackupFilename );
+ if ( !rcs.waitForFinished() )
+ return false;
+
+ // Use 'co' to checkout the current revision and restore permissions
+ QProcess co;
+ co.start( "co", QStringList() << qBackupFilename );
+ if ( !co.waitForFinished() )
+ return false;
+
+ // TODO: Add moving of backup from/to backupDir
+ return true;
}
bool KSaveFile::numberedBackupFile( const QString& qFilename,
--- trunk/KDE/kdelibs/kdecore/ksavefile.h #504620:504621
@@ -186,14 +186,14 @@
* <name>,v
* @example file,v
*
- * The new backup file will be in rcs format.
+ * The new backup file will be in RCS format.
* Each existing backup file will be commited as a new revision.
*
* @param filename the file to backup
* @param backupDir optional directory where to save the backup file in.
* If empty (the default), the backup will be in the same directory as
* @p filename.
- * @param backupMessage is the RCS commit message for this revision
+ * @param backupMessage is the RCS commit message for this revision.
*/
static bool rcsBackupFile( const QString& filename,
const QString& backupDir = QString(),
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic