Skip to content
Snippets Groups Projects
Commit 9bececdd authored by Sushil Khanchi's avatar Sushil Khanchi :koala:
Browse files

commit: make sure we return all revisions expected by r1...r2 revspec

There was a case, found while writing gitaly comparison test for FindCommits
(next patch) where current DAG logic missed some cset to include.

r1...r2 revspec means, csets ancestor of r1 or r2, but not ancestor of both.

Graph:

  D
  | \
  B  C
  |  |
  | /
  A
  |
  O

revspec: 'D...B'
Expected revs: (D, C)
Logic before this patch would return: (D,)
parent 160a2b68
No related branches found
No related tags found
1 merge request!60CommitService: add gitaly comparison tests for FindCommits
......@@ -654,9 +654,7 @@
left = ctx_start.rev()
right = ctx_end.rev()
branchpoint = repo.revs(b"ancestor(%d, %d)" % (left, right)).first()
revset = b"(%d::%d | %d::%d) - %d" % (
branchpoint, left, branchpoint, right, branchpoint
)
revset = b"only(%d + %d, %d)" % (left, right, branchpoint)
# sort them in descending order
revset = b"sort(%s, -rev)" % revset
return revset
......
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