changeset 656:1add57910c82

stupid: remove an incorrect, implicit assumption in fetch_branchrev() The code in fetch_branchrev() could fail under relatively obscure circumstances: it combined two strings (path & child) by concatenating them with '/' inserted in the middle. However, convert_rev() contains an assertion that no touched file paths start with '/'. Combined, these two amounted to an incorrect assumption that no files where touched within an empty branchpath.
author Dan Villiom Podlaski Christiansen <danchr@gmail.com>
date Wed, 11 Aug 2010 19:57:34 +0200
parents dcac6dc1abe6
children 9cf547fc36e8
files hgsubversion/stupid.py
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hgsubversion/stupid.py
+++ b/hgsubversion/stupid.py
@@ -423,7 +423,11 @@ def fetch_branchrev(svn, meta, branch, b
                 dirpath = branchprefix + path
                 for child, k in svn.list_files(dirpath, r.revnum):
                     if k == 'f':
-                        files.append(path + '/' + child)
+                        if path:
+                            childpath = '%s/%s' % (path, child)
+                        else:
+                            childpath = child
+                        files.append(childpath)
                 if e.action == 'R':
                     # Check all files in replaced directory
                     path = path + '/'