diff mercurial/obsutil.py @ 34418:57980af73cfa

effectflag: detect when branch changed Store in effect flag when the branch changed between the predecessor and its successors. It can happens with "hg branch" + "hg commit --amend", "hg branch" + "hg amend" or "histedit". Differential Revision: https://phab.mercurial-scm.org/D538
author Boris Feld <boris.feld@octobus.net>
date Thu, 06 Jul 2017 14:55:12 +0200
parents 54af8de9bd09
children fa26f5891e68
line wrap: on
line diff
--- a/mercurial/obsutil.py	Thu Jul 06 14:54:22 2017 +0200
+++ b/mercurial/obsutil.py	Thu Jul 06 14:55:12 2017 +0200
@@ -311,6 +311,7 @@
 DESCCHANGED = 1 << 0 # action changed the description
 USERCHANGED = 1 << 4 # the user changed
 DATECHANGED = 1 << 5 # the date changed
+BRANCHCHANGED = 1 << 6 # the branch changed
 
 def geteffectflag(relation):
     """ From an obs-marker relation, compute what changed between the
@@ -333,6 +334,10 @@
         if changectx.date() != source.date():
             effects |= DATECHANGED
 
+        # Check if branch has changed
+        if changectx.branch() != source.branch():
+            effects |= BRANCHCHANGED
+
     return effects
 
 def getobsoleted(repo, tr):