# HG changeset patch # User Mark Thomas # Date 2017-10-17 15:11:13 # Node ID 07bbb208a92469ecc053897537db674346d32535 # Parent d6009d1488e82f1be2d88b4df1a9b117ba0374fd context: audit paths before clearing unknown files and dirs Fix regression introduced in D785. In some circumstances, context.clearunknown can be called before the path is audited. Audit the path before deleting any conflicting files. Differential Revision: https://phab.mercurial-scm.org/D1157 diff --git a/mercurial/context.py b/mercurial/context.py --- a/mercurial/context.py +++ b/mercurial/context.py @@ -1946,6 +1946,7 @@ class workingfilectx(committablefilectx) """ wvfs = self._repo.wvfs f = self._path + wvfs.audit(f) if wvfs.isdir(f) and not wvfs.islink(f): wvfs.rmtree(f, forcibly=True) for p in reversed(list(util.finddirs(f))): diff --git a/tests/test-audit-path.t b/tests/test-audit-path.t --- a/tests/test-audit-path.t +++ b/tests/test-audit-path.t @@ -125,8 +125,7 @@ attack ../test abort: path contains illegal component: ../test (glob) [255] $ cat ../test/file - cat: ../test/file: No such file or directory - [1] + data attack /tmp/test