changeset 23751:30c6e85aac77

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.
author Martin von Zweigbergk <martinvonz@google.com>
date Wed, 07 Jan 2015 08:46:52 -0800
parents e864353f8c6b
children 70d8be6299ab
files mercurial/patch.py
diffstat 1 files changed, 3 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- 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,