convert: svn: check for branch movement in any log entry, not just the first.
authorBrendan Cully <brendan@kublai.com>
Mon, 27 Aug 2007 11:56:53 -0700
changeset 5250 585471802a01
parent 5249 0d28d4e5fe1f
child 5251 90919a6f5c8f
child 5256 0b0caffcf175
child 5260 be4835ad9a85
convert: svn: check for branch movement in any log entry, not just the first. This fixes, for example, r4151 D /branches A /project/branches (from /branches:4150) A /project/tags (from /tags:4150) A /project/trunk (from /trunk:4150) D /tags D /trunk
hgext/convert/subversion.py
--- a/hgext/convert/subversion.py	Mon Aug 27 14:55:33 2007 -0300
+++ b/hgext/convert/subversion.py	Mon Aug 27 11:56:53 2007 -0700
@@ -539,12 +539,9 @@
                 return
 
             parents = []
-            orig_paths = orig_paths.items()
-            orig_paths.sort()
-
             # check whether this revision is the start of a branch
-            path, ent = orig_paths and orig_paths[0] or (None, None)
-            if ent and path == self.module:
+            if self.module in orig_paths:
+                ent = orig_paths[self.module]
                 if ent.copyfrom_path:
                     # ent.copyfrom_rev may not be the actual last revision
                     prev = self.latest(ent.copyfrom_path, ent.copyfrom_rev)
@@ -557,6 +554,8 @@
 
             self.modulemap[revnum] = self.module # track backwards in time
 
+            orig_paths = orig_paths.items()
+            orig_paths.sort()
             paths = []
             # filter out unrelated paths
             for path, ent in orig_paths: