# HG changeset patch # User Yuya Nishihara # Date 1422883267 -32400 # Node ID fafd9a1284cf83bd398cf754a2f09ab30e029c0e # Parent b08af8f0ac016968f5ea3479dd73ad49c628884b revset: make match function initiate query from full set by default This change is intended to avoid exposing the implementation detail to callers. I'm going to extend fullreposet to support "null" revision, so these mfunc calls will have to use fullreposet() instead of spanset(). diff -r b08af8f0ac01 -r fafd9a1284cf mercurial/commands.py --- a/mercurial/commands.py Wed Oct 01 20:26:33 2014 -0400 +++ b/mercurial/commands.py Mon Feb 02 22:21:07 2015 +0900 @@ -2885,7 +2885,7 @@ weight, optimizedtree = revset.optimize(newtree, True) ui.note("* optimized:\n", revset.prettyformat(optimizedtree), "\n") func = revset.match(ui, expr) - for c in func(repo, revset.spanset(repo)): + for c in func(repo): ui.write("%s\n" % c) @command('debugsetparents', [], _('REV1 [REV2]')) diff -r b08af8f0ac01 -r fafd9a1284cf mercurial/hgweb/webcommands.py --- a/mercurial/hgweb/webcommands.py Wed Oct 01 20:26:33 2014 -0400 +++ b/mercurial/hgweb/webcommands.py Mon Feb 02 22:21:07 2015 +0900 @@ -237,7 +237,7 @@ mfunc = revset.match(web.repo.ui, revdef) try: - revs = mfunc(web.repo, revset.spanset(web.repo)) + revs = mfunc(web.repo) return MODE_REVSET, revs # ParseError: wrongly placed tokens, wrongs arguments, etc # RepoLookupError: no such revision, e.g. in 'revision:' diff -r b08af8f0ac01 -r fafd9a1284cf mercurial/localrepo.py --- a/mercurial/localrepo.py Wed Oct 01 20:26:33 2014 -0400 +++ b/mercurial/localrepo.py Mon Feb 02 22:21:07 2015 +0900 @@ -482,7 +482,7 @@ '''Return a list of revisions matching the given revset''' expr = revset.formatspec(expr, *args) m = revset.match(None, expr) - return m(self, revset.spanset(self)) + return m(self) def set(self, expr, *args): ''' diff -r b08af8f0ac01 -r fafd9a1284cf mercurial/revset.py --- a/mercurial/revset.py Wed Oct 01 20:26:33 2014 -0400 +++ b/mercurial/revset.py Mon Feb 02 22:21:07 2015 +0900 @@ -2448,7 +2448,9 @@ tree = findaliases(ui, tree, showwarning=ui.warn) tree = foldconcat(tree) weight, tree = optimize(tree, True) - def mfunc(repo, subset): + def mfunc(repo, subset=None): + if subset is None: + subset = spanset(repo) if util.safehasattr(subset, 'isascending'): result = getset(repo, subset, tree) else: diff -r b08af8f0ac01 -r fafd9a1284cf mercurial/scmutil.py --- a/mercurial/scmutil.py Wed Oct 01 20:26:33 2014 -0400 +++ b/mercurial/scmutil.py Mon Feb 02 22:21:07 2015 +0900 @@ -672,11 +672,11 @@ # fall through to new-style queries if old-style fails m = revset.match(repo.ui, spec, repo) if seen or l: - dl = [r for r in m(repo, revset.spanset(repo)) if r not in seen] + dl = [r for r in m(repo) if r not in seen] l = l + revset.baseset(dl) seen.update(dl) else: - l = m(repo, revset.spanset(repo)) + l = m(repo) return l diff -r b08af8f0ac01 -r fafd9a1284cf mercurial/templater.py --- a/mercurial/templater.py Wed Oct 01 20:26:33 2014 -0400 +++ b/mercurial/templater.py Mon Feb 02 22:21:07 2015 +0900 @@ -393,7 +393,7 @@ def query(expr): m = revsetmod.match(repo.ui, expr) - return m(repo, revsetmod.spanset(repo)) + return m(repo) if len(args) > 1: formatargs = list([a[0](context, mapping, a[1]) for a in args[1:]])