diff hgsubversion/stupid.py @ 634:a400f3bf5611

replay/stupid: fix tagging on a branch renamed using a branch map Previously, both convert_rev() functions used parentctx.extra() to determine the branch to pass to meta.movetag(). This assumed that the branch name stored in the changeset matches the internal branch. The introduction of branch maps made this assumption unsafe, however: Now, the Mercurial branch can be completely unrelated to the origin of the changeset. It turns out, however, that movetag() already has sufficient knowledge to determine the branch. Given the hash of the new changeset to be tagged, we walk its ancestors until we find an open changeset, which we then know to be the originating branch. This assumes that there were `few' commits made to the tag; an assumption I would consider reasonable.
author Dan Villiom Podlaski Christiansen <danchr@gmail.com>
date Sun, 11 Jul 2010 11:46:19 +0200
parents 587061d41445
children a3d20d6e96b0
line wrap: on
line diff
--- a/hgsubversion/stupid.py
+++ b/hgsubversion/stupid.py
@@ -658,7 +658,7 @@ def convert_rev(ui, meta, svn, r, tbdelt
                 meta.branches[branch] = None, 0, r.revnum
             meta.revmap[r.revnum, b] = ha
         else:
-            meta.movetag(tag, ha, parentctx.extra().get('branch', None), r, date)
+            meta.movetag(tag, ha, r, date)
             meta.addedtags.pop(tag, None)
         util.describe_commit(ui, ha, b)