--- a/hgext3rd/evolve/obshistory.py Sat Jan 11 19:49:45 2020 +0700
+++ b/hgext3rd/evolve/obshistory.py Sat Jan 11 20:06:26 2020 +0700
@@ -786,6 +786,16 @@
return {b'users': sorted(users)}
+EFFECTMAPPING = util.sortdict([
+ (DESCCHANGED, b'description'),
+ (METACHANGED, b'meta'),
+ (USERCHANGED, b'user'),
+ (DATECHANGED, b'date'),
+ (BRANCHCHANGED, b'branch'),
+ (PARENTCHANGED, b'parent'),
+ (DIFFCHANGED, b'content'),
+])
+
def _markerseffects(markers):
""" Return a list of effects as strings based on effect flags in markers
@@ -802,21 +812,9 @@
combined |= int(ef)
if combined:
- # XXX should be a dict
- if combined & DESCCHANGED:
- effects.append(b'description')
- if combined & METACHANGED:
- effects.append(b'meta')
- if combined & USERCHANGED:
- effects.append(b'user')
- if combined & DATECHANGED:
- effects.append(b'date')
- if combined & BRANCHCHANGED:
- effects.append(b'branch')
- if combined & PARENTCHANGED:
- effects.append(b'parent')
- if combined & DIFFCHANGED:
- effects.append(b'content')
+ for key, value in EFFECTMAPPING.items():
+ if combined & key:
+ effects.append(value)
return effects