[PATCH V2] mercurial: fixes update --clean to work on new branch (issue5003)

Yuya Nishihara yuya at tcha.org
Mon Feb 29 09:18:21 EST 2016


On Mon, 29 Feb 2016 09:10:51 +0100, Piotr Listkiewicz wrote:
> > Not super enthousiastic about this behavior. Could we just not update
> > anywhere in that situation? Without the abort, possibly with a message
> > mentionning thate uncommited branch foo does not exist yet, so we are not
> > updating anywhere.

[snip]

>  Yes, the message should be issued, but revision must be set (because
> destutil._destupdatebranch must return not None revision due to the reason
> i mentioned previously) so the question is if revision number for non
> existing branch should be calculated by:
> 
> repo.revs('max(.::(head() and branch(%s)))'
>                         , wc.p1().branch()).first()

I don't follow the discussion, but if you don't want to update anywhere,
the check-out revision should be wc.p1().rev().


More information about the Mercurial-devel mailing list