aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/repository.cpp23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/repository.cpp b/src/repository.cpp
index 426eeff..88b17c3 100644
--- a/src/repository.cpp
+++ b/src/repository.cpp
@@ -52,7 +52,7 @@ public:
static ProcessCache processCache;
Repository::Repository(const Rules::Repository &rule)
- : name(rule.name), commitCount(0), outstandingTransactions(0), processHasStarted(false)
+ : name(rule.name), commitCount(0), outstandingTransactions(0), lastmark(0), processHasStarted(false)
{
foreach (Rules::Repository::Branch branchRule, rule.branches) {
Branch branch;
@@ -97,6 +97,19 @@ void Repository::closeFastImport()
}
processHasStarted = false;
processCache.remove(this);
+ // Save the exported marks
+ QString revsFile = name;
+ revsFile.replace('/', '_');
+ revsFile.prepend("revisions-");
+ QFile exportedMarks(revsFile);
+ qDebug() << exportedMarks.open(QIODevice::Truncate | QIODevice::Text | QIODevice::WriteOnly);
+
+ int mark;
+ foreach(mark, exportedCommits)
+ {
+ exportedMarks.write(QString(":%2 r%1\n").arg(mark).arg(commitMarks.value(mark)).toLocal8Bit());
+ }
+ exportedMarks.close();
}
void Repository::reloadBranches()
@@ -148,6 +161,7 @@ void Repository::createBranch(const QString &branch, int revnum,
if(commitMarks.contains(closestCommit))
{
branchFromRef = ":" + QByteArray::number(commitMarks.value(closestCommit));
+ qDebug() << "branching from" << closestCommit << "(svn reports r" << branchRevNum << ")";
} else {
qWarning() << branch << "in repository" << name << "is branching but no exported commits exist in repository"
<< "creating an empty branch.";
@@ -269,6 +283,11 @@ void Repository::startFastImport()
processHasStarted = true;
// start the process
+ QString marksFile = name;
+ marksFile.replace('/', '_');
+ marksFile.prepend("marks-");
+ QStringList marksOptions;
+ marksOptions << "--export-marks=" + marksFile;
QString outputFile = name;
outputFile.replace('/', '_');
outputFile.prepend("log-");
@@ -276,7 +295,7 @@ void Repository::startFastImport()
fastImport.setProcessChannelMode(QProcess::MergedChannels);
if (!CommandLineParser::instance()->contains("dry-run")) {
- fastImport.start("git", QStringList() << "fast-import");
+ fastImport.start("git", QStringList() << "fast-import" << marksOptions);
} else {
fastImport.start("/bin/cat", QStringList());
}