<div dir="ltr"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span style="font-size:12.8px">1) bare `hg update` abort on new uncommited branch (with or without --clean)</span><span style="font-size:12.8px"><br></span><span style="font-size:12.8px">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).</span><span style="font-size:12.8px">.</span></blockquote><div><br></div><div>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?</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span style="font-size:12.8px">2) bare `hg update --clean` use working copy branch.<br></span><span style="font-size:12.8px">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().</span>  </blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span style="font-size:12.8px"></span> <span style="font-size:12.8px">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.</span></blockquote><div><br></div><div>For me its what V4 is doing. I'd be greatful for further explanations</div><div><br></div><div> </div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-03-09 15:02 GMT+01:00 Pierre-Yves David <span dir="ltr"><<a href="mailto:pierre-yves.david@ens-lyon.org" target="_blank">pierre-yves.david@ens-lyon.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
<br>
On 03/07/2016 09:34 PM, liscju wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
# HG changeset patch<br>
# User liscju <<a href="mailto:piotr.listkiewicz@gmail.com" target="_blank">piotr.listkiewicz@gmail.com</a>><br>
# Date 1456249877 -3600<br>
#      Tue Feb 23 18:51:17 2016 +0100<br>
# Node ID 81a26b0f08ed54b86937be8765bc0b6f0899a27f<br>
# Parent  c7f89ad87baef87f00c507545dfd4cc824bc3131<br>
update: fix bare --clean to work on new branch (issue5003)<br>
<br>
So far 'hg update --clean' on newly created branch results in abort<br>
with branch not found error. After applying this patch bare --clean<br>
update results in updating to the first parent of working<br>
directory without recreating the newly created branch.<br>
<br>
Another possibility of fixing this issue suggested in bug report<br>
would be to recreate branch after update, but this behaviour<br>
would be against the idea of --clean option: to discard changes<br>
in working directory which includes marking it as new branch.<br>
</blockquote>
<br></span>
ARg, I just realised we are mixing two things here :-/ Sorry for not spotting that earlier.<br>
<br>
There is two issues here:<br>
<br>
1) bare `hg update` abort on new uncommited branch (with or without --clean).<br>
2) bare `hg update --clean` use working copy branch.<br>
<br>
<br>
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).<br>
<br>
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().<br>
<br>
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.<br>
<br>
Conclusion:<br>
<br>
  If my analysis make sense and people agree with it, we probably need two patches:<br>
  * one to fix `hg update` with uncommited new branch change<br>
    (similar to the V4)<br>
  * one to fix branch used by `hg update --clean` with uncommited branch (new or not).<br>
    (similar to the V1)<br>
<br>
Deeply sorry for the confusion.<span class="HOEnZb"><font color="#888888"><br>
<br>
<br>
-- <br>
Pierre-Yves David<br>
</font></span></blockquote></div><br></div>