changeset 21814:5125856a28cf

tags: read tag info into a sorted dict (rather than into a regular dict) This lets us preserve the original tag order (as specified on the .hgtags file that is being read). This will be useful to preserve the tag order when saving the result of a successful automated .hgtags merge (which will be introduced on a future patch). There shouldn't be much impact on performance because the sortdict that _readtags returns is then used to update the alltags regular dict (which remains a regular dict).
author Angel Ezquerra <angel.ezquerra@gmail.com>
date Sun, 23 Feb 2014 03:13:21 +0100
parents c2262004c2e2
children 212955411633
files mercurial/tags.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/tags.py	Sun Feb 23 01:56:31 2014 +0100
+++ b/mercurial/tags.py	Sun Feb 23 03:13:21 2014 +0100
@@ -12,6 +12,7 @@
 
 from node import nullid, bin, hex, short
 from i18n import _
+import util
 import encoding
 import error
 import errno
@@ -81,7 +82,7 @@
     ids previously associated with it (in file order).  All node ids are
     binary, not hex.'''
 
-    filetags = {}               # map tag name to (node, hist)
+    filetags = util.sortdict()  # map tag name to (node, hist)
     count = 0
 
     def warn(msg):