How to click on one branch in Hg?

I have an Hg repository with three branches in it, but two of them are inactive (since I already merged them into my default branch). hg head shows 3 heads, one for each branch, although hg branches show 2 of these branches as "inactive".

When I try to push my default branch (using hg push --branch default http: // ...) to another repo, the merge is canceled with the message "abort: push creates new remote branches :!"

On the Hg push man pages: “By default, push will not allow new chapters to be created at the destination, since several heads will not be clear which head to use. In this situation, it is recommended to pull and drain the push.”

I have already done this, but I still cannot press "default" without interrupting it.

Any help is appreciated. Thank!

+47
branch merge push mercurial
02 Feb 2018-11-21T00:
source share
3 answers

If the change sets on default have ancestral changes in other branches, you also need to push these changes. It is not possible for a change set to exist in a repo without all of its change sets also existing.

So try:

 hg push --branch default --new-branch 

which says: "Yes, I know that this push sends by the name of a branch that had not previously been repo deleted" (this also requires Mercurial 1.6 or later IIRC)>

In addition, you can take these inactive heads and make them closed heads:

 hg update thebranch hg commit --close-branch -m 'closing' 

Since “named branches are forever”, many people prefer to reserve them for long-lived concepts such as “stable” and “experimental”, and use bookmarks, anonymous branches or clones for functions, releases, and other transient things. See This for a guide for these other options.

+51
Feb 02 2018-11-22T00:
source share

To push one branch you just use -b

 hg push -b myBranch 

As for a specific problem, you can look in the closing branches. I know that SourceTree offers it, but I'm not sure about the specifics

+23
Feb 04 '14 at 20:46
source share

You can make him!

Here's how:

 1. Pull from your repository 2. hg push --rev nnn -f (replace nnn with your Rev # of your working branch) 3. do NOT force before PULLing. if you do things will get out sync and you are screwed 

If you use something like RhodeCode, then check it after forcing it to use, and you will see that you have the last branch.

However, I think that later Mercurial will ask you to push another branch again, even if you close it, Mercurial will try to create this branch on the server.

I am also a Git user and faced the same situation because the client uses Mercurial, but I would like to use the Git workflow style.

I think this is doable, but I have not understood 100% yet.

0
Sep 24 '13 at 17:38
source share



All Articles