comparison mercurial/filelog.py @ 10705:194342b34870

filelog: no need to optimize an uncommon case, assume meta = {}
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
date Tue, 16 Mar 2010 01:16:04 +0100
parents f2618cacb485
children d8d1b56d4519
comparison
equal deleted inserted replaced
10703:1ee60e82333c 10705:194342b34870
31 m[k] = v 31 m[k] = v
32 return m 32 return m
33 33
34 def add(self, text, meta, transaction, link, p1=None, p2=None): 34 def add(self, text, meta, transaction, link, p1=None, p2=None):
35 if meta or text.startswith('\1\n'): 35 if meta or text.startswith('\1\n'):
36 mt = "" 36 mt = ["%s: %s\n" % (k, v) for k, v in sorted(meta.iteritems())]
37 if meta:
38 mt = ["%s: %s\n" % (k, v) for k, v in sorted(meta.iteritems())]
39 text = "\1\n%s\1\n%s" % ("".join(mt), text) 37 text = "\1\n%s\1\n%s" % ("".join(mt), text)
40 return self.addrevision(text, transaction, link, p1, p2) 38 return self.addrevision(text, transaction, link, p1, p2)
41 39
42 def renamed(self, node): 40 def renamed(self, node):
43 if self.parents(node)[0] != revlog.nullid: 41 if self.parents(node)[0] != revlog.nullid: