D3995: fastannotate: write out files from server in a predictable order

durin42 (Augie Fackler) phabricator at mercurial-scm.org
Wed Aug 1 15:17:57 UTC 2018


durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  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.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D3995

AFFECTED FILES
  hgext/fastannotate/protocol.py
  tests/test-fastannotate-protocol.t

CHANGE DETAILS

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
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))



To: durin42, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list