changeset 36453:bfb4494f846d

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
author Gregory Szorc <gregory.szorc@gmail.com>
date Mon, 26 Feb 2018 13:34:35 -0800
parents ab81e5a8fba5
children 698fe0f6eb5c
files mercurial/bookmarks.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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()