changeset 36558:33c6f8f0388d

wireproto: sort response to listkeys The listkeys protocol is defined to produce a dictionary. pushkey.decodekeys() uses a plain dict to hold the decoded results of the wire protocol response. So order should not matter. Upcoming tests will verify low-level output of wire protocol commands and the non-deterministic emitting of listkeys was causing intermittent failures. So we make the output of listkeys deterministic. Differential Revision: https://phab.mercurial-scm.org/D2405
author Gregory Szorc <gregory.szorc@gmail.com>
date Fri, 23 Feb 2018 09:40:12 -0800
parents 72e487851a53
children bde0bd50f368
files mercurial/wireproto.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/wireproto.py	Thu Mar 01 08:24:54 2018 -0800
+++ b/mercurial/wireproto.py	Fri Feb 23 09:40:12 2018 -0800
@@ -916,7 +916,7 @@
 
 @wireprotocommand('listkeys', 'namespace')
 def listkeys(repo, proto, namespace):
-    d = repo.listkeys(encoding.tolocal(namespace)).items()
+    d = sorted(repo.listkeys(encoding.tolocal(namespace)).items())
     return bytesresponse(pushkeymod.encodekeys(d))
 
 @wireprotocommand('lookup', 'key')