Closed branch push behavior?

Angel Ezquerra angel.ezquerra at gmail.com
Tue Dec 6 14:36:10 CST 2011


El 06/12/2011 18:41, "Matt Mackall" <mpm at selenic.com> escribió:
> >
> > Matt,
> >
> > I have a related question that hopefully you can also address.
> >
> > I wonder whether it makes sense for mercurial to complain that you'll
> > create a new head when you close a branch and push the resulting new
head.
> >
> > Technically mercurial is right in that you are indeed pushing a new
head,
> > but isn't it obvious that this new head is not meant to be developed
> > further?
>
> Sure, but that's not what push cares about here. Push cares about
> whether or not the history should be transmitted. If, for instance,
> you're Chuck's coworker, the answer here is a big fat "no": you
> shouldn't have created the branch in the first place and now this
> warning is your last chance to avoid publishing it.

I don't get this. If I were Chuck's coworker and I tried to push a new
branch I should get the usual "Push creates new branch, use --new-branch
flag" message, regardless of whether I had closed the branch or not. If on
the other hand the branch were on the server already, mercurial making it
hard for me to close the branch would not change the fact that the branch
would be on the server already :-)

That being said closing branches would be much more useful if closed
branches were not pushed or pulled buy default. For instance it would let
you stop mistakes from being propagated as in Chuck's scenario.

> > Actually, I believe that mercurial will happily let you commit on top
of a
> > "close branch commit", which would be weird (I can't test this from my
> > phone). You should have to use the --force option for that...
>
> You've already got to jump through a hoop to check out a closed head:
> you have to find it.

That is true for CLI users but is certainly not the case for GUI users (or
at least for TortoiseHg users). GUI tools usually show the graph log at all
times and said graph log usually shows all branches by default.

Angel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial/attachments/20111206/2b1caa93/attachment.html>


More information about the Mercurial mailing list