[PATCH V11] update: fix bare --clean to work on new branch (issue5003) (BC)

Piotr Listkiewicz piotr.listkiewicz at gmail.com
Thu Jun 2 14:33:54 UTC 2016


>
> (This isn't that important, but...) what should we do for the following
> scenario?
>   $ cd repo-with-no-default-branch
>   $ hg update null
>   $ hg branch new-branch
>   $ hg update -C
> I expect it will discard "new-branch" and move to "default" or tip-most
> branch head.


Good point, i will fix this in V12

>
>  We have many "update -C" in our tests, and they are broken. And I don't
> think
> we would want this warning in ordinary cases.
> What's the purpose of this warning?


I thought this could be helpful to user, but You are probably right. I will
remove it in V12

2016-05-25 15:32 GMT+02:00 Yuya Nishihara <yuya at tcha.org>:

> On Mon, 23 May 2016 07:39:55 +0200, liscju wrote:
> > # HG changeset patch
> > # User liscju <piotr.listkiewicz at gmail.com>
> > # Date 1459834201 -7200
> > #      Tue Apr 05 07:30:01 2016 +0200
> > # Node ID 880899828fc8bc6b30876425e87924e4fd8476ee
> > # Parent  bdba6a2015d0bc57c6e2beab25d138610dcbf360
> > update: fix bare --clean to work on new branch (issue5003) (BC)
>
> Looks mostly good, but many tests failed.
>
> > diff --git a/mercurial/destutil.py b/mercurial/destutil.py
> > --- a/mercurial/destutil.py
> > +++ b/mercurial/destutil.py
> > @@ -95,9 +95,16 @@ def _destupdatebranch(repo, clean, check
> >      wc = repo[None]
> >      movemark = node = None
> >      currentbranch = wc.branch()
> > +
> > +    if clean and wc.p1():
> > +        currentbranch = repo['.'].branch()
>
> (This isn't that important, but...) what should we do for the following
> scenario?
>
>   $ cd repo-with-no-default-branch
>   $ hg update null
>   $ hg branch new-branch
>   $ hg update -C
>
> I expect it will discard "new-branch" and move to "default" or tip-most
> branch head.
>
> >      if currentbranch in repo.branchmap():
> >          heads = repo.branchheads(currentbranch)
> >          if heads:
> > +            if clean:
> > +                repo.ui.warn(_('updating to the head of parent branch
> %s\n')
> > +                             % currentbranch)
>
> We have many "update -C" in our tests, and they are broken. And I don't
> think
> we would want this warning in ordinary cases.
>
> What's the purpose of this warning?
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mercurial-scm.org/pipermail/mercurial-devel/attachments/20160602/61ed6e31/attachment.html>


More information about the Mercurial-devel mailing list