This instance will be upgraded to Heptapod 0.31.0rc on 2022-05-19 at 11:00 UTC+2 (a few minutes of down time)

Commit b1a564cb authored by Anton Shestakov's avatar Anton Shestakov
Browse files

obshistory: add _predecessorsverb() similar to _successorsetverb()

parent 99c25397889e
......@@ -738,6 +738,26 @@
verb = b'split'
return {b'verb': verb}
def _predecessorsverb(predecessors, markers):
""" Return the verb summarizing a set of predecessors and related markers.
"""
verb = None
if not predecessors:
# we got successors instead of predecessors, and they are empty
# (this is a special case for showing prunes)
verb = b'pruned'
elif len(markers) == 1 and len(markers[0][1]) > 1:
# peeked at the successors to see if this is a split
verb = b'split'
elif len(predecessors) == 1:
verb = _markerspreciseverb(markers)
if verb is None:
verb = b'rewritten'
else:
verb = b'folded'
return verb
# Use a more advanced version of obsfateverb that uses effect-flag
@eh.wrapfunction(obsutil, 'obsfateverb')
def obsfateverb(orig, *args, **kwargs):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment