[PATCH v2] fileserverclient: make iterbatch() case work with new store

Martin von Zweigbergk martinvonz at google.com
Fri May 20 20:12:13 UTC 2016


# HG changeset patch
# User Martin von Zweigbergk <martinvonz at google.com>
# Date 1463636360 25200
#      Wed May 18 22:39:20 2016 -0700
# Node ID bd7f8f061431ae80d5769e51cf7f1ac055a9780b
# Parent  3df8af03df789dee35c6026fce5ec1a59b43cca0
fileserverclient: make iterbatch() case work with new store

The iterbatch() handling added in 08ca5042a8a1 (fileserverclient: use
new iterbatch() method, 2016-03-22) was broken by 06d5f64ccb7c (store:
change fileserviceclient to write via new store, 2016-04-04). Fix it
by copying the pattern introduced elsewhere in that change.

diff -r 3df8af03df78 -r bd7f8f061431 remotefilelog/fileserverclient.py
--- a/remotefilelog/fileserverclient.py	Mon Jan 04 21:32:21 2016 -0800
+++ b/remotefilelog/fileserverclient.py	Wed May 18 22:39:20 2016 -0700
@@ -146,7 +146,9 @@
             b.getfile(file_, node)
         b.submit()
         for m, r in itertools.izip(missed, b.results()):
-            receivemissing(io.BytesIO('%d\n%s' % (len(r), r)), m)
+            file_ = idmap[m]
+            node = m[-40:]
+            receivemissing(io.BytesIO('%d\n%s' % (len(r), r)), file_, node)
             progresstick()
         return
     while missed:
diff -r 3df8af03df78 -r bd7f8f061431 tests/test-http.t
--- a/tests/test-http.t	Mon Jan 04 21:32:21 2016 -0800
+++ b/tests/test-http.t	Wed May 18 22:39:20 2016 -0700
@@ -77,6 +77,21 @@
   
   1\x00cannot fetch remote files from shallow repo (no-eol) (esc)
 
-Both error logs should be empty:
+Clones should work with httppostargs turned on
+
+  $ cd master
+  $ hg --config experimental.httppostargs=1 serve -p $HGPORT2 -d --pid-file=../hg3.pid -E ../error3.log
+
+  $ cd ..
+  $ cat hg3.pid >> $DAEMON_PIDS
+
+Clear filenode cache so we can test fetching with a modified batch size
+  $ rm -r $TESTTMP/hgcache
+
+  $ hgcloneshallow http://localhost:$HGPORT2/ shallow-postargs -q
+  1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob)
+
+All error logs should be empty:
   $ cat error.log
   $ cat error2.log
+  $ cat error3.log


More information about the Mercurial-devel mailing list