trydiff: remove unused code for git index of "combined diff"
We only ever produce diffs with one pre- and one post-image, so remove
the code for displaying "index" lines for combined diffs.
--- a/mercurial/patch.py Tue Jan 06 22:55:01 2015 -0800
+++ b/mercurial/patch.py Wed Jan 07 08:46:52 2015 -0800
@@ -1747,13 +1747,9 @@
header.append('old mode %s\n' % omode)
header.append('new mode %s\n' % nmode)
- def addindexmeta(meta, revs):
+ def addindexmeta(meta, oindex, nindex):
if opts.git:
- i = len(revs)
- if i==2:
- meta.append('index %s..%s\n' % tuple(revs))
- elif i==3:
- meta.append('index %s,%s..%s\n' % tuple(revs))
+ meta.append('index %s..%s\n' % (oindex, nindex))
def gitindex(text):
if not text:
@@ -1880,7 +1876,7 @@
if dodiff == 'binary' and not opts.nobinary:
text = mdiff.b85diff(to, tn)
if text:
- addindexmeta(header, [gitindex(to), gitindex(tn)])
+ addindexmeta(header, gitindex(to), gitindex(tn))
else:
text = mdiff.unidiff(to, date1,
tn, date2,