# HG changeset patch # User Augie Fackler # Date 1533136241 14400 # Node ID c8a40b33ce30b6567eb237673563fca933afa675 # Parent 1ddb296e0deeb3ca7eebeb48ce8ac1a073f00861 fastannotate: write out files from server in a predictable order This is mostly for test output stabilization, but it *might* be slightly better with a ton of annotate caches because we'll write to one directory at a time rather than bouncing around randomly. Differential Revision: https://phab.mercurial-scm.org/D3995 diff -r 1ddb296e0dee -r c8a40b33ce30 hgext/fastannotate/protocol.py --- a/hgext/fastannotate/protocol.py Mon Jul 30 22:50:00 2018 -0400 +++ b/hgext/fastannotate/protocol.py Wed Aug 01 11:10:41 2018 -0400 @@ -185,11 +185,13 @@ ui.debug('fastannotate: server returned\n') for result in results: - for path, content in result.result().iteritems(): + r = result.result() + for path in sorted(r): # ignore malicious paths if not path.startswith('fastannotate/') or '/../' in (path + '/'): ui.debug('fastannotate: ignored malicious path %s\n' % path) continue + content = r[path] if ui.debugflag: ui.debug('fastannotate: writing %d bytes to %s\n' % (len(content), path)) diff -r 1ddb296e0dee -r c8a40b33ce30 tests/test-fastannotate-protocol.t --- a/tests/test-fastannotate-protocol.t Mon Jul 30 22:50:00 2018 -0400 +++ b/tests/test-fastannotate-protocol.t Wed Aug 01 11:10:41 2018 -0400 @@ -47,9 +47,8 @@ sending protocaps command fastannotate: requesting 1 files sending getannotate command - fastannotate: writing 112 bytes to fastannotate/default/a.l (?) fastannotate: server returned - fastannotate: writing 112 bytes to fastannotate/default/a.l (?) + fastannotate: writing 112 bytes to fastannotate/default/a.l fastannotate: writing 94 bytes to fastannotate/default/a.m fastannotate: a: using fast path (resolved fctx: True) 0: 1