aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTorgny Nyblom <kde@nyblom.org>2010-12-16 09:52:10 +0100
committerTorgny Nyblom <kde@nyblom.org>2010-12-21 10:42:44 +0100
commit1eacf0f983ef27e8795460b9dc5973f2fb063864 (patch)
treedf48c96627b83968c93824cab23a1ab8df37e7e6
parent492e425464979642f9de20a1340ab328d50c7312 (diff)
downloadsvn2git-1eacf0f983ef27e8795460b9dc5973f2fb063864.tar
svn2git-1eacf0f983ef27e8795460b9dc5973f2fb063864.tar.gz
svn2git-1eacf0f983ef27e8795460b9dc5973f2fb063864.tar.bz2
svn2git-1eacf0f983ef27e8795460b9dc5973f2fb063864.tar.xz
svn2git-1eacf0f983ef27e8795460b9dc5973f2fb063864.zip
Try and fix cvs2svn multiple merge points for branches and tags.
Might still need some logic for detecting the correct from branch.
-rw-r--r--src/repository.cpp46
1 files changed, 27 insertions, 19 deletions
diff --git a/src/repository.cpp b/src/repository.cpp
index a35980f..88cd196 100644
--- a/src/repository.cpp
+++ b/src/repository.cpp
@@ -647,28 +647,36 @@ void Repository::Transaction::commit()
// note some of the inferred merges
QByteArray desc = "";
int i = !!parentmark; // if parentmark != 0, there's at least one parent
- foreach (int merge, merges) {
- if (merge == parentmark) {
- qDebug() << "Skipping marking" << merge << "as a merge point as it matches the parent";
- continue;
- }
- if (++i > 16) {
- // FIXME: options:
- // (1) ignore the 16 parent limit
- // (2) don't emit more than 16 parents
- // (3) create another commit on branch to soak up additional parents
- // we've chosen option (2) for now, since only artificial commits
- // created by cvs2svn seem to have this issue
- qWarning() << "too many merge parents";
- break;
- }
+ if(log.contains("This commit was manufactured by cvs2svn to create ")) {
+ qSort(merges);
+ repository->fastImport.write("merge :" + QByteArray::number(merges.last()) + "\n");
+ merges.pop_back();
+ qWarning() << "WARN: Discarding all but the highest merge point as a workaround for cvs2svn created branch/tag"
+ << "Discarded marks:" << merges;
+ } else {
+ foreach (const int merge, merges) {
+ if (merge == parentmark) {
+ qDebug() << "Skipping marking" << merge << "as a merge point as it matches the parent";
+ continue;
+ }
- QByteArray m = " :" + QByteArray::number(merge);
- desc += m;
- repository->fastImport.write("merge" + m + "\n");
- }
+ if (++i > 16) {
+ // FIXME: options:
+ // (1) ignore the 16 parent limit
+ // (2) don't emit more than 16 parents
+ // (3) create another commit on branch to soak up additional parents
+ // we've chosen option (2) for now, since only artificial commits
+ // created by cvs2svn seem to have this issue
+ qWarning() << "WARN: too many merge parents";
+ break;
+ }
+ QByteArray m = " :" + QByteArray::number(merge);
+ desc += m;
+ repository->fastImport.write("merge" + m + "\n");
+ }
+ }
// write the file deletions
if (deletedFiles.contains(""))
repository->fastImport.write("deleteall\n");