changeset 7476:6644c111f9e9

convert: backout a7492fb2107b This change is brain damaged, there is no reason the copyfrom revision of the project items may have any relevance when deciding the revision parent. It is meaningful only when fetching files content. Incorrect converted graph was spotted in pyglet svn repository at: ------------------------------------------------------------------------ r274 | r1chardj0n3s | 2006-12-21 02:02:14 +0100 (Jeu, 21 Dec 2006) | 2 lines Changed paths: A /branches/richard-glx-version (from /trunk:269) M /branches/richard-glx-version/pyglet/window/xlib/__init__.py R /branches/richard-glx-version/tests/test.py (from /trunk/tests/test.py:270) R /branches/richard-glx-version/tools/info.py (from /trunk/tools/info.py:272) R /branches/richard-glx-version/website/get_involved.php (from /trunk/website/get_involved.php:273) Branching to horribly mangle GLX
author Patrick Mezard <pmezard@gmail.com>
date Sat, 06 Dec 2008 20:10:31 +0100
parents 90d8dfb481e7
children 1e8d7339f350 85dc88630beb 64840fcb79e1
files hgext/convert/subversion.py tests/test-convert-svn-branches.out
diffstat 2 files changed, 3 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/convert/subversion.py	Sat Dec 06 20:07:44 2008 +0100
+++ b/hgext/convert/subversion.py	Sat Dec 06 20:10:31 2008 +0100
@@ -724,12 +724,6 @@
 
         self.child_cset = None
 
-        def isdescendantof(parent, child):
-            if not child or not parent or not child.startswith(parent):
-                return False
-            subpath = child[len(parent):]
-            return len(subpath) > 1 and subpath[0] == '/'
-
         def parselogentry(orig_paths, revnum, author, date, message):
             """Return the parsed commit object or None, and True if
             the revision is a branch root.
@@ -752,21 +746,10 @@
             if root_paths:
                 path, ent = root_paths[-1]
                 if ent.copyfrom_path:
-                    # If dir was moved while one of its file was removed
-                    # the log may look like:
-                    # A /dir   (from /dir:x)
-                    # A /dir/a (from /dir/a:y)
-                    # A /dir/b (from /dir/b:z)
-                    # ...
-                    # for all remaining children.
-                    # Let's take the highest child element from rev as source.
-                    copies = [(p,e) for p,e in orig_paths[:-1]
-                          if isdescendantof(ent.copyfrom_path, e.copyfrom_path)]
-                    fromrev = max([e.copyfrom_rev for p,e in copies] + [ent.copyfrom_rev])
                     branched = True
                     newpath = ent.copyfrom_path + self.module[len(path):]
                     # ent.copyfrom_rev may not be the actual last revision
-                    previd = self.latest(newpath, fromrev)
+                    previd = self.latest(newpath, ent.copyfrom_rev)
                     if previd is not None:
                         prevmodule, prevnum = self.revsplit(previd)[1:]
                         if prevnum >= self.startrev:
--- a/tests/test-convert-svn-branches.out	Sat Dec 06 20:07:44 2008 +0100
+++ b/tests/test-convert-svn-branches.out	Sat Dec 06 20:10:31 2008 +0100
@@ -37,8 +37,8 @@
 | | |
 | o |  branch= 3 change a files: a
 | | |
-| | o  branch=old 2 branch trunk, remove c files:
-| |/
++---o  branch=old 2 branch trunk, remove c files: a b
+| |
 | o  branch= 1 hello files: a b c
 |/
 o  branch= 0 init projA files: