# HG changeset patch # User Gregory Szorc # Date 1492146724 25200 # Node ID 511a62669f1b0a9be906ce6dd5f59ddbedcada94 # Parent aa836f56c3ccf5c10868a226df69c830d77410fc phases: emit phases to pushkey protocol in deterministic order An upcoming test will report exact bytes sent over the wire protocol. Without this change, the ordering of phases listkey data is non-deterministic. diff -r aa836f56c3cc -r 511a62669f1b mercurial/phases.py --- a/mercurial/phases.py Thu Apr 13 18:04:38 2017 -0700 +++ b/mercurial/phases.py Thu Apr 13 22:12:04 2017 -0700 @@ -116,6 +116,7 @@ error, smartset, txnutil, + util, ) allphases = public, draft, secret = range(3) @@ -386,7 +387,8 @@ def listphases(repo): """List phases root for serialization over pushkey""" - keys = {} + # Use ordered dictionary so behavior is deterministic. + keys = util.sortdict() value = '%i' % draft for root in repo._phasecache.phaseroots[draft]: keys[hex(root)] = value