# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 1517560173 -19800 # Node ID a03bb02dfaba289467bcf338ff42d58c4bb66e7e # Parent 05fe5239fca22516a14a5b860593f2beeca55d64 grab: preserve phase of the grabbed changeset This patch fixes the wrong behavior of loosing secret phase of the grabbed changeset. diff -r 05fe5239fca2 -r a03bb02dfaba hgext3rd/evolve/cmdrewrite.py --- a/hgext3rd/evolve/cmdrewrite.py Fri Feb 02 13:45:47 2018 +0530 +++ b/hgext3rd/evolve/cmdrewrite.py Fri Feb 02 13:59:33 2018 +0530 @@ -1224,8 +1224,11 @@ orignode = grabstate['orignode'] origctx = repo[orignode] - newnode = repo.commit(text=origctx.description(), user=origctx.user(), - date=origctx.date(), extra=origctx.extra()) + overrides = {('phases', 'new-commit'): origctx.phase()} + with repo.ui.configoverride(overrides, 'grab'): + newnode = repo.commit(text=origctx.description(), + user=origctx.user(), + date=origctx.date(), extra=origctx.extra()) if grabstate: grabstate.delete() diff -r 05fe5239fca2 -r a03bb02dfaba tests/test-grab.t --- a/tests/test-grab.t Fri Feb 02 13:45:47 2018 +0530 +++ b/tests/test-grab.t Fri Feb 02 13:59:33 2018 +0530 @@ -262,7 +262,7 @@ $ hg grab --continue $ hg phase -r . - 10: draft + 10: secret No merge conflicts @@ -299,4 +299,4 @@ grabbing 11:508d572e7053 "added l" $ hg phase -r . - 12: draft + 12: secret diff -r 05fe5239fca2 -r a03bb02dfaba tests/test-tutorial.t --- a/tests/test-tutorial.t Fri Feb 02 13:45:47 2018 +0530 +++ b/tests/test-tutorial.t Fri Feb 02 13:59:33 2018 +0530 @@ -810,7 +810,6 @@ grabbing 8:10b8aeaa8cc8 "bathroom stuff" merging shopping $ hg phase --draft . - no phases changed $ hg log -G @ 4710c0968793 (draft): bathroom stuff |