Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

How can I hinder mercurial from putting changesets to phase “public” on push operations? I want them to stay “draft”.

I rebase and histedit a lot, and the repository I push to is for me only. And having to change the phase all the time is a nuisance.

like image 832
Robert Siemer Avatar asked May 29 '16 18:05

Robert Siemer


3 Answers

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.

like image 182
Robert Siemer Avatar answered Oct 06 '22 00:10

Robert Siemer


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.

like image 41
alexis Avatar answered Oct 06 '22 01:10

alexis


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
like image 26
storm Avatar answered Oct 06 '22 00:10

storm