aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorColin Guthrie <colin@mageia.org>2014-05-29 09:13:22 +0100
committerColin Guthrie <colin@mageia.org>2014-05-29 09:13:22 +0100
commita4d2c84dc99e876419ec222de12a4609d49b92c4 (patch)
tree50a0904a9b68dad724e66adff264ad5c151041ce
parentf8ed2101da602b39e6b914382baa4fd6872b7ea9 (diff)
downloadsvn2git-a4d2c84dc99e876419ec222de12a4609d49b92c4.tar
svn2git-a4d2c84dc99e876419ec222de12a4609d49b92c4.tar.gz
svn2git-a4d2c84dc99e876419ec222de12a4609d49b92c4.tar.bz2
svn2git-a4d2c84dc99e876419ec222de12a4609d49b92c4.tar.xz
svn2git-a4d2c84dc99e876419ec222de12a4609d49b92c4.zip
Return after renaming a repo to prevent importing the empty commit.
This should be fine provided the cp did not also change files... If there was a way to find out if the change is a net null, that would be useful here. Also, as we only use tags for markrelease on master branch, we can ignore any cross repo tag copies as they will just clober the data we have already.
-rw-r--r--src/svn.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/svn.cpp b/src/svn.cpp
index 6bb0d2b..1a66231 100644
--- a/src/svn.cpp
+++ b/src/svn.cpp
@@ -793,6 +793,17 @@ int SvnRevision::exportInternal(const char *key, const svn_fs_path_change_t *cha
return EXIT_FAILURE;
repositories->remove(renamed);
repositories->insert(repository, repo);
+
+ // NB If there are other changes along with the svn cp, this is not
+ // necessarily the correct thing to do and some changes may be lost
+ // but to not return here causes a problem where all the release tags
+ // are lost and and empty commit is kept in the history (svn mv should
+ // not result in a git commit).
+ return EXIT_SUCCESS;
+ }
+ if (repo && prevbranch.startsWith("refs/tags/")) {
+ qWarning() << "WARN: Ignoring tag svn-cp as we hope that repo rename will maintain old mark-release tags";
+ return EXIT_SUCCESS;
}
} else if (path != prevpath) {
if (!repo && !(repo = autoCreateRepo(change, rule, repository, branch)))