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

Yuya Nishihara yuya at tcha.org
Sat Feb 13 01:39:49 EST 2016


On Fri, 12 Feb 2016 17:07:35 +0100, Piotr Listkiewicz wrote:
> >
> > > >> To rephrase, with --clean, the branch used for the update logic should
> > > >> -always- be the on of the first working copy parents. Uncommited
> > branch
> > > >> data, (new or not), should be disregarded.
> 
> > According to this definition, --clean should use the p1 branch no matter if
> > wc.branch() exists or not.
> 
> So the result of
> 
> (suppose current p1 of wc revision is 4 and branch is dev)
> $ hg branch new-branch
> # proceed to edit and add some file
> $ hg update --clean # lets nuke edits, i'll run hg add after
> 
> Should be updating to the revision 4 on branch dev?

More precisely, IMO, to 'max(4::(head() and branch(4)))', the tipmost
topological (but named) branch head of the revision 4.

I agree with Pierre-Yves in that --clean is the option to discard uncommitted
changes, which includes uncommitted named branch. It's different from bookmarks
because bookmarks are attached to existing revisions.


More information about the Mercurial-devel mailing list