# HG changeset patch # User Gil # Date 1153850957 25200 # Node ID 93eb49419760307b5a35de3900c544548878803e # Parent b013c9daae695f84af380b47fc64a786fa4c7646 Fix dirstate.walkhelper removing first char of nd when self.root == '/'. diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py --- a/mercurial/dirstate.py +++ b/mercurial/dirstate.py @@ -347,12 +347,16 @@ class dirstate(object): # recursion free walker, faster than os.walk. def findfiles(s): work = [s] + # self.root may end with a path separator when self.root == '/' + root_subtract_len = len(self.root) + if not self.root.endswith('/'): + root_subtract_len += 1 while work: top = work.pop() names = os.listdir(top) names.sort() # nd is the top of the repository dir tree - nd = util.normpath(top[len(self.root) + 1:]) + nd = util.normpath(top[root_subtract_len:]) if nd == '.': nd = '' else: