tags: write tags cache deterministically
An upcoming test verifies content of the .hg/cache/tags file. During
testing, inconsistent output was observed. This is the result of
iterating over a dictionary.
Throw a sorted() around tags entries to ensure .hg/cache/tags is written
deterministically so test output is stable.
--- a/mercurial/tags.py Thu Jan 22 12:36:38 2015 -0800
+++ b/mercurial/tags.py Tue Feb 24 00:06:47 2015 -0800
@@ -337,7 +337,7 @@
# them local encoding on input, we would lose info writing them to
# the cache.
cachefile.write('\n')
- for (name, (node, hist)) in cachetags.iteritems():
+ for (name, (node, hist)) in sorted(cachetags.iteritems()):
for n in hist:
cachefile.write("%s %s\n" % (hex(n), name))
cachefile.write("%s %s\n" % (hex(node), name))