File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -135,6 +135,7 @@ static const CommandLineOption options[] = {
135135 {" --resume-from revision" , " start importing at svn revision number" },
136136 {" --max-rev revision" , " stop importing at svn revision number" },
137137 {" --dry-run" , " don't actually write anything" },
138+ {" --create-dump" , " don't create the repository but a dump file suitable for piping into fast-import" },
138139 {" --debug-rules" , " print what rule is being used for each file" },
139140 {" --commit-interval NUMBER" , " if passed the cache will be flushed to git every NUMBER of commits" },
140141 {" --stats" , " after a run print some statistics about the rules" },
Original file line number Diff line number Diff line change @@ -266,7 +266,7 @@ FastImportRepository::FastImportRepository(const Rules::Repository &rule)
266266 branches[" master" ].created = 1 ;
267267
268268 fastImport.setWorkingDirectory (name);
269- if (!CommandLineParser::instance ()->contains (" dry-run" )) {
269+ if (!CommandLineParser::instance ()->contains (" dry-run" ) && ! CommandLineParser::instance ()-> contains ( " create-dump " ) ) {
270270 if (!QDir (name).exists ()) { // repo doesn't exist yet.
271271 qDebug () << " Creating new repository" << name;
272272 QDir::current ().mkpath (name);
@@ -295,7 +295,10 @@ FastImportRepository::FastImportRepository(const Rules::Repository &rule)
295295static QString logFileName (QString name)
296296{
297297 name.replace (' /' , ' _' );
298- name.prepend (" log-" );
298+ if (CommandLineParser::instance ()->contains (" create-dump" ))
299+ name.append (" .fi" );
300+ else
301+ name.prepend (" log-" );
299302 return name;
300303}
301304
@@ -734,7 +737,7 @@ void FastImportRepository::startFastImport()
734737 fastImport.setStandardOutputFile (logFileName (name), QIODevice::Append);
735738 fastImport.setProcessChannelMode (QProcess::MergedChannels);
736739
737- if (!CommandLineParser::instance ()->contains (" dry-run" )) {
740+ if (!CommandLineParser::instance ()->contains (" dry-run" ) && ! CommandLineParser::instance ()-> contains ( " create-dump " ) ) {
738741 fastImport.start (" git" , QStringList () << " fast-import" << marksOptions);
739742 } else {
740743 fastImport.start (" /bin/cat" , QStringList ());
You can’t perform that action at this time.
0 commit comments