bookmarks: write bookmarks file deterministically
Bookmarks are internally stored as an unsorted dictionary. Let's at
least write out the bookmarks file in a deterministic order so it is
easier to test, diff, etc.
Differential Revision: https://phab.mercurial-scm.org/D2469
--- a/mercurial/bookmarks.py Mon Feb 26 13:32:03 2018 -0800
+++ b/mercurial/bookmarks.py Mon Feb 26 13:34:35 2018 -0800
@@ -179,7 +179,7 @@
self._aclean = True
def _write(self, fp):
- for name, node in self.iteritems():
+ for name, node in sorted(self.iteritems()):
fp.write("%s %s\n" % (hex(node), encoding.fromlocal(name)))
self._clean = True
self._repo.invalidatevolatilesets()