diff mercurial/obsutil.py @ 34419:fa26f5891e68

effectflag: detect when parents changed Store in effect flag when the parents changed between the predecessor and its successors. It can happens with "hg rebase" or "hg grab". Differential Revision: https://phab.mercurial-scm.org/D539
author Boris Feld <boris.feld@octobus.net>
date Thu, 06 Jul 2017 14:56:16 +0200
parents 57980af73cfa
children 95759620d492
line wrap: on
line diff
--- a/mercurial/obsutil.py	Thu Jul 06 14:55:12 2017 +0200
+++ b/mercurial/obsutil.py	Thu Jul 06 14:56:16 2017 +0200
@@ -309,6 +309,7 @@
 EFFECTFLAGFIELD = "ef1"
 
 DESCCHANGED = 1 << 0 # action changed the description
+PARENTCHANGED = 1 << 2 # action change the parent
 USERCHANGED = 1 << 4 # the user changed
 DATECHANGED = 1 << 5 # the date changed
 BRANCHCHANGED = 1 << 6 # the branch changed
@@ -338,6 +339,10 @@
         if changectx.branch() != source.branch():
             effects |= BRANCHCHANGED
 
+        # Check if at least one of the parent has changed
+        if changectx.parents() != source.parents():
+            effects |= PARENTCHANGED
+
     return effects
 
 def getobsoleted(repo, tr):