Mercurial > hg
changeset 31023:aea06029919e
revset: import set classes directly from smartset module
Follows up 1be65deb3d54.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 19 Feb 2017 18:16:09 +0900 |
parents | 705ecab649ea |
children | 0b8356705de6 |
files | hgext/largefiles/overrides.py hgext/mq.py hgext/rebase.py hgext/transplant.py mercurial/cmdutil.py mercurial/graphmod.py mercurial/hgweb/webcommands.py |
diffstat | 7 files changed, 21 insertions(+), 15 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/largefiles/overrides.py Sat Feb 18 18:00:01 2017 +0900 +++ b/hgext/largefiles/overrides.py Sun Feb 19 18:16:09 2017 +0900 @@ -22,8 +22,8 @@ match as matchmod, pathutil, registrar, - revset, scmutil, + smartset, util, ) @@ -855,7 +855,7 @@ firstpulled = repo.firstpulled except AttributeError: raise error.Abort(_("pulled() only available in --lfrev")) - return revset.baseset([r for r in subset if r >= firstpulled]) + return smartset.baseset([r for r in subset if r >= firstpulled]) def overrideclone(orig, ui, source, dest=None, **opts): d = dest
--- a/hgext/mq.py Sat Feb 18 18:00:01 2017 +0900 +++ b/hgext/mq.py Sun Feb 19 18:16:09 2017 +0900 @@ -91,6 +91,7 @@ registrar, revset, scmutil, + smartset, subrepo, util, ) @@ -3569,7 +3570,7 @@ """ revset.getargs(x, 0, 0, _("mq takes no arguments")) applied = set([repo[r.node].rev() for r in repo.mq.applied]) - return revset.baseset([r for r in subset if r in applied]) + return smartset.baseset([r for r in subset if r in applied]) # tell hggettext to extract docstrings from these functions: i18nfunctions = [revsetmq]
--- a/hgext/rebase.py Sat Feb 18 18:00:01 2017 +0900 +++ b/hgext/rebase.py Sun Feb 19 18:16:09 2017 +0900 @@ -47,6 +47,7 @@ repoview, revset, scmutil, + smartset, util, ) @@ -118,8 +119,8 @@ # i18n: "_rebasedefaultdest" is a keyword sourceset = None if x is not None: - sourceset = revset.getset(repo, revset.fullreposet(repo), x) - return subset & revset.baseset([_destrebase(repo, sourceset)]) + sourceset = revset.getset(repo, smartset.fullreposet(repo), x) + return subset & smartset.baseset([_destrebase(repo, sourceset)]) class rebaseruntime(object): """This class is a container for rebase runtime state"""
--- a/hgext/transplant.py Sat Feb 18 18:00:01 2017 +0900 +++ b/hgext/transplant.py Sun Feb 19 18:16:09 2017 +0900 @@ -33,6 +33,7 @@ revlog, revset, scmutil, + smartset, util, ) @@ -723,7 +724,7 @@ s = revset.getset(repo, subset, x) else: s = subset - return revset.baseset([r for r in s if + return smartset.baseset([r for r in s if repo[r].extra().get('transplant_source')]) templatekeyword = registrar.templatekeyword()
--- a/mercurial/cmdutil.py Sat Feb 18 18:00:01 2017 +0900 +++ b/mercurial/cmdutil.py Sun Feb 19 18:16:09 2017 +0900 @@ -41,6 +41,7 @@ revlog, revset, scmutil, + smartset, templatekw, templater, util, @@ -2090,11 +2091,11 @@ if opts.get('rev'): revs = scmutil.revrange(repo, opts['rev']) elif follow and repo.dirstate.p1() == nullid: - revs = revset.baseset() + revs = smartset.baseset() elif follow: revs = repo.revs('reverse(:.)') else: - revs = revset.spanset(repo) + revs = smartset.spanset(repo) revs.reverse() return revs @@ -2109,7 +2110,7 @@ limit = loglimit(opts) revs = _logrevs(repo, opts) if not revs: - return revset.baseset(), None, None + return smartset.baseset(), None, None expr, filematcher = _makelogrevset(repo, pats, opts, revs) if opts.get('rev'): # User-specified revs might be unsorted, but don't sort before @@ -2125,7 +2126,7 @@ if idx >= limit: break limitedrevs.append(rev) - revs = revset.baseset(limitedrevs) + revs = smartset.baseset(limitedrevs) return revs, expr, filematcher @@ -2140,7 +2141,7 @@ limit = loglimit(opts) revs = _logrevs(repo, opts) if not revs: - return revset.baseset([]), None, None + return smartset.baseset([]), None, None expr, filematcher = _makelogrevset(repo, pats, opts, revs) if expr: matcher = revset.match(repo.ui, expr, order=revset.followorder) @@ -2151,7 +2152,7 @@ if limit <= idx: break limitedrevs.append(r) - revs = revset.baseset(limitedrevs) + revs = smartset.baseset(limitedrevs) return revs, expr, filematcher
--- a/mercurial/graphmod.py Sat Feb 18 18:00:01 2017 +0900 +++ b/mercurial/graphmod.py Sun Feb 19 18:16:09 2017 +0900 @@ -22,6 +22,7 @@ from .node import nullrev from . import ( revset, + smartset, util, ) @@ -67,8 +68,8 @@ if gp is None: # precompute slow query as we know reachableroots() goes # through all revs (issue4782) - if not isinstance(revs, revset.baseset): - revs = revset.baseset(revs) + if not isinstance(revs, smartset.baseset): + revs = smartset.baseset(revs) gp = gpcache[mpar] = sorted(set(revset.reachableroots( repo, revs, [mpar]))) if not gp:
--- a/mercurial/hgweb/webcommands.py Sat Feb 18 18:00:01 2017 +0900 +++ b/mercurial/hgweb/webcommands.py Sun Feb 19 18:16:09 2017 +0900 @@ -33,6 +33,7 @@ graphmod, revset, scmutil, + smartset, templatefilters, templater, util, @@ -1148,7 +1149,7 @@ # We have to feed a baseset to dagwalker as it is expecting smartset # object. This does not have a big impact on hgweb performance itself # since hgweb graphing code is not itself lazy yet. - dag = graphmod.dagwalker(web.repo, revset.baseset(revs)) + dag = graphmod.dagwalker(web.repo, smartset.baseset(revs)) # As we said one line above... not lazy. tree = list(graphmod.colored(dag, web.repo))