diff --git a/hgext/fastannotate/protocol.py b/hgext/fastannotate/protocol.py --- a/hgext/fastannotate/protocol.py +++ b/hgext/fastannotate/protocol.py @@ -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 --git a/tests/test-fastannotate-protocol.t b/tests/test-fastannotate-protocol.t --- a/tests/test-fastannotate-protocol.t +++ b/tests/test-fastannotate-protocol.t @@ -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