gitrange(): always check negatives first

Also, always add the parents as negatives.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
This commit is contained in:
Felipe Contreras
2019-06-20 14:34:14 -05:00
parent fe8b8c1a61
commit 1d85449b0b

View File

@@ -487,19 +487,17 @@ def gitrange(repo, a, b):
parents = [p for p in pfunc(cur) if p >= 0]
if cur in pending:
if cur in negative:
negative.remove(cur)
for p in parents:
negative.add(p)
pending.discard(p)
elif cur in pending:
positive.append(cur)
pending.remove(cur)
for p in parents:
if p not in negative:
pending.add(p)
elif cur in negative:
negative.remove(cur)
for p in parents:
if p not in pending:
negative.add(p)
else:
pending.discard(p)
positive.reverse()
return positive