##// END OF EJS Templates
fileset: add missing() predicate (issue4925)...
liscju -
r27024:ceef5fb1 default
parent child Browse files
Show More
@@ -159,13 +159,22 b' def removed(mctx, x):'
159
159
160 def deleted(mctx, x):
160 def deleted(mctx, x):
161 """``deleted()``
161 """``deleted()``
162 File that is deleted according to :hg:`status`.
162 Alias for ``missing()``.
163 """
163 """
164 # i18n: "deleted" is a keyword
164 # i18n: "deleted" is a keyword
165 getargs(x, 0, 0, _("deleted takes no arguments"))
165 getargs(x, 0, 0, _("deleted takes no arguments"))
166 s = mctx.status().deleted
166 s = mctx.status().deleted
167 return [f for f in mctx.subset if f in s]
167 return [f for f in mctx.subset if f in s]
168
168
169 def missing(mctx, x):
170 """``missing()``
171 File that is missing according to :hg:`status`.
172 """
173 # i18n: "missing" is a keyword
174 getargs(x, 0, 0, _("missing takes no arguments"))
175 s = mctx.status().deleted
176 return [f for f in mctx.subset if f in s]
177
169 def unknown(mctx, x):
178 def unknown(mctx, x):
170 """``unknown()``
179 """``unknown()``
171 File that is unknown according to :hg:`status`. These files will only be
180 File that is unknown according to :hg:`status`. These files will only be
@@ -441,6 +450,7 b' symbols = {'
441 'grep': grep,
450 'grep': grep,
442 'ignored': ignored,
451 'ignored': ignored,
443 'hgignore': hgignore,
452 'hgignore': hgignore,
453 'missing': missing,
444 'modified': modified,
454 'modified': modified,
445 'portable': portable,
455 'portable': portable,
446 'removed': removed,
456 'removed': removed,
@@ -511,7 +521,7 b' def getfileset(ctx, expr):'
511
521
512 # do we need status info?
522 # do we need status info?
513 if (_intree(['modified', 'added', 'removed', 'deleted',
523 if (_intree(['modified', 'added', 'removed', 'deleted',
514 'unknown', 'ignored', 'clean'], tree) or
524 'missing', 'unknown', 'ignored', 'clean'], tree) or
515 # Using matchctx.existing() on a workingctx requires us to check
525 # Using matchctx.existing() on a workingctx requires us to check
516 # for deleted files.
526 # for deleted files.
517 (ctx.rev() is None and _intree(_existingcallers, tree))):
527 (ctx.rev() is None and _intree(_existingcallers, tree))):
@@ -47,6 +47,13 b' Test status'
47 ! missing_content2_missing-tracked
47 ! missing_content2_missing-tracked
48 ! missing_missing_missing-tracked
48 ! missing_missing_missing-tracked
49
49
50 $ hg st -A 'set:missing()'
51 ! content1_content1_missing-tracked
52 ! content1_content2_missing-tracked
53 ! content1_missing_missing-tracked
54 ! missing_content2_missing-tracked
55 ! missing_missing_missing-tracked
56
50 $ hg st -A 'set:unknown()'
57 $ hg st -A 'set:unknown()'
51 ? content1_missing_content1-untracked
58 ? content1_missing_content1-untracked
52 ? content1_missing_content3-untracked
59 ? content1_missing_content3-untracked
@@ -73,6 +73,8 b' Test files status'
73 a2
73 a2
74 $ fileset 'deleted()'
74 $ fileset 'deleted()'
75 a1
75 a1
76 $ fileset 'missing()'
77 a1
76 $ fileset 'unknown()'
78 $ fileset 'unknown()'
77 c3
79 c3
78 $ fileset 'ignored()'
80 $ fileset 'ignored()'
General Comments 0
You need to be logged in to leave comments. Login now