##// 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 5 # This software may be used and distributed according to the terms of the
6 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 9 from i18n import _
10 10
11 11 elements = {
@@ -175,6 +175,20 b' def symlink(mctx, x):'
175 175 getargs(x, 0, 0, _("symlink takes no arguments"))
176 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 192 symbols = {
179 193 'added': added,
180 194 'binary': binary,
@@ -184,8 +198,10 b' symbols = {'
184 198 'ignored': ignored,
185 199 'modified': modified,
186 200 'removed': removed,
201 'resolved': resolved,
187 202 'symlink': symlink,
188 203 'unknown': unknown,
204 'unresolved': unresolved,
189 205 }
190 206
191 207 methods = {
General Comments 0
You need to be logged in to leave comments. Login now