comparison mercurial/fileset.py @ 17366:04c65cb59467 stable

fileset: matchctx.existing() must consider unknown files By default, unknown files are ignored. If the 'unknown()' predicate appears in the syntax tree, then they are taken in account. Unfortunately, matchctx.existing() was filtering against non-deleted context files, which does not include unknown files. So: $ hg debugfileset 'binary() and unknown()' would not return existing binary unknown files.
author Patrick Mezard <patrick@mezard.eu>
date Wed, 15 Aug 2012 22:29:09 +0200
parents 8a0513bf030a
children ce625185cfd9
comparison
equal deleted inserted replaced
17365:8a0513bf030a 17366:04c65cb59467
430 def filter(self, files): 430 def filter(self, files):
431 return [f for f in files if f in self.subset] 431 return [f for f in files if f in self.subset]
432 def existing(self): 432 def existing(self):
433 if self._status is not None: 433 if self._status is not None:
434 removed = set(self._status[3]) 434 removed = set(self._status[3])
435 unknown = set(self._status[4])
435 else: 436 else:
436 removed = set() 437 removed = set()
438 unknown = set()
437 return (f for f in self.subset 439 return (f for f in self.subset
438 if f in self.ctx and f not in removed) 440 if (f in self.ctx and f not in removed) or f in unknown)
439 def narrow(self, files): 441 def narrow(self, files):
440 return matchctx(self.ctx, self.filter(files), self._status) 442 return matchctx(self.ctx, self.filter(files), self._status)
441 443
442 def _intree(funcs, tree): 444 def _intree(funcs, tree):
443 if isinstance(tree, tuple): 445 if isinstance(tree, tuple):