diff: swap and simplify diffline args
authorGuillermo Pérez <bisho@fb.com>
Thu, 15 Nov 2012 13:52:51 -0800
changeset 17943 66b9832331c9
parent 17942 5e655418aa8d
child 17944 7ac2a7720724
diff: swap and simplify diffline args Args order swapped, since a, b are more important than revs (which is only used on non-git format), and change to read opts from context.
mercurial/patch.py
--- a/mercurial/patch.py	Thu Nov 15 13:49:04 2012 -0800
+++ b/mercurial/patch.py	Thu Nov 15 13:52:51 2012 -0800
@@ -1663,7 +1663,7 @@
     def join(f):
         return os.path.join(prefix, f)
 
-    def diffline(revs, a, b, opts):
+    def diffline(a, b, revs):
         if repo.ui.quiet and not opts.git:
             return ''
         parts = ['diff']
@@ -1763,7 +1763,7 @@
 
         if dodiff:
             if opts.git or revs:
-                header.insert(0, diffline(revs, join(a), join(b), opts))
+                header.insert(0, diffline(join(a), join(b), revs))
             if dodiff == 'binary':
                 text = mdiff.b85diff(to, tn)
             else: