[PATCH STABLE V2] update: allow update to existing branches with invalid names (issue3710)

Idan Kamara idankk86 at gmail.com
Wed Nov 28 12:36:16 CST 2012


On Wed, Nov 28, 2012 at 8:31 PM, Pierre-Yves David
<pierre-yves.david at logilab.fr> wrote:
>
> On Wed, Nov 28, 2012 at 08:22:26PM +0200, Idan Kamara wrote:
> > On Wed, Nov 28, 2012 at 3:21 PM, Tim Henigan <tim.henigan at gmail.com>
> > wrote:
> > >
> > > # HG changeset patch
> > > # User Tim Henigan <tim.henigan at gmail.com>
> > > # Date 1354024055 18000
> > > # Branch stable
> > > # Node ID 15c51486a402299c61ef009b7587afbb152d2c54
> > > # Parent  54cedee86e5126188b0dcfbd7015bcdca7f6c2e2
> > > update: allow update to existing branches with invalid names
> > > (issue3710)
> > >
> > > Starting with 361ab1e2086f, users are no longer able to update a
> > > working copy to a branch named with a "bad" character (such as ':').
> > >
> > > Prior to v2.4, it was possible to create branch names using "bad"
> > > characters, so this breaks backwards compatibility.
> > >
> > > Mercurial must allow users to update to existing branches with bad
> > > names.  However, it should continue to prevent the creation of new
> > > branches with bad names.
> > >
> > > A test was added to confirm that 'hg update' works as expected. The
> > > test uses a bundled repo that was created with an earlier version of
> > > Mercurial.
> >
> > You could perhaps use inilne Python to do this test more easily:
> >
> >   >>> from mercurial import hg, ui
> >   >>> r = hg.repository(ui.ui())
> >   >>> r.dirstate.setbranch('a:b')
>
> I'm not sure we care about the internal here. What matter is to not
> regresse on hg update. Isn't it?

Yeah, just pointed out that the bundle repo + initializing
a brand new repo could be spared with these 3 lines.

The call to hg update should stay.


More information about the Mercurial-devel mailing list