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

Pierre-Yves David pierre-yves.david at ens-lyon.org
Fri Mar 11 10:03:03 EST 2016



On 03/11/2016 07:35 AM, Piotr Listkiewicz wrote:
>     1) bare `hg update` abort on new uncommited branch (with or without
>     --clean)
>     To me, the path for (1) is pretty clear, the "head" of the new
>     branch is "wc" so we don't need to go anywhere. Your V4 apply this
>     "update to parent" behavior only in the --clean case. We should
>     apply it in all case (except maybe in the --clean case)..
>
>
> I don't understand it. If we don't need to go anywhere, isn't going to
> parent contradictive? Or if its treated like we don't need to go
> anywhere because we stay on the same parent?


We don't go anywhere → we keep the same parent. Currently the message is 
an "abort:" is does not seems too right.

>     2) bare `hg update --clean` use working copy branch.
>     The path for (2) is a bit fuzzier. --clean do "discard uncommitted
>     changes (no backup)", including the branch change. So it seems a bit
>     bizarre to stay on the head of a branch we are requesting to discard
>     (and effectively discard in the new branch case). So in the --clean
>     case we should probably use branch of p1() instead of branch of wc().
>
>     This is actually exactly what your V1 was doing, but we got confused
>     between fixing (1) (that requires something like you V4) and (2)
>     were you were right.
>
>
> For me its what V4 is doing. I'd be greatful for further explanations

No V4, stay on the parent in this case. We want to apply the update 
logic from p1() branch. like you did in V1.

-- 
Pierre-Yves David


More information about the Mercurial-devel mailing list