Mercurial > hg > evolve
changeset 2545:0b05142117d2
effectflag: detect parent change
Add the detection of parent changes.
author | Boris Feld <boris.feld@octobus.net> |
---|---|
date | Fri, 19 May 2017 19:52:57 +0200 |
parents | 66f05d5f4769 |
children | 98613938d098 |
files | hgext3rd/evolve/obshistory.py tests/test-evolve-effectflags.t |
diffstat | 2 files changed, 24 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext3rd/evolve/obshistory.py +++ b/hgext3rd/evolve/obshistory.py @@ -360,6 +360,7 @@ # logic around storing and using effect flags DESCCHANGED = 1 << 0 # action changed the description METACHANGED = 1 << 1 # action change the meta (user, date, branch, etc...) +PARENTCHANGED = 1 << 2 # action change the parent def geteffectflag(relation): """compute the effect flag by comparing the source and destination""" @@ -382,6 +383,10 @@ if changectx.branch() != source.branch(): effects |= METACHANGED + # Check if at least one of the parent has changes + if changectx.parents() != source.parents(): + effects |= PARENTCHANGED + return effects @eh.wrapfunction(obsolete, 'createmarkers')
--- a/tests/test-evolve-effectflags.t +++ b/tests/test-evolve-effectflags.t @@ -11,6 +11,7 @@ > publish=False > [extensions] > evolve = + > rebase = > [experimental] > evolution.effect-flags = 1 > EOF @@ -52,3 +53,21 @@ x ef4a313b1e0a (3) B0 rewritten by test (*) as 5485c92d3433 (glob) +rebase (parents change) +----------------------- + + $ mkcommit C0 + $ mkcommit D0 + $ hg rebase -r . -d 'desc(B0)' + rebasing 6:2ee0a31bd600 "D0" (tip) + +check result + + $ hg debugobsolete --rev . + 2ee0a31bd600ca999a5e6e69bfdfde3f9c78a6f9 131ac3eecd92fb2dfd2fc59bb5e0b8efbe9e9201 0 (*) {'ef1': '4', 'user': 'test'} (glob) + $ hg obslog . + @ 131ac3eecd92 (7) D0 + | + x 2ee0a31bd600 (6) D0 + rewritten by test (*) as 131ac3eecd92 (glob) +