# HG changeset patch # User Martin von Zweigbergk # Date 1573857660 28800 # 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 -r 039fbd14d4e2 -r 7f443cce2972 mercurial/localrepo.py --- a/mercurial/localrepo.py Mon Nov 18 20:10:38 2019 -0800 +++ b/mercurial/localrepo.py Fri Nov 15 14:41:00 2019 -0800 @@ -2800,7 +2800,8 @@ 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):