Idea: hg merge --close

Augie Fackler raf at durin42.com
Mon Apr 8 14:25:57 EDT 2019


On Sun, Apr 07, 2019 at 02:02:07PM +0200, Pierre-Yves David wrote:
>
>
> On 4/7/19 12:52 PM, Joerg Sonnenberger wrote:
> > Hello all,
> > one thing we discussed during the mini sprint is the issue of dealing
> > with merged vs active vs inactive branches. At the moment, closing a
> > branch to get it off the branch list is a separate operation, which can
> > be annoying. One idea for this is to add a --close flag to merge, which
> > effectively results in the following topology:
> >
> >       b1a  b2a
> >       |    |
> >       |    b2b (close=1)
> >       |   /
> >       b1b (merge)
> >
> > as opposed to the current:
> >       b1a  b2a
> >       |   /
> >       |  /
> >       b1b
> >
> > The advantage to having a separate closing commit is that it doesn't
> > keep a topological head open. The commit message to be used could be
> > specified as templated option in hgrc, defaulting to something like
> > 'Closing branch %s after merge' to so. The one downside is that the
> > parent of b1b now points to an artifical commit, which makes the history
> > a bit more messy.
>
> I like the idea[1], people having been asking for a simple UI for `hg merge
> --close` for a long time. The approach of creating an extra changeset lift
> the "clarity" concerns raised in previous discussions around `hg merge
> --close`.

I was about to ask what the concerns were around this in the past,
because I know it's come up. I think this solves the problem nicely,
and I'd be happy to see it as an experimental-flagged feature in 5.0,
or a regular feature in 5.1 (I'm just a little nervous about slipping
it in 5.0 this late, and we probably should pester the pypy and/or
unity folks since I think they might also be interested. Maybe also bitbucket?)

>
> As a small optional optimization, if the merged changeset is "draft", we
> could "amend" it into a branch closing one.
>
> --
> Pierre-Yves David
>
> [1] unsurprisingly, being part of the discussion that produced this email
> o:-)
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


More information about the Mercurial-devel mailing list