D4899: narrow: filter files by narrowspec in ctx.matches()
martinvonz (Martin von Zweigbergk)
phabricator at mercurial-scm.org
Fri Oct 5 22:36:38 UTC 2018
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.
REVISION SUMMARY
This has no effect yet because 1) for committed changes, ctx.matches()
just calls ctx.walk(), which we updated in the previous patch, and 2)
for the working copy, the filtering is also done in the overridden
dirstate.walk() in narrowdirstate.
REPOSITORY
rHG Mercurial
REVISION DETAIL
https://phab.mercurial-scm.org/D4899
AFFECTED FILES
mercurial/context.py
CHANGE DETAILS
diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -1173,6 +1173,7 @@
unknown=True, ignored=False))
def matches(self, match):
+ match = self._repo.narrowmatch(match)
ds = self._repo.dirstate
return sorted(f for f in ds.matches(match) if ds[f] != 'r')
To: martinvonz, #hg-reviewers
Cc: mercurial-devel
More information about the Mercurial-devel
mailing list