comparison mercurial/filelog.py @ 1540:8ca9f5b17257

minor optimization: save some string trash
author twaldmann@thinkmo.de
date Mon, 14 Nov 2005 02:30:19 +0200
parents 30ab5b8ee8ec
children bf4e7ef08741
comparison
equal deleted inserted replaced
1535:7ae0ce7a3dc4 1540:8ca9f5b17257
52 def add(self, text, meta, transaction, link, p1=None, p2=None): 52 def add(self, text, meta, transaction, link, p1=None, p2=None):
53 if meta or text.startswith('\1\n'): 53 if meta or text.startswith('\1\n'):
54 mt = "" 54 mt = ""
55 if meta: 55 if meta:
56 mt = [ "%s: %s\n" % (k, v) for k,v in meta.items() ] 56 mt = [ "%s: %s\n" % (k, v) for k,v in meta.items() ]
57 text = "\1\n" + "".join(mt) + "\1\n" + text 57 text = "\1\n%s\1\n%s" % ("".join(mt), text)
58 return self.addrevision(text, transaction, link, p1, p2) 58 return self.addrevision(text, transaction, link, p1, p2)
59 59
60 def renamed(self, node): 60 def renamed(self, node):
61 if 0 and self.parents(node)[0] != nullid: 61 if 0 and self.parents(node)[0] != nullid:
62 return False 62 return False