How to keep changesets in phase “draft” on hg push?

女生的网名这么多〃 提交于 2019-12-03 15:49:56

What the documentation does not clearly reveal is:

The phase-change on push is not a purely local decision. – After “uploading” the changesets, the client asks the server for updates regarding the phases of the commits, and the server is usually telling that they are now “public”.

Thus, the .hgrc-snippet

[phases]
publish = False

has to be put on the server, which inhibits the usual phase-change there. The server will then report the phases back the same way they were pushed.

Bitbucket has an option for this under Settings → Repository details → Phases.

The most direct way to keep the phase at draft is to configure the remote server as "non-publishing", as you have already discovered.

But there is a second way, which may be useful to some if the destination server cannot be set to "non-publishing" for any reason: Use pull instead of push. Pulling is read-only, so if you can set up your workflow (e.g. through a local alias) so that the remote pulls changes from your local repo, they'll remain in phase draft.

https://www.mercurial-scm.org/wiki/Phases

A repository is "publishing" by default. To make a repository non-publishing, add these lines to its hgrc configuration:


[phases]
publish = False

Short answer: nohow

If you want rewrite history both locally and on push-target, you have to

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!