--- a/hgext3rd/evolve/obshistory.py Fri Jan 17 20:40:24 2020 +0700
+++ b/hgext3rd/evolve/obshistory.py Sat Jan 11 19:24:21 2020 +0700
@@ -847,6 +847,24 @@
DIFFCHANGED: b"amended"
}
+def _markerspreciseverb(markers):
+ """ Return a more precise verb based on effect flags in markers
+
+ Return None if verb cannot be more precise than just "rewritten", i.e. when
+ markers collectively have more than one effect in the flags.
+ """
+ metadata = [dict(marker[3]) for marker in markers]
+ ef1 = [data.get(b'ef1') for data in metadata]
+
+ if all(ef1):
+ combined = 0
+ for ef in ef1:
+ combined |= int(ef)
+
+ # Combined will be in VERBMAPPING only if one bit is set
+ if combined in VERBMAPPING:
+ return VERBMAPPING[combined]
+
def _successorsetverb(successorset, markers):
""" Return the verb summarizing the successorset
"""
@@ -854,19 +872,7 @@
if not successorset:
verb = b'pruned'
elif len(successorset) == 1:
- # Check for effect flag
-
- metadata = [dict(marker[3]) for marker in markers]
- ef1 = [data.get(b'ef1') for data in metadata]
-
- if all(ef1):
- combined = 0
- for ef in ef1:
- combined |= int(ef)
-
- # Combined will be in VERBMAPPING only of one bit is set
- if combined in VERBMAPPING:
- verb = VERBMAPPING[combined]
+ verb = _markerspreciseverb(markers)
if verb is None:
verb = b'rewritten'