comparison hgext/convert/subversion.py @ 13651:9777df929035 stable

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>
author Patrick Mezard <pmezard@gmail.com>
date Mon, 14 Mar 2011 21:35:31 +0100
parents 3178aca36b0f
children 30a0e3519f69
comparison
equal deleted inserted replaced
13642:994510694b1d 13651:9777df929035
864 """Enumerate all files in path at revnum, recursively.""" 864 """Enumerate all files in path at revnum, recursively."""
865 path = path.strip('/') 865 path = path.strip('/')
866 pool = Pool() 866 pool = Pool()
867 rpath = '/'.join([self.baseurl, urllib.quote(path)]).strip('/') 867 rpath = '/'.join([self.baseurl, urllib.quote(path)]).strip('/')
868 entries = svn.client.ls(rpath, optrev(revnum), True, self.ctx, pool) 868 entries = svn.client.ls(rpath, optrev(revnum), True, self.ctx, pool)
869 return ((path + '/' + p) for p, e in entries.iteritems() 869 if path:
870 path += '/'
871 return ((path + p) for p, e in entries.iteritems()
870 if e.kind == svn.core.svn_node_file) 872 if e.kind == svn.core.svn_node_file)
871 873
872 def getrelpath(self, path, module=None): 874 def getrelpath(self, path, module=None):
873 if module is None: 875 if module is None:
874 module = self.module 876 module = self.module