phases: write phaseroots deterministically
authorGregory Szorc <gregory.szorc@gmail.com>
Mon, 26 Feb 2018 13:32:03 -0800
changeset 36452 ab81e5a8fba5
parent 36451 1fa35ca345a5
child 36453 bfb4494f846d
phases: write phaseroots deterministically self.phaseroots is a list of sets of binary nodes. Let's sort the nodes before writing so the phaseroots file is written out deterministically. Differential Revision: https://phab.mercurial-scm.org/D2468
mercurial/phases.py
--- a/mercurial/phases.py	Sat Feb 17 11:19:52 2018 -0700
+++ b/mercurial/phases.py	Mon Feb 26 13:32:03 2018 -0800
@@ -326,7 +326,7 @@
 
     def _write(self, fp):
         for phase, roots in enumerate(self.phaseroots):
-            for h in roots:
+            for h in sorted(roots):
                 fp.write('%i %s\n' % (phase, hex(h)))
         self.dirty = False