# HG changeset patch # User Boris Feld # Date 1495216377 -7200 # Node ID 0b05142117d2dbd0639d1f96f66fdab75f6a66b7 # Parent 66f05d5f47695cd7220e530a1e8feaae900c5f71 effectflag: detect parent change Add the detection of parent changes. diff -r 66f05d5f4769 -r 0b05142117d2 hgext3rd/evolve/obshistory.py --- a/hgext3rd/evolve/obshistory.py Fri May 19 19:48:44 2017 +0200 +++ b/hgext3rd/evolve/obshistory.py Fri May 19 19:52:57 2017 +0200 @@ -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') diff -r 66f05d5f4769 -r 0b05142117d2 tests/test-evolve-effectflags.t --- a/tests/test-evolve-effectflags.t Fri May 19 19:48:44 2017 +0200 +++ b/tests/test-evolve-effectflags.t Fri May 19 19:52:57 2017 +0200 @@ -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) +