changeset 5068:715c85f250e0

obshistory: use effect flags from obsutil They were added there in 51aadc0d0da2::187bc224554a (hg 4.4).
author Anton Shestakov <av6@dwimlabs.net>
date Sat, 11 Jan 2020 20:10:06 +0700
parents e07f6af3cfec
children ada8b7413c0a
files hgext3rd/evolve/obshistory.py
diffstat 1 files changed, 14 insertions(+), 23 deletions(-) [+]
line wrap: on
line diff
--- a/hgext3rd/evolve/obshistory.py	Sat Jan 11 20:06:26 2020 +0700
+++ b/hgext3rd/evolve/obshistory.py	Sat Jan 11 20:10:06 2020 +0700
@@ -695,15 +695,6 @@
 
     fm.plain(b"\n")
 
-# logic around storing and using effect flags
-DESCCHANGED = 1 << 0 # action changed the description
-METACHANGED = 1 << 1 # action change the meta
-PARENTCHANGED = 1 << 2 # action change the parent
-DIFFCHANGED = 1 << 3 # action change diff introduced by the changeset
-USERCHANGED = 1 << 4 # the user changed
-DATECHANGED = 1 << 5 # the date changed
-BRANCHCHANGED = 1 << 6 # the branch changed
-
 METABLACKLIST = [
     re.compile(br'^__touch-noise__$'),
     re.compile(br'^branch$'),
@@ -787,13 +778,13 @@
     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'),
+    (obsutil.DESCCHANGED, b'description'),
+    (obsutil.METACHANGED, b'meta'),
+    (obsutil.USERCHANGED, b'user'),
+    (obsutil.DATECHANGED, b'date'),
+    (obsutil.BRANCHCHANGED, b'branch'),
+    (obsutil.PARENTCHANGED, b'parent'),
+    (obsutil.DIFFCHANGED, b'content'),
 ])
 
 def _markerseffects(markers):
@@ -819,13 +810,13 @@
     return effects
 
 VERBMAPPING = {
-    DESCCHANGED: b"reworded",
-    METACHANGED: b"meta-changed",
-    USERCHANGED: b"reauthored",
-    DATECHANGED: b"date-changed",
-    BRANCHCHANGED: b"branch-changed",
-    PARENTCHANGED: b"rebased",
-    DIFFCHANGED: b"amended"
+    obsutil.DESCCHANGED: b"reworded",
+    obsutil.METACHANGED: b"meta-changed",
+    obsutil.USERCHANGED: b"reauthored",
+    obsutil.DATECHANGED: b"date-changed",
+    obsutil.BRANCHCHANGED: b"branch-changed",
+    obsutil.PARENTCHANGED: b"rebased",
+    obsutil.DIFFCHANGED: b"amended"
 }
 
 def _markerspreciseverb(markers):