diff mercurial/commands.py @ 7622:4dd7b28003d2

use dict.iteritems() rather than dict.items() This should be faster and more future-proof. Calls where the result is to be sorted using util.sort() have been left unchanged. Calls to .items() on configparser objects have been left as-is, too.
author Dirkjan Ochtman <dirkjan@ochtman.nl>
date Mon, 12 Jan 2009 09:16:03 +0100
parents 26adfaccdf73
children 9c6ae2e09e11
line wrap: on
line diff
--- a/mercurial/commands.py	Mon Jan 12 09:07:02 2009 +0100
+++ b/mercurial/commands.py	Mon Jan 12 09:16:03 2009 +0100
@@ -788,7 +788,7 @@
     """show the contents of the current dirstate"""
     timestr = ""
     showdate = not nodates
-    for file_, ent in util.sort(repo.dirstate._map.items()):
+    for file_, ent in util.sort(repo.dirstate._map.iteritems()):
         if showdate:
             if ent[3] == -1:
                 # Pad or slice to locale representation
@@ -1348,7 +1348,7 @@
     def helplist(header, select=None):
         h = {}
         cmds = {}
-        for c, e in table.items():
+        for c, e in table.iteritems():
             f = c.split("|", 1)[0]
             if select and not select(f):
                 continue
@@ -2746,7 +2746,7 @@
         if node2 is None:
             added = stat[0] + stat[1] # merged?
 
-        for k, v in copies.copies(repo, ctx1, ctx2, ctxn)[0].items():
+        for k, v in copies.copies(repo, ctx1, ctx2, ctxn)[0].iteritems():
             if k in added:
                 copy[k] = v
             elif v in added: