231 """ |
231 """ |
232 # i18n: "resolved" is a keyword |
232 # i18n: "resolved" is a keyword |
233 getargs(x, 0, 0, _("resolved takes no arguments")) |
233 getargs(x, 0, 0, _("resolved takes no arguments")) |
234 if mctx.ctx.rev() is not None: |
234 if mctx.ctx.rev() is not None: |
235 return [] |
235 return [] |
236 ms = merge.mergestate(mctx.ctx._repo) |
236 ms = merge.mergestate(mctx.ctx.repo()) |
237 return [f for f in mctx.subset if f in ms and ms[f] == 'r'] |
237 return [f for f in mctx.subset if f in ms and ms[f] == 'r'] |
238 |
238 |
239 def unresolved(mctx, x): |
239 def unresolved(mctx, x): |
240 """``unresolved()`` |
240 """``unresolved()`` |
241 File that is marked unresolved according to the resolve state. |
241 File that is marked unresolved according to the resolve state. |
242 """ |
242 """ |
243 # i18n: "unresolved" is a keyword |
243 # i18n: "unresolved" is a keyword |
244 getargs(x, 0, 0, _("unresolved takes no arguments")) |
244 getargs(x, 0, 0, _("unresolved takes no arguments")) |
245 if mctx.ctx.rev() is not None: |
245 if mctx.ctx.rev() is not None: |
246 return [] |
246 return [] |
247 ms = merge.mergestate(mctx.ctx._repo) |
247 ms = merge.mergestate(mctx.ctx.repo()) |
248 return [f for f in mctx.subset if f in ms and ms[f] == 'u'] |
248 return [f for f in mctx.subset if f in ms and ms[f] == 'u'] |
249 |
249 |
250 def hgignore(mctx, x): |
250 def hgignore(mctx, x): |
251 """``hgignore()`` |
251 """``hgignore()`` |
252 File that matches the active .hgignore pattern. |
252 File that matches the active .hgignore pattern. |
253 """ |
253 """ |
254 # i18n: "hgignore" is a keyword |
254 # i18n: "hgignore" is a keyword |
255 getargs(x, 0, 0, _("hgignore takes no arguments")) |
255 getargs(x, 0, 0, _("hgignore takes no arguments")) |
256 ignore = mctx.ctx._repo.dirstate._ignore |
256 ignore = mctx.ctx.repo().dirstate._ignore |
257 return [f for f in mctx.subset if ignore(f)] |
257 return [f for f in mctx.subset if ignore(f)] |
258 |
258 |
259 def grep(mctx, x): |
259 def grep(mctx, x): |
260 """``grep(regex)`` |
260 """``grep(regex)`` |
261 File contains the given regular expression. |
261 File contains the given regular expression. |
396 fast = not matchmod.patkind(pat) |
396 fast = not matchmod.patkind(pat) |
397 if fast: |
397 if fast: |
398 def m(s): |
398 def m(s): |
399 return (s == pat) |
399 return (s == pat) |
400 else: |
400 else: |
401 m = matchmod.match(ctx._repo.root, '', [pat], ctx=ctx) |
401 m = matchmod.match(ctx.repo().root, '', [pat], ctx=ctx) |
402 return [sub for sub in sstate if m(sub)] |
402 return [sub for sub in sstate if m(sub)] |
403 else: |
403 else: |
404 return [sub for sub in sstate] |
404 return [sub for sub in sstate] |
405 |
405 |
406 symbols = { |
406 symbols = { |
491 # for deleted files. |
491 # for deleted files. |
492 (ctx.rev() is None and _intree(_existingcallers, tree))): |
492 (ctx.rev() is None and _intree(_existingcallers, tree))): |
493 unknown = _intree(['unknown'], tree) |
493 unknown = _intree(['unknown'], tree) |
494 ignored = _intree(['ignored'], tree) |
494 ignored = _intree(['ignored'], tree) |
495 |
495 |
496 r = ctx._repo |
496 r = ctx.repo() |
497 status = r.status(ctx.p1(), ctx, |
497 status = r.status(ctx.p1(), ctx, |
498 unknown=unknown, ignored=ignored, clean=True) |
498 unknown=unknown, ignored=ignored, clean=True) |
499 subset = [] |
499 subset = [] |
500 for c in status: |
500 for c in status: |
501 subset.extend(c) |
501 subset.extend(c) |