Enable "hg push --new-branch" by default in hgrc

Dominik Psenner dpsenner at gmail.com
Thu Mar 24 10:19:35 CDT 2011

We're following mostly the best-practice described here:


The main development is within "default" and bugfixes/tasks are done in
named branches identified by a unique bug id (i.e. something like
PRJID-BUGNUMBER). As stated in the email before, we're currently in the
phase of heavy testing and bugfixing and thus we more or less work only in
named branches. Of course, we could merge/rebase every change to make up a
linear history but that would:

1] introduce a lot more steps on everydays synchronization party
2] make it hard to track the changes done to fix a specific bug
3] let someone else my work on a named branch involves even more steps
4] make us unable to group and assign several changesets to one specific bug

> -----Original Message-----
> From: Martin Geisler [mailto:mg at aragost.com]
> Sent: Thursday, March 24, 2011 3:35 PM
> To: Mads Kiilerich
> Cc: Dominik Psenner; 'Mercurial Developers'
> Subject: Re: Enable "hg push --new-branch" by default in hgrc
> Mads Kiilerich <mads at kiilerich.com> writes:
> > On 03/24/2011 03:02 PM, Dominik Psenner wrote:
> >> We're working a lot with named branches to keep track of bug-related
> >> fixes. We push those changes also to our master repository as we want
> >> that information to become historical.
> >>
> >> The odd thing about this is that we have to type --new-branch almost
> >> for every push we do, so it would be natural to enable it by default.
> >> Unfortunately this is the only thing I was able to come up with and
> >> I'm worried having this in my hgrc could be dangerous:
> >>
> >> -- quote
> >> [alias]
> >> push = push --new-branch
> >> -- quote
> >>
> >> What do you guys think about making --new-branch configurable in hgrc
> >> without the need of an alias definition?
> >
> > The reasons why an alias could be dangerous and a bad idea also
> > applies to making it configurable in other ways. You can use defaults,
> > even though it has been deprecated for exactly the same reasons.
> >
> > Is it really a problem that you have to specify --new-branch? It could
> > be argued that it is especially good for you because you make so many
> > branches and so easily can push a branch that shouldn't have been
> > pushed anyway.
> I would counter that you don't have that many options: if you've created
> the branch, then you'll want to push it sooner or later since we don't
> really have a good way of abandoning a branch (except dead heads..).
> --
> Martin Geisler
> aragost Trifork
> Professional Mercurial support
> http://aragost.com/en/services/mercurial/blog/

More information about the Mercurial-devel mailing list