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