Closed branch push behavior?

Matt Mackall mpm at selenic.com
Mon Dec 5 15:48:41 CST 2011


On Mon, 2011-12-05 at 16:09 -0500, Chuck.Kirschman at bentley.com wrote:
> I tried to push some changes from one repo to another and it
> complained that it would create new branches, even though the branch
> in question is closed.  Is that the expected behavior?  "Hg branches"
> doesn't show it, so it is pretty confusing to figure it out, and it
> isn't creating an open branch.  I'm using 1.9.3.
> 
> [D:\foo]hg --debug push
> pushing to http://foo.bar.com/foo
> searching for changes
> abort: push creates new remote branches: wip_unicode!
> (use 'hg push --new-branch' to create new remote branches)
> 
> [D:\foo]hg branches
> default                     3187:fa2769398873
> 
> [D:\foo]hg branches -c
> default                     3187:fa2769398873
> wip_unicode                 3108:2426340ca7ae (closed)

I think this is the intended behavior. The message:

 abort: push creates new remote branches: wip_unicode!

..is correct in that a branch that only exists locally will be pushed to
the remote server. Since Mercurial's branches become permanent
components of history, this serves to make sure you don't inadvertently
publish permanent history that you don't intend to. Whether or not it's
"closed", it's still published by push. So you should either simply use
--new-branch as hinted, or destroy the unwanted branch locally and not
do that again.

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial mailing list