comparison mercurial/hgweb/webcommands.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 aac97d043e6d
children 7738ae638b62
comparison
equal deleted inserted replaced
37673:0c6b1ec75b73 37674:f83cb91b052e
274 274
275 funcsused = revsetlang.funcsused(tree) 275 funcsused = revsetlang.funcsused(tree)
276 if not funcsused.issubset(revset.safesymbols): 276 if not funcsused.issubset(revset.safesymbols):
277 return MODE_KEYWORD, query 277 return MODE_KEYWORD, query
278 278
279 mfunc = revset.match(web.repo.ui, revdef, repo=web.repo) 279 mfunc = revset.match(web.repo.ui, revdef,
280 lookup=revset.lookupfn(web.repo))
280 try: 281 try:
281 revs = mfunc(web.repo) 282 revs = mfunc(web.repo)
282 return MODE_REVSET, revs 283 return MODE_REVSET, revs
283 # ParseError: wrongly placed tokens, wrongs arguments, etc 284 # ParseError: wrongly placed tokens, wrongs arguments, etc
284 # RepoLookupError: no such revision, e.g. in 'revision:' 285 # RepoLookupError: no such revision, e.g. in 'revision:'