R Risack
R Risack

Reputation: 69

Keeping local changes local in Mercurial while pushing and pulling

Quite often in Mercurial, I happen to need local changes to a local repository, which should never ever enter the main repository. This could be (not complete list)

Using TortoiseHG, my work scheme looks like this at the moment:

This works until I forget to exclude the changes to kept local, which will happen sooner or later... Then I have to waste time to restore the state before.

Is there any way to do this, e.g. by certain extensions?

Thanks for you help

Upvotes: 2

Views: 60

Answers (1)

Craig
Craig

Reputation: 776

You can use the secret hg phase for this.

  • commit your local changes
  • run hg phase -sf .

This will mark the current change secret. Secret changesets will not push.

A caveat with secret phases:

All secret changesets must always be on top of the stack. When you pull changes, you will need to rebase secret changes back to the top. This is typically as easy as hg rebase.

Upvotes: 1

Related Questions