diff --git a/mercurial/filelog.py b/mercurial/filelog.py --- a/mercurial/filelog.py +++ b/mercurial/filelog.py @@ -54,7 +54,7 @@ class filelog(revlog): 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 --git a/mercurial/mdiff.py b/mercurial/mdiff.py --- a/mercurial/mdiff.py +++ b/mercurial/mdiff.py @@ -32,8 +32,8 @@ def unidiff(a, ad, b, bd, fn, r=None, te 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':