I support propagating the --clean flag to subrepos (and therefore handing off dirty subrepos in the default case).<div><br></div><div>-Eric<br><br><div class="gmail_quote">On Tue, Dec 14, 2010 at 09:14, Martin Geisler <span dir="ltr">&lt;<a href="mailto:mg@aragost.com">mg@aragost.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hello,<br>
<br>
My client has asked me to fix an issue with updates to dirty subrepos.<br>
Imagine a main repo and a subrepo where three changesets are paired like<br>
this:<br>
<br>
  m0 --&gt; s0<br>
  m1 --&gt; s1<br>
  m2 --&gt; s2<br>
<br>
So the main and subrepo went in lock step.<br>
<br>
Mercurial currently behaves like this when you do &#39;hg update m2&#39;:<br>
<br>
  (m1, s1) --&gt; (m2, s2)<br>
<br>
This is all fine. However, if the subrepo is updated to a differnet<br>
version, then we get the same result:<br>
<br>
  (m1, s0) --&gt; (m2&#39;, s2)<br>
<br>
Actually, the m2&#39; state has a dirty .hgsubstate file, namely the one<br>
containing s1 from m1. This is the cause of<br>
<br>
  <a href="http://mercurial.selenic.com/bts/issue2403" target="_blank">http://mercurial.selenic.com/bts/issue2403</a><br>
<br>
Where a subsequent commit will make an empty commit in the main repo<br>
because it is tricked by the &quot;dirty&quot; .hgsubstate file.<br>
<br>
However, my client doesn&#39;t care about that -- they are more interested<br>
in keeping the subrepo as-is. In particular, if the history was<br>
<br>
  m0 --&gt; s0<br>
  m1 --&gt; s0<br>
  m2 --&gt; s1<br>
  m3 --&gt; s1<br>
  m4 --&gt; s1<br>
  m5 --&gt; s1<br>
<br>
then they expect &#39;hg update m5&#39; to do<br>
<br>
  (m3, s0) --&gt; (m5, s0)<br>
<br>
where the subrepo is kept in its dirty state. This is consistent with<br>
how we merge other dirty files into the target revision when updating.<br>
One would need a &#39;hg update -C m5&#39; to make the transition<br>
<br>
  (m3, s0) --&gt; (m5, s1)<br>
<br>
I think this would be a sensible change -- what you think?<br>
<br>
<br>
The first case with where we start at (m1, s0) and do &#39;hg update m2&#39; is<br>
more tricky. I think it ought to generate a conflict since updating the<br>
subrepo corresponds to updating the .hgsubstate file, and thus there is<br>
a conflict in the .hgsubstate file. However, we normally keep that file<br>
sort of hidden.<br>
<br>
I cannot begin fixing/changing this until I know if I can put the change<br>
into Mercurial, so I would appreciate your input.<br>
<br>
--<br>
Martin Geisler<br>
<br>
aragost Trifork<br>
Professional Mercurial support<br>
<a href="http://mercurial.aragost.com/kick-start/" target="_blank">http://mercurial.aragost.com/kick-start/</a><br>
_______________________________________________<br>
Mercurial-devel mailing list<br>
<a href="mailto:Mercurial-devel@selenic.com">Mercurial-devel@selenic.com</a><br>
<a href="http://selenic.com/mailman/listinfo/mercurial-devel" target="_blank">http://selenic.com/mailman/listinfo/mercurial-devel</a><br>
</blockquote></div><br></div>