Mercurial > evolve
changeset 5279:b1a564cb18d0
obshistory: add _predecessorsverb() similar to _successorsetverb()
author | Anton Shestakov <av6@dwimlabs.net> |
---|---|
date | Tue, 21 Apr 2020 23:40:44 +0800 |
parents | 99c25397889e |
children | a81631766575 |
files | hgext3rd/evolve/obshistory.py |
diffstat | 1 files changed, 20 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext3rd/evolve/obshistory.py Sat Apr 25 18:51:23 2020 +0800 +++ b/hgext3rd/evolve/obshistory.py Tue Apr 21 23:40:44 2020 +0800 @@ -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):