##// END OF EJS Templates
revset: changed revsets to use spanset...
Lucas Moscovicz -
r20526:9ad6dae6 default
parent child Browse files
Show More
@@ -2567,7 +2567,7 b' def debugrevspec(ui, repo, expr, **opts)'
2567 2567 weight, optimizedtree = revset.optimize(newtree, True)
2568 2568 ui.note("* optimized:\n", revset.prettyformat(optimizedtree), "\n")
2569 2569 func = revset.match(ui, expr)
2570 for c in func(repo, revset.baseset(range(len(repo)))):
2570 for c in func(repo, revset.spanset(repo)):
2571 2571 ui.write("%s\n" % c)
2572 2572
2573 2573 @command('debugsetparents', [], _('REV1 [REV2]'))
@@ -232,14 +232,13 b' def rangeset(repo, subset, x, y):'
232 232 m, n = m[0], n[-1]
233 233
234 234 if m < n:
235 r = range(m, n + 1)
235 r = spanset(repo, m, n + 1)
236 236 else:
237 r = range(m, n - 1, -1)
238 s = subset.set()
239 return baseset([x for x in r if x in s])
237 r = spanset(repo, m, n - 1)
238 return r & subset
240 239
241 240 def dagrange(repo, subset, x, y):
242 r = baseset(repo)
241 r = spanset(repo)
243 242 xs = _revsbetween(repo, getset(repo, r, x), getset(repo, r, y))
244 243 s = subset.set()
245 244 return baseset([r for r in xs if r in s])
@@ -287,7 +286,7 b' def ancestor(repo, subset, x):'
287 286 """
288 287 # i18n: "ancestor" is a keyword
289 288 l = getlist(x)
290 rl = baseset(repo)
289 rl = spanset(repo)
291 290 anc = None
292 291
293 292 # (getset(repo, rl, i) for i in l) generates a list of lists
@@ -306,7 +305,7 b' def ancestor(repo, subset, x):'
306 305 return baseset([])
307 306
308 307 def _ancestors(repo, subset, x, followfirst=False):
309 args = getset(repo, baseset(repo), x)
308 args = getset(repo, spanset(repo), x)
310 309 if not args:
311 310 return baseset([])
312 311 s = set(_revancestors(repo, args, followfirst)) | set(args)
@@ -433,7 +432,7 b' def branch(repo, subset, x):'
433 432 else:
434 433 return lazyset(subset, lambda r: matcher(repo[r].branch()))
435 434
436 s = getset(repo, baseset(repo), x)
435 s = getset(repo, spanset(repo), x)
437 436 b = set()
438 437 for r in s:
439 438 b.add(repo[r].branch())
@@ -596,11 +595,11 b' def desc(repo, subset, x):'
596 595 return lazyset(subset, matches)
597 596
598 597 def _descendants(repo, subset, x, followfirst=False):
599 args = getset(repo, baseset(repo), x)
598 args = getset(repo, spanset(repo), x)
600 599 if not args:
601 600 return baseset([])
602 601 s = set(_revdescendants(repo, args, followfirst)) | set(args)
603 return baseset([r for r in subset if r in s])
602 return subset & s
604 603
605 604 def descendants(repo, subset, x):
606 605 """``descendants(set)``
@@ -620,9 +619,9 b' def destination(repo, subset, x):'
620 619 is the same as passing all().
621 620 """
622 621 if x is not None:
623 args = getset(repo, baseset(repo), x).set()
622 args = getset(repo, spanset(repo), x).set()
624 623 else:
625 args = getall(repo, baseset(repo), x).set()
624 args = getall(repo, spanset(repo), x).set()
626 625
627 626 dests = set()
628 627
@@ -943,7 +942,7 b' def limit(repo, subset, x):'
943 942 # i18n: "limit" is a keyword
944 943 raise error.ParseError(_("limit expects a number"))
945 944 ss = subset.set()
946 os = getset(repo, baseset(repo), l[0])
945 os = getset(repo, spanset(repo), l[0])
947 946 bs = baseset([])
948 947 it = iter(os)
949 948 for x in xrange(lim):
@@ -970,14 +969,14 b' def last(repo, subset, x):'
970 969 # i18n: "last" is a keyword
971 970 raise error.ParseError(_("last expects a number"))
972 971 ss = subset.set()
973 os = getset(repo, baseset(repo), l[0])[-lim:]
972 os = getset(repo, spanset(repo), l[0])[-lim:]
974 973 return baseset([r for r in os if r in ss])
975 974
976 975 def maxrev(repo, subset, x):
977 976 """``max(set)``
978 977 Changeset with highest revision number in set.
979 978 """
980 os = getset(repo, baseset(repo), x)
979 os = getset(repo, spanset(repo), x)
981 980 if os:
982 981 m = max(os)
983 982 if m in subset:
@@ -1014,7 +1013,7 b' def minrev(repo, subset, x):'
1014 1013 """``min(set)``
1015 1014 Changeset with lowest revision number in set.
1016 1015 """
1017 os = getset(repo, baseset(repo), x)
1016 os = getset(repo, spanset(repo), x)
1018 1017 if os:
1019 1018 m = min(os)
1020 1019 if m in subset:
@@ -1078,9 +1077,9 b' def origin(repo, subset, x):'
1078 1077 for the first operation is selected.
1079 1078 """
1080 1079 if x is not None:
1081 args = getset(repo, baseset(repo), x).set()
1080 args = getset(repo, spanset(repo), x).set()
1082 1081 else:
1083 args = getall(repo, baseset(repo), x).set()
1082 args = getall(repo, spanset(repo), x).set()
1084 1083
1085 1084 def _firstsrc(rev):
1086 1085 src = _getrevsource(repo, rev)
@@ -1130,7 +1129,7 b' def p1(repo, subset, x):'
1130 1129
1131 1130 ps = set()
1132 1131 cl = repo.changelog
1133 for r in getset(repo, baseset(repo), x):
1132 for r in getset(repo, spanset(repo), x):
1134 1133 ps.add(cl.parentrevs(r)[0])
1135 1134 return subset & ps
1136 1135
@@ -1148,7 +1147,7 b' def p2(repo, subset, x):'
1148 1147
1149 1148 ps = set()
1150 1149 cl = repo.changelog
1151 for r in getset(repo, baseset(repo), x):
1150 for r in getset(repo, spanset(repo), x):
1152 1151 ps.add(cl.parentrevs(r)[1])
1153 1152 return subset & ps
1154 1153
@@ -1162,7 +1161,7 b' def parents(repo, subset, x):'
1162 1161
1163 1162 ps = set()
1164 1163 cl = repo.changelog
1165 for r in getset(repo, baseset(repo), x):
1164 for r in getset(repo, spanset(repo), x):
1166 1165 ps.update(cl.parentrevs(r))
1167 1166 return subset & ps
1168 1167
@@ -534,7 +534,7 b' def revrange(repo, revs):'
534 534
535 535 # fall through to new-style queries if old-style fails
536 536 m = revset.match(repo.ui, spec)
537 dl = [r for r in m(repo, revset.baseset(repo)) if r not in seen]
537 dl = [r for r in m(repo, revset.spanset(repo)) if r not in seen]
538 538 l.extend(dl)
539 539 seen.update(dl)
540 540
General Comments 0
You need to be logged in to leave comments. Login now