comparison mercurial/filelog.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 e75aab656f46
children 14a4337a9b9b
comparison
equal deleted inserted replaced
7621:6d891df43a5f 7622:4dd7b28003d2
48 48
49 def add(self, text, meta, transaction, link, p1=None, p2=None): 49 def add(self, text, meta, transaction, link, p1=None, p2=None):
50 if meta or text.startswith('\1\n'): 50 if meta or text.startswith('\1\n'):
51 mt = "" 51 mt = ""
52 if meta: 52 if meta:
53 mt = [ "%s: %s\n" % (k, v) for k,v in meta.items() ] 53 mt = ["%s: %s\n" % (k, v) for k, v in meta.iteritems()]
54 text = "\1\n%s\1\n%s" % ("".join(mt), text) 54 text = "\1\n%s\1\n%s" % ("".join(mt), text)
55 return self.addrevision(text, transaction, link, p1, p2) 55 return self.addrevision(text, transaction, link, p1, p2)
56 56
57 def renamed(self, node): 57 def renamed(self, node):
58 if self.parents(node)[0] != nullid: 58 if self.parents(node)[0] != nullid: