# HG changeset patch # User Patrick Mezard # Date 2008-12-06 19:10:31 # Node ID 6644c111f9e9baee1cd98493428914e2e71a282e # Parent 90d8dfb481e730aa1a24846cee8ea1972db361a0 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 diff --git a/hgext/convert/subversion.py b/hgext/convert/subversion.py --- a/hgext/convert/subversion.py +++ b/hgext/convert/subversion.py @@ -724,12 +724,6 @@ class svn_source(converter_source): 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 @@ class svn_source(converter_source): 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: diff --git a/tests/test-convert-svn-branches.out b/tests/test-convert-svn-branches.out --- a/tests/test-convert-svn-branches.out +++ b/tests/test-convert-svn-branches.out @@ -37,8 +37,8 @@ o branch=old3 11 branch trunk@1 into ol | | | | 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: