Robert Siemer
Robert Siemer

Reputation: 34737

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.

Upvotes: 4

Views: 2103

Answers (4)

Robert Siemer
Robert Siemer

Reputation: 34737

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.

Upvotes: 11

alexis
alexis

Reputation: 50220

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.

Upvotes: 4

Lazy Badger
Lazy Badger

Reputation: 97295

Short answer: nohow

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

Upvotes: -1

storm
storm

Reputation: 151

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

Upvotes: 2

Related Questions