[PATCH 05 of 12] diff: change diffline args

Guillermo Pérez bisho at fb.com
Thu Nov 15 17:23:35 CST 2012


# HG changeset patch
# User Guillermo Pérez <bisho at fb.com>
# Date 1353016371 28800
# Node ID d2316f61c1d0978630802b80ef85c77b08ad9a09
# Parent  aafdf389beba902aebbbabbfffcef5fa68d15256
diff: change diffline args

Args order swapped, since a, b are more important than revs
that is only used on non-git format, and change to read opts
from context.

diff --git a/mercurial/patch.py b/mercurial/patch.py
--- a/mercurial/patch.py
+++ b/mercurial/patch.py
@@ -1664,7 +1664,7 @@
         return os.path.join(prefix, f)
 
     ''' Helper header functions '''
-    def diffline(revs, a, b, opts):
+    def diffline(a, b, revs):
         if repo.ui.quiet and not opts.git:
             return ''
         parts = ['diff']
@@ -1764,7 +1764,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:


More information about the Mercurial-devel mailing list