<div dir="ltr"><div><div>Yikes. Good catch.<br><br></div>Series LGTM.<br><br></div>I dare say this one is severe enough to warrant an out-of-cycle release because it can result in serving corrupt clones. I'm actually somewhat surprised I haven't heard reports of this biting us at Mozilla.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Mar 12, 2016 at 5:29 PM, Mads Kiilerich <span dir="ltr"><<a href="mailto:mads@kiilerich.com" target="_blank">mads@kiilerich.com</a>></span> 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 Mads Kiilerich <<a href="mailto:madski@unity3d.com">madski@unity3d.com</a>><br>
# Date 1457832551 -3600<br>
#      Sun Mar 13 02:29:11 2016 +0100<br>
# Branch stable<br>
# Node ID aa440c3d7c5d2baafeb632ee35db4d917ed9cf83<br>
# Parent  95163ababeb86d6ca889e5e57a0c4eadb77b53d8<br>
streamclone: fix error when store files grow while stream cloning<br>
<br>
Effectively a backout of 9fea6b38a8da, but updated to using 'with'.<br>
<br>
diff --git a/mercurial/streamclone.py b/mercurial/streamclone.py<br>
--- a/mercurial/streamclone.py<br>
+++ b/mercurial/streamclone.py<br>
@@ -206,7 +206,8 @@ def generatev1(repo):<br>
                 # partially encode name over the wire for backwards compat<br>
                 yield '%s\0%d\n' % (store.encodedir(name), size)<br>
                 if size <= 65536:<br>
-                    yield svfs.read(name)<br>
+                    with svfs(name, 'rb') as fp:<br>
+                        yield fp.read(size)<br>
                 else:<br>
                     for chunk in util.filechunkiter(svfs(name), limit=size):<br>
                         yield chunk<br>
diff --git a/tests/test-clone-uncompressed.t b/tests/test-clone-uncompressed.t<br>
--- a/tests/test-clone-uncompressed.t<br>
+++ b/tests/test-clone-uncompressed.t<br>
@@ -88,10 +88,5 @@ actually serving file content<br>
   $ echo >> repo/f2<br>
   $ hg -R repo ci -m "1"<br>
   $ wait<br>
-  abort: unexpected response from remote server:<br>
-  '*\n' (glob)<br>
   $ hg -R clone id<br>
-  abort: repository clone not found!<br>
-  [255]<br>
-<br>
-the current clone error is a regression from 9fea6b38a8da.<br>
+  000000000000<br>
_______________________________________________<br>
Mercurial-devel mailing list<br>
<a href="mailto:Mercurial-devel@mercurial-scm.org">Mercurial-devel@mercurial-scm.org</a><br>
<a href="https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel" rel="noreferrer" target="_blank">https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel</a><br>
</blockquote></div><br></div>