D3819: split: preserve phase of commit that is being split

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Thu Jun 21 08:44:57 EDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rHG4f885770c4a2: split: preserve phase of commit that is being split (authored by martinvonz, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3819?vs=9235&id=9248

REVISION DETAIL
  https://phab.mercurial-scm.org/D3819

AFFECTED FILES
  hgext/split.py
  tests/test-split.t

CHANGE DETAILS

diff --git a/tests/test-split.t b/tests/test-split.t
--- a/tests/test-split.t
+++ b/tests/test-split.t
@@ -532,3 +532,36 @@
   o  0:426bada5c675 A
   
 #endif
+
+Preserve secret phase in split
+
+  $ cp -R $TESTTMP/clean $TESTTMP/phases1
+  $ cd $TESTTMP/phases1
+  $ hg phase --secret -fr tip
+  $ hg log -T '{short(node)} {phase}\n'
+  1df0d5c5a3ab secret
+  a61bcde8c529 draft
+  $ runsplit tip >/dev/null
+  $ hg log -T '{short(node)} {phase}\n'
+  00eebaf8d2e2 secret
+  a09ad58faae3 secret
+  e704349bd21b secret
+  a61bcde8c529 draft
+
+Do not move things to secret even if phases.new-commit=secret
+
+  $ cp -R $TESTTMP/clean $TESTTMP/phases2
+  $ cd $TESTTMP/phases2
+  $ cat >> .hg/hgrc <<EOF
+  > [phases]
+  > new-commit=secret
+  > EOF
+  $ hg log -T '{short(node)} {phase}\n'
+  1df0d5c5a3ab draft
+  a61bcde8c529 draft
+  $ runsplit tip >/dev/null
+  $ hg log -T '{short(node)} {phase}\n'
+  00eebaf8d2e2 draft
+  a09ad58faae3 draft
+  e704349bd21b draft
+  a61bcde8c529 draft
diff --git a/hgext/split.py b/hgext/split.py
--- a/hgext/split.py
+++ b/hgext/split.py
@@ -170,7 +170,7 @@
         raise error.Abort(_('cannot split an empty revision'))
 
     scmutil.cleanupnodes(repo, {ctx.node(): [c.node() for c in committed]},
-                         operation='split')
+                         operation='split', fixphase=True)
 
     return committed[-1]
 



To: martinvonz, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list