# HG changeset patch # User Gregory Szorc # Date 2015-02-24 08:06:47 # Node ID 7b09dbbbd5023323109368e27b377ba64d1839d9 # Parent be7cb25186be7e007c83c00a98d88bdad8d11194 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. diff --git a/mercurial/tags.py b/mercurial/tags.py --- a/mercurial/tags.py +++ b/mercurial/tags.py @@ -337,7 +337,7 @@ def _writetagcache(ui, repo, heads, tagf # 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))