Show More
@@ -663,5 +663,5 b' class fileserverclient(object):' | |||||
663 | self.ui.log( |
|
663 | self.ui.log( | |
664 | b'remotefilelog', |
|
664 | b'remotefilelog', | |
665 | b'excess remotefilelog fetching:\n%s\n', |
|
665 | b'excess remotefilelog fetching:\n%s\n', | |
666 |
b''.join(pycompat.sysbytes(traceback.format_stack()) |
|
666 | b''.join(pycompat.sysbytes(s) for s in traceback.format_stack()), | |
667 | ) |
|
667 | ) |
@@ -236,3 +236,36 b'' | |||||
236 | $ hg revert -a -r 1 || true |
|
236 | $ hg revert -a -r 1 || true | |
237 | 3 files fetched over 1 fetches - (3 misses, 0.00% hit ratio) over * (glob) |
|
237 | 3 files fetched over 1 fetches - (3 misses, 0.00% hit ratio) over * (glob) | |
238 | abort: z2@109c3a557a73: not found in manifest! (?) |
|
238 | abort: z2@109c3a557a73: not found in manifest! (?) | |
|
239 | ||||
|
240 | # warning when we have excess remotefilelog fetching | |||
|
241 | ||||
|
242 | $ cat > repeated_fetch.py << EOF | |||
|
243 | > import binascii | |||
|
244 | > from mercurial import extensions, registrar | |||
|
245 | > cmdtable = {} | |||
|
246 | > command = registrar.command(cmdtable) | |||
|
247 | > @command(b'repeated-fetch', [], b'', inferrepo=True) | |||
|
248 | > def repeated_fetch(ui, repo, *args, **opts): | |||
|
249 | > for i in range(20): | |||
|
250 | > try: | |||
|
251 | > hexid = (b'%02x' % (i + 1)) * 20 | |||
|
252 | > repo.fileservice.prefetch([(b'somefile.txt', hexid)]) | |||
|
253 | > except: | |||
|
254 | > pass | |||
|
255 | > EOF | |||
|
256 | ||||
|
257 | We should only output to the user once. We're ignoring most of the output | |||
|
258 | because we're not actually fetching anything real here, all the hashes are | |||
|
259 | bogus, so it's just going to be errors and a final summary of all the misses. | |||
|
260 | $ hg --config extensions.repeated_fetch=repeated_fetch.py \ | |||
|
261 | > --config remotefilelog.fetchwarning="fetch warning!" \ | |||
|
262 | > --config extensions.blackbox= \ | |||
|
263 | > repeated-fetch 2>&1 | grep 'fetch warning' | |||
|
264 | fetch warning! | |||
|
265 | ||||
|
266 | We should output to blackbox three times, with a stack trace on each (though | |||
|
267 | that isn't tested here). | |||
|
268 | $ grep 'excess remotefilelog fetching' .hg/blackbox.log | |||
|
269 | .* excess remotefilelog fetching: (re) | |||
|
270 | .* excess remotefilelog fetching: (re) | |||
|
271 | .* excess remotefilelog fetching: (re) |
General Comments 0
You need to be logged in to leave comments.
Login now