# HG changeset patch # User Sushil khanchi # Date 1551471194 -19800 # Node ID 8087e9a0f902b236d8caa65da122b5d80e20564f # Parent 2a593d8f07e7aa94c3d28ee66e2360101536226a split: make sure hg split preserve the phase of splitting cset (issue6048) Before this patch, while splitting we were not taking the phase of splitting cset into account. By default new commits would have draft changes. As we know there can two possible phases i.e draft and secret in rewriting csets thing, so this adds the handling of secret phase (as default is draft) Changes in test file reflect the added behaviour. diff -r 2a593d8f07e7 -r 8087e9a0f902 hgext3rd/evolve/cmdrewrite.py --- a/hgext3rd/evolve/cmdrewrite.py Sat Mar 02 01:37:04 2019 +0530 +++ b/hgext3rd/evolve/cmdrewrite.py Sat Mar 02 01:43:14 2019 +0530 @@ -1182,6 +1182,10 @@ rewriteutil.precheck(repo, [rev], action='split') tr = repo.transaction('split') + # make sure we respect the revision current phase while splitting + phasestr = ctx.phasestr() + if phasestr == 'secret': + opts['secret'] = True if len(ctx.parents()) > 1: raise error.Abort(_("cannot split merge commits")) prev = ctx.p1() diff -r 2a593d8f07e7 -r 8087e9a0f902 tests/test-split.t --- a/tests/test-split.t Sat Mar 02 01:37:04 2019 +0530 +++ b/tests/test-split.t Sat Mar 02 01:43:14 2019 +0530 @@ -1185,7 +1185,7 @@ continue splitting? [Ycdq?] c $ hg glog --git -p - @ 3:1f8c09b13fa2 split2 (draft) + @ 3:1f8c09b13fa2 split2 (secret) | diff --git a/c b/c | new file mode 100644 | --- /dev/null @@ -1193,7 +1193,7 @@ | @@ -0,0 +1,1 @@ | +c | - o 2:bcba06966846 split1 (draft) + o 2:bcba06966846 split1 (secret) | diff --git a/b b/b | new file mode 100644 | --- /dev/null