# HG changeset patch # User Martin von Zweigbergk # Date 1420649212 28800 # Node ID 30c6e85aac779b79b4477e9de71bfb73a05f2b93 # Parent e864353f8c6b6ac6eac5c8b672ea276a8ed0540c 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. diff -r e864353f8c6b -r 30c6e85aac77 mercurial/patch.py --- 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,