The remaining revset ordering issues are caused by the pattern
return x - y, which takes x's order unconditionally.
Since there are just 2 users, I'm fixing them in place without introducing
another helper function.
hg-reviewers |
The remaining revset ordering issues are caused by the pattern
return x - y, which takes x's order unconditionally.
Since there are just 2 users, I'm fixing them in place without introducing
another helper function.
Lint Skipped |
Unit Tests Skipped |
Path | Packages | |||
---|---|---|---|---|
M | mercurial/revset.py (14 lines) | |||
M | tests/test-revset-ordering.t (2 lines) |
xs = getlist(x) | xs = getlist(x) | ||||
if order == followorder: | if order == followorder: | ||||
# slow path to take the subset order | # slow path to take the subset order | ||||
return subset & _orsetlist(repo, fullreposet(repo), xs, anyorder) | return subset & _orsetlist(repo, fullreposet(repo), xs, anyorder) | ||||
else: | else: | ||||
return _orsetlist(repo, subset, xs, order) | return _orsetlist(repo, subset, xs, order) | ||||
def notset(repo, subset, x, order): | def notset(repo, subset, x, order): | ||||
return subset - getset(repo, subset, x) | s = subset - getset(repo, subset, x) | ||||
if order == defineorder: | |||||
s.sort() | |||||
return s | |||||
def relationset(repo, subset, x, y, order): | def relationset(repo, subset, x, y, order): | ||||
raise error.ParseError(_("can't use a relation in this context")) | raise error.ParseError(_("can't use a relation in this context")) | ||||
def relsubscriptset(repo, subset, x, y, z, order): | def relsubscriptset(repo, subset, x, y, z, order): | ||||
# this is pretty basic implementation of 'x#y[z]' operator, still | # this is pretty basic implementation of 'x#y[z]' operator, still | ||||
# experimental so undocumented. see the wiki for further ideas. | # experimental so undocumented. see the wiki for further ideas. | ||||
# https://www.mercurial-scm.org/wiki/RevsetOperatorPlan | # https://www.mercurial-scm.org/wiki/RevsetOperatorPlan | ||||
getargs(x, 0, 0, _("head takes no arguments")) | getargs(x, 0, 0, _("head takes no arguments")) | ||||
hs = set() | hs = set() | ||||
cl = repo.changelog | cl = repo.changelog | ||||
for ls in repo.branchmap().itervalues(): | for ls in repo.branchmap().itervalues(): | ||||
hs.update(cl.rev(h) for h in ls) | hs.update(cl.rev(h) for h in ls) | ||||
return baseset(hs) | return baseset(hs) | ||||
@predicate('heads(set)', safe=True) | @predicate('heads(set)', safe=True) | ||||
def heads(repo, subset, x): | def heads(repo, subset, x, order): | ||||
"""Members of set with no children in set. | """Members of set with no children in set. | ||||
""" | """ | ||||
s = getset(repo, subset, x) | s = getset(repo, subset, x, order) - parents(repo, subset, x) | ||||
ps = parents(repo, subset, x) | if order == defineorder: | ||||
return s - ps | s.sort() | ||||
return s | |||||
@predicate('hidden()', safe=True) | @predicate('hidden()', safe=True) | ||||
def hidden(repo, x): | def hidden(repo, x): | ||||
"""Hidden changesets. | """Hidden changesets. | ||||
""" | """ | ||||
# i18n: "hidden" is a keyword | # i18n: "hidden" is a keyword | ||||
getargs(x, 0, 0, _("hidden takes no arguments")) | getargs(x, 0, 0, _("hidden takes no arguments")) | ||||
hiddenrevs = repoview.filterrevs(repo, 'visible') | hiddenrevs = repoview.filterrevs(repo, 'visible') |
$ check '3+1+2' | $ check '3+1+2' | ||||
$ check '(3+1+2)-1' | $ check '(3+1+2)-1' | ||||
$ check '(3+1+2) & (1+3+4)' | $ check '(3+1+2) & (1+3+4)' | ||||
$ check 'A::E' | $ check 'A::E' | ||||
$ check 'E:A' | $ check 'E:A' | ||||
$ check 'E % C' | $ check 'E % C' | ||||
$ check 'not E' | $ check 'not E' | ||||
ordering: defineorder not respected | |||||
$ check 'adds("*")' | $ check 'adds("*")' | ||||
$ check 'all()' | $ check 'all()' | ||||
$ check 'ancestors(E)' | $ check 'ancestors(E)' | ||||
$ check 'author(test)' | $ check 'author(test)' | ||||
$ check 'bisect(untested)' | $ check 'bisect(untested)' | ||||
$ check 'bookmark()' | $ check 'bookmark()' | ||||
$ check 'branch(default)' | $ check 'branch(default)' | ||||
$ check 'branchpoint()' | $ check 'branchpoint()' | ||||
$ check 'children(A)' | $ check 'children(A)' | ||||
$ check 'closed()' | $ check 'closed()' | ||||
$ check 'contains(A)' | $ check 'contains(A)' | ||||
$ check 'date("0 0")' | $ check 'date("0 0")' | ||||
$ check 'desc("")' | $ check 'desc("")' | ||||
$ check 'descendants(A)' | $ check 'descendants(A)' | ||||
$ check 'destination()' | $ check 'destination()' | ||||
$ check 'draft()' | $ check 'draft()' | ||||
$ check 'file("*")' | $ check 'file("*")' | ||||
$ check 'filelog("A")' | $ check 'filelog("A")' | ||||
$ check 'follow()' | $ check 'follow()' | ||||
$ check 'grep("A")' | $ check 'grep("A")' | ||||
$ check 'head()' | $ check 'head()' | ||||
$ check 'heads(E+C)' | $ check 'heads(E+C)' | ||||
ordering: followorder not respected | |||||
$ check 'merge()' | $ check 'merge()' | ||||
$ check 'modifies("A")' | $ check 'modifies("A")' | ||||
$ check 'named("tags")' | $ check 'named("tags")' | ||||
$ check 'origin()' | $ check 'origin()' | ||||
$ check 'outgoing()' | $ check 'outgoing()' | ||||
$ check 'p1(B+E+D)' | $ check 'p1(B+E+D)' | ||||
$ check 'p2(B+E+D)' | $ check 'p2(B+E+D)' | ||||
$ check 'parents(E)' | $ check 'parents(E)' | ||||
$ check 'public()' | $ check 'public()' | ||||
$ check 'reverse(B+E+D)' | $ check 'reverse(B+E+D)' | ||||
$ check 'removes("A")' | $ check 'removes("A")' | ||||
$ check 'roots(B+E+D)' | $ check 'roots(B+E+D)' | ||||
$ check 'secret()' | $ check 'secret()' | ||||
$ check 'sort(all())' | $ check 'sort(all())' | ||||
$ check 'tagged()' | $ check 'tagged()' |