# HG changeset patch # User FUJIWARA Katsunori # Date 2015-12-21 13:31:16 # Node ID 2f15253e415faf6a2946590703d4bd0aa39f10b3 # Parent d39e743e357878813c2aaa999a5b14c50864a2e6 fileset: treat encoding and eol as the predicate calling _existing Before this patch, predicate function 'encoding' and 'eol' aren't listed up in '_existingcallers', even though they invoke 'existing()'. This causes unexpected failure of these predicate, if there is a (manually) deleted file in the working directory. 8a0513bf030a and 3ce3f2b059a1 seem to overlook putting already existing 'encoding' or newly introduced 'eol' into '_existingcallers'. This patch also changes order of fileset "eol(unix)" output in test, because "existing caller" predicates show "A(dded)" files before "C(lean)" ones. diff --git a/mercurial/fileset.py b/mercurial/fileset.py --- a/mercurial/fileset.py +++ b/mercurial/fileset.py @@ -510,6 +510,8 @@ def _intree(funcs, tree): # filesets using matchctx.existing() _existingcallers = [ 'binary', + 'encoding', + 'eol', 'exec', 'grep', 'size', diff --git a/tests/test-fileset.t b/tests/test-fileset.t --- a/tests/test-fileset.t +++ b/tests/test-fileset.t @@ -297,16 +297,34 @@ Test with a revision >>> open('mac', 'wb').write("mac\r") $ hg add dos mixed mac +(remove a1, to examine safety of 'eol' on removed files) + $ rm a1 + $ fileset 'eol(dos)' dos mixed $ fileset 'eol(unix)' + mixed .hgsub .hgsubstate - a1 b1 b2 c1 - mixed $ fileset 'eol(mac)' mac + +Test safety of 'encoding' on removed files + + $ fileset 'encoding("ascii")' + dos + mac + mixed + .hgsub + .hgsubstate + 1k + 2k + b1 + b2 + b2link + bin + c1