convert/svn: fix _iterfiles() output in root dir case (issue2647) stable
authorPatrick Mezard <pmezard@gmail.com>
Mon, 14 Mar 2011 21:35:31 +0100
branchstable
changeset 13651 9777df929035
parent 13642 994510694b1d
child 13653 30a0e3519f69
child 13657 b69102740e57
convert/svn: fix _iterfiles() output in root dir case (issue2647) When converting directory additions/replacement with project directory set to root, _iterfiles() sometimes returned paths starting with a slash making following svn calls to fail. I could not reproduce the issue with hand-crafted repositories. Report and first analysis by Clinton Chau <clinton@clearcanvas.ca>
hgext/convert/subversion.py
--- a/hgext/convert/subversion.py	Tue Jan 04 00:24:34 2011 +1100
+++ b/hgext/convert/subversion.py	Mon Mar 14 21:35:31 2011 +0100
@@ -866,7 +866,9 @@
         pool = Pool()
         rpath = '/'.join([self.baseurl, urllib.quote(path)]).strip('/')
         entries = svn.client.ls(rpath, optrev(revnum), True, self.ctx, pool)
-        return ((path + '/' + p) for p, e in entries.iteritems()
+        if path:
+            path += '/'
+        return ((path + p) for p, e in entries.iteritems()
                 if e.kind == svn.core.svn_node_file)
 
     def getrelpath(self, path, module=None):