hgext/convert/convcmd.py
changeset 9431 d1b135f2f415
parent 8843 eb7b247a98ea
child 9962 a7178eccf2dc
child 10263 25e572394f5c
--- a/hgext/convert/convcmd.py	Sat Sep 05 18:56:51 2009 +0200
+++ b/hgext/convert/convcmd.py	Sun Sep 06 15:29:14 2009 +0200
@@ -336,11 +336,14 @@
                     ctags[k] = self.map[v]
 
             if c and ctags:
-                nrev = self.dest.puttags(ctags)
-                # write another hash correspondence to override the previous
-                # one so we don't end up with extra tag heads
-                if nrev:
-                    self.map[c] = nrev
+                nrev, tagsparent = self.dest.puttags(ctags)
+                if nrev and tagsparent:
+                    # write another hash correspondence to override the previous
+                    # one so we don't end up with extra tag heads
+                    tagsparents = [e for e in self.map.iteritems()
+                                   if e[1] == tagsparent]
+                    if tagsparents:
+                        self.map[tagsparents[0][0]] = nrev
 
             self.writeauthormap()
         finally: