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>
--- 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):