Question

We have some restrictions on what we are allowed to put in our central Mercurial repository.

Is there some way I can keep stuff in my local Hg repository, without having it pushed to the central one?

Note:

  1. The files might be connected to files in the central repository (branches for example).
  2. Local stuff might later be incorporated in the central repository.
Was it helpful?

Solution

If you're using branches, you can set their visibility to secret. This will prevent them to be pushed.

hg phase --secret --force my-branch

When you want to share, you change their phase to draft and then they will be automatically collected during a push operation.

See hg help phases for more information.

OTHER TIPS

You could also use Mercurial Queues. With MQ, you can work with patches (which are changesets) and update or re-order them based on changes in the official repository. This will also make it easier to incorporate some or all of your changes into the main repository or just discard them later.

Commit to your local repo, then push to the remote repo when you are finished.

You can push to your local repo as well, but from my understanding that is where your current development is?

I think you want Shelve Extension or Attic Extension.

The other option is if your using a newer Hg with better branching you can just fork the central repo somewhere like bitbucket and use that as your repository for your temporary stuff and potentially branch that.

Finally you could also just use .hgignore but that could be problematic later when someone does check in the file with the same name.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top