Patchwork D3711: context: make workingctx.matches() filter our removed files (API)

login
register
mail settings
Submitter phabricator
Date June 12, 2018, 12:26 p.m.
Message ID <46b4b224d87828c688b59a0480794eb0@localhost.localdomain>
Download mbox | patch
Permalink /patch/32072/
State Not Applicable
Headers show

Comments

phabricator - June 12, 2018, 12:26 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGaaed058a0390: context: make workingctx.matches() filter our removed files (API) (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3711?vs=9010&id=9019

REVISION DETAIL
  https://phab.mercurial-scm.org/D3711

AFFECTED FILES
  mercurial/context.py
  tests/test-command-template.t

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: yuja, mercurial-devel

Patch

diff --git a/tests/test-command-template.t b/tests/test-command-template.t
--- a/tests/test-command-template.t
+++ b/tests/test-command-template.t
@@ -4344,6 +4344,12 @@ 
   
   0
   
+  $ hg rm a
+  $ hg log -r "wdir()" -T "{rev}\n{join(files('*'), '\n')}\n"
+  2147483647
+  aa
+  b
+  $ hg revert a
 
 Test relpath function
 
diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -1227,7 +1227,8 @@ 
                                                unknown=True, ignored=False))
 
     def matches(self, match):
-        return sorted(self._repo.dirstate.matches(match))
+        ds = self._repo.dirstate
+        return sorted(f for f in ds.matches(match) if ds[f] != 'r')
 
     def ancestors(self):
         for p in self._parents: