Closed branch push behavior?

Chuck.Kirschman at bentley.com Chuck.Kirschman at bentley.com
Mon Dec 5 15:52:29 CST 2011


Unfortunately for me, the user read the helpful message, pushed the branch to the server, which as you state makes it permanent.  It's been pulled by many, and trying to get the genie back into the bottle is nigh on impossible.  Is there any way to prevent it in the future?  A server configuration?  Or do I need to cook up a commit extension?

Thanks
chuck

-----Original Message-----
From: Matt Mackall [mailto:mpm at selenic.com] 
Sent: Monday, December 05, 2011 4:49 PM
To: Chuck Kirschman
Cc: mercurial at selenic.com
Subject: Re: Closed branch push behavior?

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