Patchwork D539: effectflag: detect when parents changed

login
register
mail settings
Submitter phabricator
Date Sept. 27, 2017, 8:08 a.m.
Message ID <2d817e57890762531cead995c0b89a38@localhost.localdomain>
Download mbox | patch
Permalink /patch/24175/
State Not Applicable
Headers show

Comments

phabricator - Sept. 27, 2017, 8:08 a.m.
lothiraldan updated this revision to Diff 2110.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D539?vs=1343&id=2110

REVISION DETAIL
  https://phab.mercurial-scm.org/D539

AFFECTED FILES
  mercurial/obsutil.py
  tests/test-obsmarkers-effectflag.t

CHANGE DETAILS




To: lothiraldan, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/tests/test-obsmarkers-effectflag.t b/tests/test-obsmarkers-effectflag.t
--- a/tests/test-obsmarkers-effectflag.t
+++ b/tests/test-obsmarkers-effectflag.t
@@ -81,7 +81,7 @@ 
 check result
 
   $ hg debugobsolete --rev .
-  c85eff83a0340efd9da52b806a94c350222f3371 da86aa2f19a30d6686b15cae15c7b6c908ec9699 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'rebase', 'user': 'test'}
+  c85eff83a0340efd9da52b806a94c350222f3371 da86aa2f19a30d6686b15cae15c7b6c908ec9699 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'}
 
 amend touching the diff
 -----------------------
@@ -150,7 +150,7 @@ 
   rebasing 17:b57fed8d8322 "H1"
   merging H0
   $ hg debugobsolete -r tip
-  b57fed8d83228a8ae3748d8c3760a77638dd4f8c e509e2eb3df5d131ff7c02350bf2a9edd0c09478 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'rebase', 'user': 'test'}
+  b57fed8d83228a8ae3748d8c3760a77638dd4f8c e509e2eb3df5d131ff7c02350bf2a9edd0c09478 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'}
 
 amend closing the branch should be detected as meta change
 ----------------------------------------------------------
diff --git a/mercurial/obsutil.py b/mercurial/obsutil.py
--- a/mercurial/obsutil.py
+++ b/mercurial/obsutil.py
@@ -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):