Patchwork D536: effectflag: detect when user changed

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

Comments

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

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D536?vs=1340&id=2107

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

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
@@ -40,7 +40,7 @@ 
 check result
 
   $ hg debugobsolete --rev .
-  ef4a313b1e0ade55718395d80e6b88c5ccd875eb 5485c92d34330dac9d7a63dc07e1e3373835b964 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'amend', 'user': 'test'}
+  ef4a313b1e0ade55718395d80e6b88c5ccd875eb 5485c92d34330dac9d7a63dc07e1e3373835b964 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '16', 'operation': 'amend', 'user': 'test'}
 
 amend touching the date only
 ----------------------------
@@ -106,7 +106,7 @@ 
 check result
 
   $ hg debugobsolete --rev .
-  fad47e5bd78e6aa4db1b5a0a1751bc12563655ff a94e0fd5f1c81d969381a76eb0d37ce499a44fae 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'test'}
+  fad47e5bd78e6aa4db1b5a0a1751bc12563655ff a94e0fd5f1c81d969381a76eb0d37ce499a44fae 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '17', '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
@@ -309,6 +309,7 @@ 
 EFFECTFLAGFIELD = "ef1"
 
 DESCCHANGED = 1 << 0 # action changed the description
+USERCHANGED = 1 << 4 # the user changed
 
 def geteffectflag(relation):
     """ From an obs-marker relation, compute what changed between the
@@ -323,6 +324,10 @@ 
         if changectx.description() != source.description():
             effects |= DESCCHANGED
 
+        # Check if user has changed
+        if changectx.user() != source.user():
+            effects |= USERCHANGED
+
     return effects
 
 def getobsoleted(repo, tr):