Patchwork D2468: phases: write phaseroots deterministically

login
register
mail settings
Submitter phabricator
Date Feb. 26, 2018, 9:32 p.m.
Message ID <differential-rev-PHID-DREV-rhsryfr7ftz2fhjge3p6-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/28433/
State Superseded
Headers show

Comments

phabricator - Feb. 26, 2018, 9:32 p.m.
indygreg created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

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

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/phases.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/phases.py b/mercurial/phases.py
--- a/mercurial/phases.py
+++ b/mercurial/phases.py
@@ -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