diff mercurial/obsutil.py @ 34417:54af8de9bd09

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