Skip to content
Snippets Groups Projects
Commit a5a95642 authored by Yuya Nishihara's avatar Yuya Nishihara
Browse files

revrange: build spanset from x:y range

This slightly improves the performance in the optimal case:

% hg log -R mozilla-central -r0:tip -l1 --time
(before)
time: real 0.050 secs (user 0.040+0.000 sys 0.010+0.000)
(after)
time: real 0.020 secs (user 0.000+0.000 sys 0.010+0.000)
parent a26a5540
No related branches found
No related tags found
No related merge requests found
......@@ -737,8 +737,10 @@
end = revfix(repo, end, len(repo) - 1)
if end == nullrev and start < 0:
start = nullrev
rangeiter = repo.changelog.revs(start, end)
l = revset.baseset(rangeiter)
if start < end:
l = revset.spanset(repo, start, end + 1)
else:
l = revset.spanset(repo, start, end - 1)
subsets.append(l)
continue
elif spec and spec in repo: # single unquoted rev
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment