diff mercurial/obsutil.py @ 34415:51aadc0d0da2

effectflag: detect when description changed Store in effect flag when the description changed between the predecessor and its successors. It can happens with "hg commit --amend -e", "hg amend -e" or "histedit". Differential Revision: https://phab.mercurial-scm.org/D535
author Boris Feld <boris.feld@octobus.net>
date Thu, 06 Jul 2017 14:52:34 +0200
parents 014d467f9d08
children 55ef17ec8e59
line wrap: on
line diff
--- a/mercurial/obsutil.py	Thu Jul 06 14:51:08 2017 +0200
+++ b/mercurial/obsutil.py	Thu Jul 06 14:52:34 2017 +0200
@@ -308,6 +308,8 @@
 # logic around storing and using effect flags
 EFFECTFLAGFIELD = "ef1"
 
+DESCCHANGED = 1 << 0 # action changed the description
+
 def geteffectflag(relation):
     """ From an obs-marker relation, compute what changed between the
     predecessor and the successor.
@@ -316,6 +318,11 @@
 
     source = relation[0]
 
+    for changectx in relation[1]:
+        # Check if description has changed
+        if changectx.description() != source.description():
+            effects |= DESCCHANGED
+
     return effects
 
 def getobsoleted(repo, tr):