diff hgext3rd/evolve/obshistory.py @ 2492:c9f1118b33d6

effectflag: split effect flag meta Split effect flag meta into 3 separate flags: - USERCHANGED - DATECHANGED - BRANCHCHANGED Also display them separately for the moment, they could be grouped back together if we want later.
author Boris Feld <boris.feld@octobus.net>
date Fri, 26 May 2017 18:27:59 +0200
parents 94f171534918
children 5fb5d096348c
line wrap: on
line diff
--- a/hgext3rd/evolve/obshistory.py	Fri May 26 21:31:07 2017 +0200
+++ b/hgext3rd/evolve/obshistory.py	Fri May 26 18:27:59 2017 +0200
@@ -367,6 +367,12 @@
             effect.append('description')
         if effectflag & METACHANGED:
             effect.append('meta')
+        if effectflag & USERCHANGED:
+            effect.append('user')
+        if effectflag & DATECHANGED:
+            effect.append('date')
+        if effectflag & BRANCHCHANGED:
+            effect.append('branch')
         if effectflag & PARENTCHANGED:
             effect.append('parent')
         if effectflag & DIFFCHANGED:
@@ -397,9 +403,12 @@
 
 # logic around storing and using effect flags
 DESCCHANGED = 1 << 0 # action changed the description
-METACHANGED = 1 << 1 # action change the meta (user, date, branch, etc...)
+METACHANGED = 1 << 1 # action change the meta (user, date, branch, etc...) OLD
 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
 
 def geteffectflag(relation):
     """compute the effect flag by comparing the source and destination"""
@@ -413,10 +422,14 @@
             effects |= DESCCHANGED
 
         # Check if known meta has changed
-        if (changectx.user() != source.user()
-                or changectx.date() != source.date()
-                or changectx.branch() != source.branch()):
-            effects |= METACHANGED
+        if changectx.user() != source.user():
+            effects |= USERCHANGED
+
+        if changectx.date() != source.date():
+            effects |= DATECHANGED
+
+        if changectx.branch() != source.branch():
+            effects |= BRANCHCHANGED
 
         # Check if at least one of the parent has changes
         if changectx.parents() != source.parents():