D537: effectflag: detect when date changed
lothiraldan (Boris Feld)
phabricator at mercurial-scm.org
Wed Sep 27 08:07:57 UTC 2017
lothiraldan updated this revision to Diff 2108.
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D537?vs=1341&id=2108
REVISION DETAIL
https://phab.mercurial-scm.org/D537
AFFECTED FILES
mercurial/obsutil.py
tests/test-obsmarkers-effectflag.t
CHANGE DETAILS
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
@@ -51,7 +51,7 @@
check result
$ hg debugobsolete --rev .
- 2ef0680ff45038ac28c9f1ff3644341f54487280 4dd84345082e9e5291c2e6b3f335bbf8bf389378 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'amend', 'user': 'test'}
+ 2ef0680ff45038ac28c9f1ff3644341f54487280 4dd84345082e9e5291c2e6b3f335bbf8bf389378 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '32', 'operation': 'amend', 'user': 'test'}
amend touching the branch only
----------------------------
@@ -106,7 +106,7 @@
check result
$ hg debugobsolete --rev .
- fad47e5bd78e6aa4db1b5a0a1751bc12563655ff a94e0fd5f1c81d969381a76eb0d37ce499a44fae 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '17', 'operation': 'amend', 'user': 'test'}
+ fad47e5bd78e6aa4db1b5a0a1751bc12563655ff a94e0fd5f1c81d969381a76eb0d37ce499a44fae 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '49', '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
@@ -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):
To: lothiraldan, #hg-reviewers
Cc: mercurial-devel
More information about the Mercurial-devel
mailing list