##// END OF EJS Templates
self.root == '/': prefix length computation out of the loop...
Benoit Boissinot -
r2671:82864a2e default
parent child Browse files
Show More
@@ -344,19 +344,19 b' class dirstate(object):'
344 344 # directly by this function, but might be modified by your statmatch call.
345 345 #
346 346 def walkhelper(self, files, statmatch, dc, badmatch=None):
347 # self.root may end with a path separator when self.root == '/'
348 common_prefix_len = len(self.root)
349 if not self.root.endswith('/'):
350 common_prefix_len += 1
347 351 # recursion free walker, faster than os.walk.
348 352 def findfiles(s):
349 353 work = [s]
350 # self.root may end with a path separator when self.root == '/'
351 root_subtract_len = len(self.root)
352 if not self.root.endswith('/'):
353 root_subtract_len += 1
354 354 while work:
355 355 top = work.pop()
356 356 names = os.listdir(top)
357 357 names.sort()
358 358 # nd is the top of the repository dir tree
359 nd = util.normpath(top[root_subtract_len:])
359 nd = util.normpath(top[common_prefix_len:])
360 360 if nd == '.':
361 361 nd = ''
362 362 else:
General Comments 0
You need to be logged in to leave comments. Login now