@@ -329,7 +329,7 @@ FastImportRepository::FastImportRepository(const Rules::Repository &rule)
329
329
330
330
// create the defaultBranch from the config
331
331
QProcess config;
332
- config.start (" git" , QStringList () << " config" << " init.defaultBranch" );
332
+ config.start (QStringLiteral ( " git" ) , QStringList () << QStringLiteral ( " config" ) << QStringLiteral ( " init.defaultBranch" ) );
333
333
config.waitForFinished (-1 );
334
334
defaultBranch = QString (config.readAllStandardOutput ()).trimmed ();
335
335
@@ -340,22 +340,22 @@ FastImportRepository::FastImportRepository(const Rules::Repository &rule)
340
340
341
341
branches[defaultBranch].created = 1 ;
342
342
343
- if (!CommandLineParser::instance ()->contains (" dry-run" ) && !CommandLineParser::instance ()->contains (" create-dump" )) {
343
+ if (!CommandLineParser::instance ()->contains (QStringLiteral ( " dry-run" )) && !CommandLineParser::instance ()->contains (QStringLiteral ( " create-dump" ) )) {
344
344
fastImport.setWorkingDirectory (name);
345
345
if (!QDir (name).exists ()) { // repo doesn't exist yet.
346
346
qDebug () << " Creating new repository" << name;
347
347
QDir::current ().mkpath (name);
348
348
QProcess init;
349
349
init.setWorkingDirectory (name);
350
- init.start (" git" , QStringList () << " --bare" << " init" );
350
+ init.start (QStringLiteral ( " git" ) , QStringList () << QStringLiteral ( " --bare" ) << QStringLiteral ( " init" ) );
351
351
init.waitForFinished (-1 );
352
352
QProcess casesensitive;
353
353
casesensitive.setWorkingDirectory (name);
354
- casesensitive.start (" git" , QStringList () << " config" << " core.ignorecase" << " false" );
354
+ casesensitive.start (QStringLiteral ( " git" ) , QStringList () << QStringLiteral ( " config" ) << QStringLiteral ( " core.ignorecase" ) << QStringLiteral ( " false" ) );
355
355
casesensitive.waitForFinished (-1 );
356
356
// Write description
357
357
if (!rule.description .isEmpty ()) {
358
- QFile fDesc (QDir (name).filePath (" description" ));
358
+ QFile fDesc (QDir (name).filePath (QStringLiteral ( " description" ) ));
359
359
if (fDesc .open (QIODevice::WriteOnly | QIODevice::Truncate | QIODevice::Text)) {
360
360
fDesc .write (rule.description .toUtf8 ());
361
361
fDesc .putChar (' \n ' );
@@ -374,7 +374,7 @@ FastImportRepository::FastImportRepository(const Rules::Repository &rule)
374
374
static QString logFileName (QString name)
375
375
{
376
376
name.replace (' /' , ' _' );
377
- if (CommandLineParser::instance ()->contains (" create-dump" ))
377
+ if (CommandLineParser::instance ()->contains (QStringLiteral ( " create-dump" ) ))
378
378
name.append (" .fi" );
379
379
else
380
380
name.prepend (" log-" );
@@ -551,7 +551,7 @@ FastImportRepository::~FastImportRepository()
551
551
void FastImportRepository::closeFastImport ()
552
552
{
553
553
if (fastImport.state () != QProcess::NotRunning) {
554
- int fastImportTimeout = CommandLineParser::instance ()->optionArgument (QLatin1String (" fast-import-timeout" ), QLatin1String (" 30" )).toInt ();
554
+ int fastImportTimeout = CommandLineParser::instance ()->optionArgument (QStringLiteral (" fast-import-timeout" ), QStringLiteral (" 30" )).toInt ();
555
555
if (fastImportTimeout == 0 ) {
556
556
qDebug () << " Waiting forever for fast-import to finish." ;
557
557
fastImportTimeout = -1 ;
@@ -595,7 +595,7 @@ void FastImportRepository::reloadBranches()
595
595
}
596
596
597
597
if (reset_notes &&
598
- CommandLineParser::instance ()->contains (" add-metadata-notes" )) {
598
+ CommandLineParser::instance ()->contains (QStringLiteral ( " add-metadata-notes" ) )) {
599
599
600
600
startFastImport ();
601
601
fastImport.write (" reset refs/notes/commits\n from :" +
@@ -724,7 +724,7 @@ void FastImportRepository::commit()
724
724
QString tagName = *it;
725
725
if (resetBranchNames.contains (tagName))
726
726
continue ;
727
- if (tagName.startsWith (" refs/tags/" ))
727
+ if (tagName.startsWith (QLatin1String ( " refs/tags/" ) ))
728
728
tagName.remove (0 , 10 );
729
729
if (annotatedTags.remove (tagName) > 0 ) {
730
730
qDebug () << " Removing annotated tag" << tagName << " for" << name;
@@ -749,7 +749,7 @@ Repository::Transaction *FastImportRepository::newTransaction(const QString &bra
749
749
txn->datetime = 0 ;
750
750
txn->revnum = revnum;
751
751
752
- if ((++commitCount % CommandLineParser::instance ()->optionArgument (QLatin1String (" commit-interval" ), QLatin1String (" 10000" )).toInt ()) == 0 ) {
752
+ if ((++commitCount % CommandLineParser::instance ()->optionArgument (QStringLiteral (" commit-interval" ), QStringLiteral (" 10000" )).toInt ()) == 0 ) {
753
753
startFastImport ();
754
754
// write everything to disk every 10000 commits
755
755
fastImport.write (" checkpoint\n " );
@@ -771,7 +771,7 @@ void FastImportRepository::createAnnotatedTag(const QString &ref, const QString
771
771
const QByteArray &log)
772
772
{
773
773
QString tagName = ref;
774
- if (tagName.startsWith (" refs/tags/" ))
774
+ if (tagName.startsWith (QLatin1String ( " refs/tags/" ) ))
775
775
tagName.remove (0 , 10 );
776
776
777
777
if (!annotatedTags.contains (tagName))
@@ -810,7 +810,7 @@ void FastImportRepository::finalizeTags()
810
810
QByteArray message = tag.log ;
811
811
if (!message.endsWith (' \n ' ))
812
812
message += ' \n ' ;
813
- if (CommandLineParser::instance ()->contains (" add-metadata" ))
813
+ if (CommandLineParser::instance ()->contains (QStringLiteral ( " add-metadata" ) ))
814
814
message += " \n " + formatMetadataMessage (tag.svnprefix , tag.revnum , tagName.toUtf8 ());
815
815
816
816
{
@@ -833,7 +833,7 @@ void FastImportRepository::finalizeTags()
833
833
834
834
// Append note to the tip commit of the supporting ref. There is no
835
835
// easy way to attach a note to the tag itself with fast-import.
836
- if (CommandLineParser::instance ()->contains (" add-metadata-notes" )) {
836
+ if (CommandLineParser::instance ()->contains (QStringLiteral ( " add-metadata-notes" ) )) {
837
837
Repository::Transaction *txn = newTransaction (tag.supportingRef , tag.svnprefix , tag.revnum );
838
838
txn->setAuthor (tag.author );
839
839
txn->setDateTime (tag.dt );
@@ -859,7 +859,7 @@ void FastImportRepository::saveBranchNotes()
859
859
if (branchNotes.isEmpty ())
860
860
return ;
861
861
862
- QFile branchNotesFile (name + " /" + branchNotesFileName (name));
862
+ QFile branchNotesFile (name + QStringLiteral ( " /" ) + branchNotesFileName (name));
863
863
branchNotesFile.open (QIODevice::WriteOnly);
864
864
QDataStream branchNotesStream (&branchNotesFile);
865
865
branchNotesStream << branchNotes;
@@ -875,7 +875,7 @@ FastImportRepository::msgFilter(QByteArray msg)
875
875
if (filterMsg.state () == QProcess::Running)
876
876
qFatal (" filter process already running?" );
877
877
878
- filterMsg.start (CommandLineParser::instance ()->optionArgument (" msg-filter" ));
878
+ filterMsg.start (CommandLineParser::instance ()->optionArgument (QStringLiteral ( " msg-filter" ) ));
879
879
880
880
if (!(filterMsg.waitForStarted (-1 )))
881
881
qFatal (" Failed to Start Filter %d %s" , __LINE__, qPrintable (filterMsg.errorString ()));
@@ -900,17 +900,17 @@ void FastImportRepository::startFastImport()
900
900
// start the process
901
901
QString marksFile = marksFileName (name);
902
902
QStringList marksOptions;
903
- marksOptions << " --import-marks=" + marksFile;
904
- marksOptions << " --export-marks=" + marksFile;
905
- marksOptions << " --force" ;
903
+ marksOptions << QStringLiteral ( " --import-marks=" ) + marksFile;
904
+ marksOptions << QStringLiteral ( " --export-marks=" ) + marksFile;
905
+ marksOptions << QStringLiteral ( " --force" ) ;
906
906
907
907
fastImport.setStandardOutputFile (logFileName (name), QIODevice::Append);
908
908
fastImport.setProcessChannelMode (QProcess::MergedChannels);
909
909
910
- if (!CommandLineParser::instance ()->contains (" dry-run" ) && !CommandLineParser::instance ()->contains (" create-dump" )) {
911
- fastImport.start (" git" , QStringList () << " fast-import" << marksOptions);
910
+ if (!CommandLineParser::instance ()->contains (QStringLiteral ( " dry-run" )) && !CommandLineParser::instance ()->contains (QStringLiteral ( " create-dump" ) )) {
911
+ fastImport.start (QStringLiteral ( " git" ) , QStringList () << QStringLiteral ( " fast-import" ) << marksOptions);
912
912
} else {
913
- fastImport.start (" cat" , QStringList ());
913
+ fastImport.start (QStringLiteral ( " cat" ) , QStringList ());
914
914
}
915
915
fastImport.waitForStarted (-1 );
916
916
@@ -1033,7 +1033,7 @@ QIODevice *FastImportRepository::Transaction::addFile(const QString &path, int m
1033
1033
1034
1034
// it is returned for being written to, so start the process in any case
1035
1035
repository->startFastImport ();
1036
- if (!CommandLineParser::instance ()->contains (" dry-run" )) {
1036
+ if (!CommandLineParser::instance ()->contains (QStringLiteral ( " dry-run" ) )) {
1037
1037
repository->fastImport .writeNoLog (" blob\n mark :" );
1038
1038
repository->fastImport .writeNoLog (QByteArray::number (mark));
1039
1039
repository->fastImport .writeNoLog (" \n data " );
@@ -1124,7 +1124,7 @@ int FastImportRepository::Transaction::commit()
1124
1124
QByteArray message = log;
1125
1125
if (!message.endsWith (' \n ' ))
1126
1126
message += ' \n ' ;
1127
- if (CommandLineParser::instance ()->contains (" add-metadata" ))
1127
+ if (CommandLineParser::instance ()->contains (QStringLiteral ( " add-metadata" ) ))
1128
1128
message += " \n " + Repository::formatMetadataMessage (svnprefix, revnum);
1129
1129
1130
1130
// Call external message filter if provided
@@ -1192,7 +1192,7 @@ int FastImportRepository::Transaction::commit()
1192
1192
}
1193
1193
}
1194
1194
// write the file deletions
1195
- if (deletedFiles.contains (" " ))
1195
+ if (deletedFiles.contains (QLatin1String ( " " ) ))
1196
1196
repository->fastImport .write (" deleteall\n " );
1197
1197
else
1198
1198
foreach (QString df, deletedFiles)
@@ -1210,7 +1210,7 @@ int FastImportRepository::Transaction::commit()
1210
1210
qPrintable (repository->name ), branch.data ());
1211
1211
1212
1212
// Commit metadata note if requested
1213
- if (CommandLineParser::instance ()->contains (" add-metadata-notes" ))
1213
+ if (CommandLineParser::instance ()->contains (QStringLiteral ( " add-metadata-notes" ) ))
1214
1214
commitNote (Repository::formatMetadataMessage (svnprefix, revnum), false );
1215
1215
1216
1216
while (repository->fastImport .bytesToWrite ())
0 commit comments