##// END OF EJS Templates
fileset: add resolved and unresolved predicates
Matt Mackall -
r14679:e141e1ce default
parent child Browse files
Show More
@@ -5,7 +5,7 b''
5 # This software may be used and distributed according to the terms of the
5 # This software may be used and distributed according to the terms of the
6 # GNU General Public License version 2 or any later version.
6 # GNU General Public License version 2 or any later version.
7
7
8 import parser, error, util
8 import parser, error, util, merge
9 from i18n import _
9 from i18n import _
10
10
11 elements = {
11 elements = {
@@ -175,6 +175,20 b' def symlink(mctx, x):'
175 getargs(x, 0, 0, _("symlink takes no arguments"))
175 getargs(x, 0, 0, _("symlink takes no arguments"))
176 return [f for f in mctx.subset if mctx.ctx.flags(f) == 'l']
176 return [f for f in mctx.subset if mctx.ctx.flags(f) == 'l']
177
177
178 def resolved(mctx, x):
179 getargs(x, 0, 0, _("resolved takes no arguments"))
180 if mctx.ctx.rev() is not None:
181 return []
182 ms = merge.mergestate(mctx.ctx._repo)
183 return [f for f in mctx.subset if f in ms and ms[f] == 'r']
184
185 def unresolved(mctx, x):
186 getargs(x, 0, 0, _("unresolved takes no arguments"))
187 if mctx.ctx.rev() is not None:
188 return []
189 ms = merge.mergestate(mctx.ctx._repo)
190 return [f for f in mctx.subset if f in ms and ms[f] == 'u']
191
178 symbols = {
192 symbols = {
179 'added': added,
193 'added': added,
180 'binary': binary,
194 'binary': binary,
@@ -184,8 +198,10 b' symbols = {'
184 'ignored': ignored,
198 'ignored': ignored,
185 'modified': modified,
199 'modified': modified,
186 'removed': removed,
200 'removed': removed,
201 'resolved': resolved,
187 'symlink': symlink,
202 'symlink': symlink,
188 'unknown': unknown,
203 'unknown': unknown,
204 'unresolved': unresolved,
189 }
205 }
190
206
191 methods = {
207 methods = {
General Comments 0
You need to be logged in to leave comments. Login now