Patchwork D535: effectflag: detect when description changed

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

Comments

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

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D535?vs=1339&id=2106

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

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
@@ -29,7 +29,7 @@ 
 check result
 
   $ hg debugobsolete --rev .
-  471f378eab4c5e25f6c77f785b27c936efb22874 fdf9bde5129a28d4548fadd3f62b265cdd3b7a2e 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'amend', 'user': 'test'}
+  471f378eab4c5e25f6c77f785b27c936efb22874 fdf9bde5129a28d4548fadd3f62b265cdd3b7a2e 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'test'}
 
 amend touching the user only
 ----------------------------
@@ -106,7 +106,7 @@ 
 check result
 
   $ hg debugobsolete --rev .
-  fad47e5bd78e6aa4db1b5a0a1751bc12563655ff a94e0fd5f1c81d969381a76eb0d37ce499a44fae 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'amend', 'user': 'test'}
+  fad47e5bd78e6aa4db1b5a0a1751bc12563655ff a94e0fd5f1c81d969381a76eb0d37ce499a44fae 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'test'}
 
 rebase not touching the diff
 ----------------------------
diff --git a/mercurial/obsutil.py b/mercurial/obsutil.py
--- a/mercurial/obsutil.py
+++ b/mercurial/obsutil.py
@@ -308,14 +308,21 @@ 
 # 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.
     """
     effects = 0
 
     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):