Skip to content
Snippets Groups Projects
Commit c0b2ee53 authored by Georges Racinet's avatar Georges Racinet
Browse files

revset_from_git_revspec: simplified control flow

We find it clearer that way. It is quite possible that
the automatic sorting will be found to be undesireable in
the future (e.g, if caller needs to apply another layer
of sorting)
parent eeb14fd2
No related branches found
No related tags found
2 merge requests!127Merged stable branch into default,!126FindCommits: avoid looping explosions related to `follow`
......@@ -44,8 +44,6 @@
if b'...' in revspec:
r1, r2 = revspec.split(b'...')
revset = revset_symmetric_difference(repo, r1, r2)
revset = b"sort(%s, -rev)" % revset
return revset
elif b'..' in revspec:
r1, r2 = revspec.split(b'..')
revset = revset_git_range(repo, r1, r2)
......@@ -49,9 +47,7 @@
elif b'..' in revspec:
r1, r2 = revspec.split(b'..')
revset = revset_git_range(repo, r1, r2)
revset = b"sort(%s, -rev)" % revset
return revset
else: # single revision
ctx = gitlab_revision_changeset(repo, revspec)
if ctx is None:
return None
......@@ -54,9 +50,10 @@
else: # single revision
ctx = gitlab_revision_changeset(repo, revspec)
if ctx is None:
return None
revset = ctx.hex() if for_follow else b"reverse(::%s)" % ctx
return revset
return ctx.hex() if for_follow else b"reverse(::%s)" % ctx
return b"sort(%s, -rev)" % revset
def revset_git_range(repo, r1, r2):
......
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