diff tests/test-commit-amend.t @ 20700:b0153cb8b64e stable

commit: create new amend changeset as secret correctly for "--secret" option Before this patch, "hg commit --amend --secret" doesn't create new amend changeset as secret, even though the internal function "commitfunc()" passed to "cmdutil.amend()" make "phases.new-commit" configuration as "secret" temporarily. "cmdutil.amend()" uses specified "commitfunc" only for temporary amend commit, and creates the final amend commit changeset by "localrepository.commitctx()" directly with memctx. This patch creates new amend changeset as secret correctly for "--secret" option, by changing "phases.new-commit" configuration temporarily before "localrepository.commitctx()".
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Thu, 13 Mar 2014 19:48:41 +0900
parents 0151b61fed97
children 434619dae569
line wrap: on
line diff
--- a/tests/test-commit-amend.t	Wed Mar 12 10:26:48 2014 +0200
+++ b/tests/test-commit-amend.t	Thu Mar 13 19:48:41 2014 +0900
@@ -765,3 +765,14 @@
   $ hg ci --close-branch -m'open and close'
   abort: can only close branch heads
   [255]
+
+Test that amend with --secret creates new secret changeset forcibly
+---------------------------------------------------------------------
+
+  $ hg phase '.^::.'
+  35: draft
+  36: draft
+  $ hg commit --amend --secret -m 'amend as secret' -q
+  $ hg phase '.^::.'
+  35: draft
+  38: secret