From a4d2c84dc99e876419ec222de12a4609d49b92c4 Mon Sep 17 00:00:00 2001 From: Colin Guthrie Date: Thu, 29 May 2014 09:13:22 +0100 Subject: 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. --- src/svn.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/svn.cpp') 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))) -- cgit v1.2.1