##// END OF EJS Templates
revset: fixed bug where revset returning order was being changed...
Lucas Moscovicz -
r20393:b0638b5b default
parent child Browse files
Show More
@@ -310,8 +310,7 b' def _ancestors(repo, subset, x, followfi'
310 if not args:
310 if not args:
311 return baseset([])
311 return baseset([])
312 s = set(_revancestors(repo, args, followfirst)) | set(args)
312 s = set(_revancestors(repo, args, followfirst)) | set(args)
313 ss = subset.set()
313 return baseset([r for r in subset if r in s])
314 return baseset([r for r in ss if r in s])
315
314
316 def ancestors(repo, subset, x):
315 def ancestors(repo, subset, x):
317 """``ancestors(set)``
316 """``ancestors(set)``
@@ -339,8 +338,7 b' def ancestorspec(repo, subset, x, n):'
339 for i in range(n):
338 for i in range(n):
340 r = cl.parentrevs(r)[0]
339 r = cl.parentrevs(r)[0]
341 ps.add(r)
340 ps.add(r)
342 s = subset.set()
341 return baseset([r for r in subset if r in ps])
343 return baseset([r for r in s if r in ps])
344
342
345 def author(repo, subset, x):
343 def author(repo, subset, x):
346 """``author(string)``
344 """``author(string)``
@@ -367,8 +365,7 b' def bisect(repo, subset, x):'
367 # i18n: "bisect" is a keyword
365 # i18n: "bisect" is a keyword
368 status = getstring(x, _("bisect requires a string")).lower()
366 status = getstring(x, _("bisect requires a string")).lower()
369 state = set(hbisect.get(repo, status))
367 state = set(hbisect.get(repo, status))
370 s = subset.set()
368 return baseset([r for r in subset if r in state])
371 return baseset([r for r in s if r in state])
372
369
373 # Backward-compatibility
370 # Backward-compatibility
374 # - no help entry so that we do not advertise it any more
371 # - no help entry so that we do not advertise it any more
@@ -411,8 +408,7 b' def bookmark(repo, subset, x):'
411
408
412 bms = set([repo[r].rev()
409 bms = set([repo[r].rev()
413 for r in repo._bookmarks.values()])
410 for r in repo._bookmarks.values()])
414 s = subset.set()
411 return baseset([r for r in subset if r in bms])
415 return baseset([r for r in s if r in bms])
416
412
417 def branch(repo, subset, x):
413 def branch(repo, subset, x):
418 """``branch(string or set)``
414 """``branch(string or set)``
@@ -607,8 +603,7 b' def _descendants(repo, subset, x, follow'
607 if not args:
603 if not args:
608 return baseset([])
604 return baseset([])
609 s = set(_revdescendants(repo, args, followfirst)) | set(args)
605 s = set(_revdescendants(repo, args, followfirst)) | set(args)
610 ss = subset.set()
606 return baseset([r for r in subset if r in s])
611 return baseset([r for r in ss if r in s])
612
607
613 def descendants(repo, subset, x):
608 def descendants(repo, subset, x):
614 """``descendants(set)``
609 """``descendants(set)``
@@ -748,8 +743,7 b' def filelog(repo, subset, x):'
748 for fr in fl:
743 for fr in fl:
749 s.add(fl.linkrev(fr))
744 s.add(fl.linkrev(fr))
750
745
751 ss = subset.set()
746 return baseset([r for r in subset if r in s])
752 return baseset([r for r in ss if r in s])
753
747
754 def first(repo, subset, x):
748 def first(repo, subset, x):
755 """``first(set, [n])``
749 """``first(set, [n])``
@@ -772,8 +766,7 b' def _follow(repo, subset, x, name, follo'
772 else:
766 else:
773 s = set(_revancestors(repo, [c.rev()], followfirst)) | set([c.rev()])
767 s = set(_revancestors(repo, [c.rev()], followfirst)) | set([c.rev()])
774
768
775 ss = subset.set()
769 return baseset([r for r in subset if r in s])
776 return baseset([r for r in ss if r in s])
777
770
778 def follow(repo, subset, x):
771 def follow(repo, subset, x):
779 """``follow([file])``
772 """``follow([file])``
@@ -902,8 +895,7 b' def head(repo, subset, x):'
902 hs = set()
895 hs = set()
903 for b, ls in repo.branchmap().iteritems():
896 for b, ls in repo.branchmap().iteritems():
904 hs.update(repo[h].rev() for h in ls)
897 hs.update(repo[h].rev() for h in ls)
905 s = subset.set()
898 return baseset([r for r in subset if r in hs])
906 return baseset([r for r in s if r in hs])
907
899
908 def heads(repo, subset, x):
900 def heads(repo, subset, x):
909 """``heads(set)``
901 """``heads(set)``
@@ -1085,8 +1077,7 b' def origin(repo, subset, x):'
1085 src = prev
1077 src = prev
1086
1078
1087 o = set([_firstsrc(r) for r in args])
1079 o = set([_firstsrc(r) for r in args])
1088 s = subset.set()
1080 return baseset([r for r in subset if r in o])
1089 return baseset([r for r in s if r in o])
1090
1081
1091 def outgoing(repo, subset, x):
1082 def outgoing(repo, subset, x):
1092 """``outgoing([path])``
1083 """``outgoing([path])``
@@ -1109,8 +1100,7 b' def outgoing(repo, subset, x):'
1109 repo.ui.popbuffer()
1100 repo.ui.popbuffer()
1110 cl = repo.changelog
1101 cl = repo.changelog
1111 o = set([cl.rev(r) for r in outgoing.missing])
1102 o = set([cl.rev(r) for r in outgoing.missing])
1112 s = subset.set()
1103 return baseset([r for r in subset if r in o])
1113 return baseset([r for r in s if r in o])
1114
1104
1115 def p1(repo, subset, x):
1105 def p1(repo, subset, x):
1116 """``p1([set])``
1106 """``p1([set])``
@@ -2070,10 +2060,9 b' class baseset(list):'
2070 return baseset(self.set() - s)
2060 return baseset(self.set() - s)
2071
2061
2072 def __and__(self, x):
2062 def __and__(self, x):
2073 s = self.set()
2074 if isinstance(x, baseset):
2063 if isinstance(x, baseset):
2075 x = x.set()
2064 x = x.set()
2076 return baseset([y for y in s if y in x])
2065 return baseset([y for y in self if y in x])
2077
2066
2078 # tell hggettext to extract docstrings from these functions:
2067 # tell hggettext to extract docstrings from these functions:
2079 i18nfunctions = symbols.values()
2068 i18nfunctions = symbols.values()
@@ -414,6 +414,16 b' ancestor can accept 0 or more arguments'
414 2
414 2
415 1
415 1
416 0
416 0
417 $ log '1:: and reverse(all())'
418 9
419 8
420 7
421 6
422 5
423 4
424 3
425 2
426 1
417 $ log 'rev(5)'
427 $ log 'rev(5)'
418 5
428 5
419 $ log 'sort(limit(reverse(all()), 3))'
429 $ log 'sort(limit(reverse(all()), 3))'
General Comments 0
You need to be logged in to leave comments. Login now