<div dir="ltr"><div class="gmail_quote">On Sat, May 7, 2011 at 3:34 PM, Patrick Mézard <span dir="ltr">&lt;<a href="mailto:pmezard@gmail.com" target="_blank">pmezard@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Le 06/05/11 20:09, Matt Mackall a écrit :<br>
<div>&gt; On Fri, 2011-05-06 at 19:58 +0300, Idan Kamara wrote:<br>
&gt;&gt; # HG changeset patch<br>
&gt;&gt; # User Idan Kamara &lt;<a href="mailto:idankk86@gmail.com" target="_blank">idankk86@gmail.com</a>&gt;<br>
&gt;&gt; # Date 1304697821 -10800<br>
&gt;&gt; # Node ID 1365953fe513ea8b9a68d238df5c65565475480c<br>
&gt;&gt; # Parent  7766361172826971d52df6c19a300d72e7f2abfc<br>
&gt;&gt; patch: introduce changedfiles<br>
&gt;&gt;<br>
&gt;&gt; returns the set of all changed files in a given patch<br>
&gt;<br>
&gt; I&#39;ve queued 1, 2, and 4 from your series, I&#39;d like an opinion from<br>
&gt; Patrick on this one though.<br>
<br>
</div>I told Idan on IRC this solution was correct but suboptimal. The alternative is to write yet another parser, faster but less reliable. The reliability is not a problem with qpush because it would only generate false positives, not false negatives. But it will reduce its usefulness for sure. And to make it correct we need to copy most of iterhunks() and hunk parsers without decoding/storing the data.<br>

</blockquote><div><br></div><div>I also think extending the existing mq patchheader parser will eventually result in copying most of the logic from iterhunks. Looking at the results below, not sure it&#39;s worth the trouble.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The question is: is it slow enough to be problem?<br>
<br>
Idan, could you measure how slower is qpush with a large diff (for instance, diff two hg tags or something like that) with this call?<br></blockquote><div><br></div><div>$ hg diff -r 1.8 -r 1.8.3 &gt; /tmp/diff</div><div>
<br></div><div>after qimporting it on top of 1.8:</div><div><br></div><div>$ touch z</div><div>$ hg add z</div><div><br></div><div>old:</div><div><br></div><div><div>$ time hg qpush -f</div><div>(working directory not at a head)</div>
<div>applying diff</div><div>now at: diff</div><div><br></div><div>real<span class="Apple-tab-span" style="white-space:pre">        </span>0m0.646s</div><div>user<span class="Apple-tab-span" style="white-space:pre">        </span>0m0.576s</div>
<div>sys<span class="Apple-tab-span" style="white-space:pre">        </span>0m0.068s</div></div><div><br></div><div>new:</div><div><br></div>
<div>$ time hg qpush</div><div>(working directory not at a head)</div><div>applying diff</div><div>now at: diff</div><div><br></div><div>real<span class="Apple-tab-span" style="white-space:pre">        </span>0m0.826s</div><div>
user<span class="Apple-tab-span" style="white-space:pre">        </span>0m0.736s</div><div>sys<span class="Apple-tab-span" style="white-space:pre">        </span>0m0.088s </div></div></div>