# HG changeset patch # User Pierre-Yves David # Date 2015-12-03 18:40:19 # Node ID 79a86a95f3259b29df3ad36d64102aea42d79191 # Parent 6d29ce250a3d927659096c1176e2d3aec21b602b pathauditor: add a way to skip file system check We need to be able to skip it when looking at data within the history. Doing them in all cases leads to buggy behavior like issue4749. diff --git a/mercurial/pathutil.py b/mercurial/pathutil.py --- a/mercurial/pathutil.py +++ b/mercurial/pathutil.py @@ -23,15 +23,22 @@ class pathauditor(object): - under top-level .hg - starts at the root of a windows drive - contains ".." + + More check are also done about the file system states: - traverses a symlink (e.g. a/symlink_here/b) - inside a nested repository (a callback can be used to approve some nested repositories, e.g., subrepositories) + + The file system checks are only done when 'realfs' is set to True (the + default). They should be disable then we are auditing path for operation on + stored history. ''' - def __init__(self, root, callback=None): + def __init__(self, root, callback=None, realfs=True): self.audited = set() self.auditeddir = set() self.root = root + self._realfs = realfs self.callback = callback if os.path.lexists(root) and not util.checkcase(root): self.normcase = util.normcase @@ -81,7 +88,8 @@ class pathauditor(object): normprefix = os.sep.join(normparts) if normprefix in self.auditeddir: break - self._checkfs(prefix, path) + if self._realfs: + self._checkfs(prefix, path) prefixes.append(normprefix) parts.pop() normparts.pop()