fileset: matchctx.existing() must consider ignored files stable
authorPatrick Mezard <patrick@mezard.eu>
Wed, 15 Aug 2012 22:29:32 +0200
branchstable
changeset 17367 ce625185cfd9
parent 17366 04c65cb59467
child 17368 01cc267fc105
fileset: matchctx.existing() must consider ignored files When running: $ hg debugfileset 'binary() and ignored()' getfileset() was correctly retrieving ignored files but matchctx.existing() was not taking them in account. Just add them along with unknown files.
mercurial/fileset.py
tests/test-fileset.t
--- a/mercurial/fileset.py	Wed Aug 15 22:29:09 2012 +0200
+++ b/mercurial/fileset.py	Wed Aug 15 22:29:32 2012 +0200
@@ -432,7 +432,7 @@
     def existing(self):
         if self._status is not None:
             removed = set(self._status[3])
-            unknown = set(self._status[4])
+            unknown = set(self._status[4] + self._status[5])
         else:
             removed = set()
             unknown = set()
--- a/tests/test-fileset.t	Wed Aug 15 22:29:09 2012 +0200
+++ b/tests/test-fileset.t	Wed Aug 15 22:29:32 2012 +0200
@@ -82,6 +82,9 @@
   $ fileset 'binary()'
   $ fileset 'binary() and unknown()'
   bin
+  $ echo '^bin$' >> .hgignore
+  $ fileset 'binary() and ignored()'
+  bin
   $ hg add bin
   $ fileset 'binary()'
   bin