# HG changeset patch # User twaldmann@thinkmo.de # Date 1131928219 -7200 # Node ID 8ca9f5b1725743e981cb66a6ae685a52ea4e58f1 # Parent 7ae0ce7a3dc475ad7684b7818bd1d4fa9c407e8b minor optimization: save some string trash diff -r 7ae0ce7a3dc4 -r 8ca9f5b17257 mercurial/filelog.py --- a/mercurial/filelog.py Fri Nov 11 18:20:24 2005 -0800 +++ b/mercurial/filelog.py Mon Nov 14 02:30:19 2005 +0200 @@ -54,7 +54,7 @@ mt = "" if meta: mt = [ "%s: %s\n" % (k, v) for k,v in meta.items() ] - text = "\1\n" + "".join(mt) + "\1\n" + text + text = "\1\n%s\1\n%s" % ("".join(mt), text) return self.addrevision(text, transaction, link, p1, p2) def renamed(self, node): diff -r 7ae0ce7a3dc4 -r 8ca9f5b17257 mercurial/mdiff.py --- a/mercurial/mdiff.py Fri Nov 11 18:20:24 2005 -0800 +++ b/mercurial/mdiff.py Mon Nov 14 02:30:19 2005 +0200 @@ -32,8 +32,8 @@ l = list(difflib.unified_diff(a, b, "a/" + fn, "b/" + fn)) if not l: return "" # difflib uses a space, rather than a tab - l[0] = l[0][:-2] + "\t" + ad + "\n" - l[1] = l[1][:-2] + "\t" + bd + "\n" + l[0] = "%s\t%s\n" % (l[0][:-2], ad) + l[1] = "%s\t%s\n" % (l[1][:-2], bd) for ln in xrange(len(l)): if l[ln][-1] != '\n':