Show More
@@ -22,8 +22,8 from mercurial import ( | |||
|
22 | 22 | match as matchmod, |
|
23 | 23 | pathutil, |
|
24 | 24 | registrar, |
|
25 | revset, | |
|
26 | 25 | scmutil, |
|
26 | smartset, | |
|
27 | 27 | util, |
|
28 | 28 | ) |
|
29 | 29 | |
@@ -855,7 +855,7 def pulledrevsetsymbol(repo, subset, x): | |||
|
855 | 855 | firstpulled = repo.firstpulled |
|
856 | 856 | except AttributeError: |
|
857 | 857 | raise error.Abort(_("pulled() only available in --lfrev")) |
|
858 |
return |
|
|
858 | return smartset.baseset([r for r in subset if r >= firstpulled]) | |
|
859 | 859 | |
|
860 | 860 | def overrideclone(orig, ui, source, dest=None, **opts): |
|
861 | 861 | d = dest |
@@ -91,6 +91,7 from mercurial import ( | |||
|
91 | 91 | registrar, |
|
92 | 92 | revset, |
|
93 | 93 | scmutil, |
|
94 | smartset, | |
|
94 | 95 | subrepo, |
|
95 | 96 | util, |
|
96 | 97 | ) |
@@ -3569,7 +3570,7 def revsetmq(repo, subset, x): | |||
|
3569 | 3570 | """ |
|
3570 | 3571 | revset.getargs(x, 0, 0, _("mq takes no arguments")) |
|
3571 | 3572 | applied = set([repo[r.node].rev() for r in repo.mq.applied]) |
|
3572 |
return |
|
|
3573 | return smartset.baseset([r for r in subset if r in applied]) | |
|
3573 | 3574 | |
|
3574 | 3575 | # tell hggettext to extract docstrings from these functions: |
|
3575 | 3576 | i18nfunctions = [revsetmq] |
@@ -47,6 +47,7 from mercurial import ( | |||
|
47 | 47 | repoview, |
|
48 | 48 | revset, |
|
49 | 49 | scmutil, |
|
50 | smartset, | |
|
50 | 51 | util, |
|
51 | 52 | ) |
|
52 | 53 | |
@@ -118,8 +119,8 def _revsetdestrebase(repo, subset, x): | |||
|
118 | 119 | # i18n: "_rebasedefaultdest" is a keyword |
|
119 | 120 | sourceset = None |
|
120 | 121 | if x is not None: |
|
121 |
sourceset = revset.getset(repo, |
|
|
122 |
return subset & |
|
|
122 | sourceset = revset.getset(repo, smartset.fullreposet(repo), x) | |
|
123 | return subset & smartset.baseset([_destrebase(repo, sourceset)]) | |
|
123 | 124 | |
|
124 | 125 | class rebaseruntime(object): |
|
125 | 126 | """This class is a container for rebase runtime state""" |
@@ -33,6 +33,7 from mercurial import ( | |||
|
33 | 33 | revlog, |
|
34 | 34 | revset, |
|
35 | 35 | scmutil, |
|
36 | smartset, | |
|
36 | 37 | util, |
|
37 | 38 | ) |
|
38 | 39 | |
@@ -723,7 +724,7 def revsettransplanted(repo, subset, x): | |||
|
723 | 724 | s = revset.getset(repo, subset, x) |
|
724 | 725 | else: |
|
725 | 726 | s = subset |
|
726 |
return |
|
|
727 | return smartset.baseset([r for r in s if | |
|
727 | 728 | repo[r].extra().get('transplant_source')]) |
|
728 | 729 | |
|
729 | 730 | templatekeyword = registrar.templatekeyword() |
@@ -41,6 +41,7 from . import ( | |||
|
41 | 41 | revlog, |
|
42 | 42 | revset, |
|
43 | 43 | scmutil, |
|
44 | smartset, | |
|
44 | 45 | templatekw, |
|
45 | 46 | templater, |
|
46 | 47 | util, |
@@ -2090,11 +2091,11 def _logrevs(repo, opts): | |||
|
2090 | 2091 | if opts.get('rev'): |
|
2091 | 2092 | revs = scmutil.revrange(repo, opts['rev']) |
|
2092 | 2093 | elif follow and repo.dirstate.p1() == nullid: |
|
2093 |
revs = |
|
|
2094 | revs = smartset.baseset() | |
|
2094 | 2095 | elif follow: |
|
2095 | 2096 | revs = repo.revs('reverse(:.)') |
|
2096 | 2097 | else: |
|
2097 |
revs = |
|
|
2098 | revs = smartset.spanset(repo) | |
|
2098 | 2099 | revs.reverse() |
|
2099 | 2100 | return revs |
|
2100 | 2101 | |
@@ -2109,7 +2110,7 def getgraphlogrevs(repo, pats, opts): | |||
|
2109 | 2110 | limit = loglimit(opts) |
|
2110 | 2111 | revs = _logrevs(repo, opts) |
|
2111 | 2112 | if not revs: |
|
2112 |
return |
|
|
2113 | return smartset.baseset(), None, None | |
|
2113 | 2114 | expr, filematcher = _makelogrevset(repo, pats, opts, revs) |
|
2114 | 2115 | if opts.get('rev'): |
|
2115 | 2116 | # User-specified revs might be unsorted, but don't sort before |
@@ -2125,7 +2126,7 def getgraphlogrevs(repo, pats, opts): | |||
|
2125 | 2126 | if idx >= limit: |
|
2126 | 2127 | break |
|
2127 | 2128 | limitedrevs.append(rev) |
|
2128 |
revs = |
|
|
2129 | revs = smartset.baseset(limitedrevs) | |
|
2129 | 2130 | |
|
2130 | 2131 | return revs, expr, filematcher |
|
2131 | 2132 | |
@@ -2140,7 +2141,7 def getlogrevs(repo, pats, opts): | |||
|
2140 | 2141 | limit = loglimit(opts) |
|
2141 | 2142 | revs = _logrevs(repo, opts) |
|
2142 | 2143 | if not revs: |
|
2143 |
return |
|
|
2144 | return smartset.baseset([]), None, None | |
|
2144 | 2145 | expr, filematcher = _makelogrevset(repo, pats, opts, revs) |
|
2145 | 2146 | if expr: |
|
2146 | 2147 | matcher = revset.match(repo.ui, expr, order=revset.followorder) |
@@ -2151,7 +2152,7 def getlogrevs(repo, pats, opts): | |||
|
2151 | 2152 | if limit <= idx: |
|
2152 | 2153 | break |
|
2153 | 2154 | limitedrevs.append(r) |
|
2154 |
revs = |
|
|
2155 | revs = smartset.baseset(limitedrevs) | |
|
2155 | 2156 | |
|
2156 | 2157 | return revs, expr, filematcher |
|
2157 | 2158 |
@@ -22,6 +22,7 from __future__ import absolute_import | |||
|
22 | 22 | from .node import nullrev |
|
23 | 23 | from . import ( |
|
24 | 24 | revset, |
|
25 | smartset, | |
|
25 | 26 | util, |
|
26 | 27 | ) |
|
27 | 28 | |
@@ -67,8 +68,8 def dagwalker(repo, revs): | |||
|
67 | 68 | if gp is None: |
|
68 | 69 | # precompute slow query as we know reachableroots() goes |
|
69 | 70 | # through all revs (issue4782) |
|
70 |
if not isinstance(revs, |
|
|
71 |
revs = |
|
|
71 | if not isinstance(revs, smartset.baseset): | |
|
72 | revs = smartset.baseset(revs) | |
|
72 | 73 | gp = gpcache[mpar] = sorted(set(revset.reachableroots( |
|
73 | 74 | repo, revs, [mpar]))) |
|
74 | 75 | if not gp: |
@@ -33,6 +33,7 from .. import ( | |||
|
33 | 33 | graphmod, |
|
34 | 34 | revset, |
|
35 | 35 | scmutil, |
|
36 | smartset, | |
|
36 | 37 | templatefilters, |
|
37 | 38 | templater, |
|
38 | 39 | util, |
@@ -1148,7 +1149,7 def graph(web, req, tmpl): | |||
|
1148 | 1149 | # We have to feed a baseset to dagwalker as it is expecting smartset |
|
1149 | 1150 | # object. This does not have a big impact on hgweb performance itself |
|
1150 | 1151 | # since hgweb graphing code is not itself lazy yet. |
|
1151 |
dag = graphmod.dagwalker(web.repo, |
|
|
1152 | dag = graphmod.dagwalker(web.repo, smartset.baseset(revs)) | |
|
1152 | 1153 | # As we said one line above... not lazy. |
|
1153 | 1154 | tree = list(graphmod.colored(dag, web.repo)) |
|
1154 | 1155 |
General Comments 0
You need to be logged in to leave comments.
Login now