Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/templatefuncs.py @ 37674:f83cb91b052e
revset: pass in lookup function instead of repo (API)
And document that it's only for legacy lookup. If we have a repo, we're
likely to do more things where that shouldn't be done.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sat, 14 Apr 2018 12:57:32 +0900 |
parents | ebf139cbd4a1 |
children | e743b8524d60 |
comparison
equal
deleted
inserted
replaced
37673:0c6b1ec75b73 | 37674:f83cb91b052e |
---|---|
520 raw = evalstring(context, mapping, args[0]) | 520 raw = evalstring(context, mapping, args[0]) |
521 ctx = context.resource(mapping, 'ctx') | 521 ctx = context.resource(mapping, 'ctx') |
522 repo = ctx.repo() | 522 repo = ctx.repo() |
523 | 523 |
524 def query(expr): | 524 def query(expr): |
525 m = revsetmod.match(repo.ui, expr, repo=repo) | 525 m = revsetmod.match(repo.ui, expr, lookup=revsetmod.lookupfn(repo)) |
526 return m(repo) | 526 return m(repo) |
527 | 527 |
528 if len(args) > 1: | 528 if len(args) > 1: |
529 formatargs = [evalfuncarg(context, mapping, a) for a in args[1:]] | 529 formatargs = [evalfuncarg(context, mapping, a) for a in args[1:]] |
530 revs = query(revsetlang.formatspec(raw, *formatargs)) | 530 revs = query(revsetlang.formatspec(raw, *formatargs)) |