# HG changeset patch # User Martin von Zweigbergk # Date 2019-11-15 22:41:00 # Node ID 7f443cce2972d3fc303d593577005c7fcefe53a9 # Parent 039fbd14d4e2889be830cc114957c31972c6ea04 commit: rewrite check for `hg ci ` being a directory The matcher API is complicated by match.bad, match.explicitdir, and match.traversedir. We already have very few users of match.explicitdir. By rewriting this check we get close to being able to remove match.explicitdir. This may make the check slower, but I think that will be very marginal. Disclosure: I actually wrote this patch to solve a bug we've seen with an internal extension. The internal extension overrides the dirstate walk to only walk the files that our FUSE tells us are modified. That led to "vdirs" not getting populated as this code expected. I have wanted to get rid of match.explicitdir for a very long time, though. Differential Revision: https://phab.mercurial-scm.org/D7437 diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -2800,7 +2800,8 @@ class localrepository(object): continue if f in status.deleted: fail(f, _(b'file not found!')) - if f in vdirs: # visited directory + # Is it a directory that exists or used to exist? + if self.wvfs.isdir(f) or wctx.p1().hasdir(f): d = f + b'/' for mf in matched: if mf.startswith(d):