Mercurial > public > mercurial-scm > hg-stable
diff mercurial/mdiff.py @ 17940:c84ef0047a94
diff: unify calls to diffline
diffline was called from trydiff for binary diffs and from unidiff
for text diffs. In this patch we unify those calls into one.
diffline is also a header, not part of diff mechanisms, so it makes
sense to remove that responsibility from the mdiff module. In
upcoming patches we will move diffline to patch module and
keep grouping responsibilities.
author | Guillermo P?rez <bisho@fb.com> |
---|---|
date | Thu, 15 Nov 2012 12:16:08 -0800 |
parents | d587925680d9 |
children | 9a6e4d5d7ea8 |
line wrap: on
line diff
--- a/mercurial/mdiff.py Tue Nov 06 14:04:05 2012 -0800 +++ b/mercurial/mdiff.py Thu Nov 15 12:16:08 2012 -0800 @@ -156,7 +156,7 @@ parts.append(a) return ' '.join(parts) + '\n' -def unidiff(a, ad, b, bd, fn1, fn2, r=None, opts=defaultopts): +def unidiff(a, ad, b, bd, fn1, fn2, opts=defaultopts): def datetag(date, fn=None): if not opts.git and not opts.nodates: return '\t%s\n' % date @@ -207,9 +207,6 @@ if l[ln][-1] != '\n': l[ln] += "\n\ No newline at end of file\n" - if r: - l.insert(0, diffline(r, fn1, fn2, opts)) - return "".join(l) # creates a headerless unified diff