[PATCH 1 of 2 V5] update: fix bare --clean to work on new branch (issue5003) (BC)

Pierre-Yves David pierre-yves.david at ens-lyon.org
Mon Mar 14 10:21:09 EDT 2016



On 03/13/2016 01:58 PM, liscju wrote:
> # HG changeset patch
> # User liscju <piotr.listkiewicz at gmail.com>
> # Date 1456249877 -3600
> #      Tue Feb 23 18:51:17 2016 +0100
> # Node ID 5ebf0a38f789a35d9bd1dcfd39008b365ec75477
> # Parent  70c2f8a982766b512e9d7f41f2d93fdb92f5481f
> update: fix bare --clean to work on new branch (issue5003) (BC)
>
> So far 'hg update --clean' on newly created branch results in abort
> with branch not found error. After applying this commit bare --clean
> update results in updating to the max head of the parents branch.
>
> This seems reasonable as clean should discard uncommited changes,
> branch is one of changes, and it would be unreasonable to stay on
> the head of the branch we want to discard.

We should stick to a consistent behavior. This current patch does not

1) if the uncommited branch exists it will update to the head of wc.branch()
2) if the uncommited branch does not exists it will update to the head 
of p1.branch(),

We should also pick either p1.branch() (discard before update) or 
wc.branch(discard after update)

 From our last discussion, it seems like we had a consensus on "picking 
p1.branch()" as your did in V1 on this series.

Cheers,

-- 
Pierre-Yves David

PS: I would also fix the general case first (patch 2 before patch 1)


More information about the Mercurial-devel mailing list