mercurial/patch.py
changeset 17940 c84ef0047a94
parent 17939 d587925680d9
child 17941 9a6e4d5d7ea8
--- a/mercurial/patch.py	Tue Nov 06 14:04:05 2012 -0800
+++ b/mercurial/patch.py	Thu Nov 15 12:16:08 2012 -0800
@@ -1746,17 +1746,17 @@
                         dodiff = 'binary'
                 elif binary or nflag != oflag:
                     losedatafn(f)
-            if opts.git:
-                header.insert(0, mdiff.diffline(revs, join(a), join(b), opts))
 
         if dodiff:
+            if opts.git or revs:
+                header.insert(0, mdiff.diffline(revs, join(a), join(b), opts))
             if dodiff == 'binary':
                 text = mdiff.b85diff(to, tn)
             else:
                 text = mdiff.unidiff(to, date1,
                                     # ctx2 date may be dynamic
                                     tn, util.datestr(ctx2.date()),
-                                    join(a), join(b), revs, opts=opts)
+                                    join(a), join(b), opts=opts)
             if header and (text or len(header) > 1):
                 yield ''.join(header)
             if text: