Patchwork [2,of,6,for-clowncopter] trydiff: remove unused argument to diffline()

login
register
mail settings
Submitter Martin von Zweigbergk
Date Feb. 3, 2015, 4:58 p.m.
Message ID <9fb8badbdb4ba556d8f4.1422982708@martinvonz.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/7634/
State Accepted
Commit f51a822dcf3ba427ededbf3510d0a7e030399f5e
Headers show

Comments

Martin von Zweigbergk - Feb. 3, 2015, 4:58 p.m.
# HG changeset patch
# User Martin von Zweigbergk <martinvonz@google.com>
# Date 1421449131 28800
#      Fri Jan 16 14:58:51 2015 -0800
# Node ID 9fb8badbdb4ba556d8f45b927d7c43efda495da0
# Parent  77066b7b7b26ff04e7928fe79ef5f03219ae26b7
trydiff: remove unused argument to diffline()

Now that diffline no longer knows about copies/renames, it only needs
one argument for the path.

Patch

diff -r 77066b7b7b26 -r 9fb8badbdb4b mercurial/patch.py
--- a/mercurial/patch.py	Fri Jan 16 14:58:06 2015 -0800
+++ b/mercurial/patch.py	Fri Jan 16 14:58:51 2015 -0800
@@ -1753,13 +1753,13 @@ 
         aprefix = 'a/'
         bprefix = 'b/'
 
-    def diffline(a, b, revs):
+    def diffline(f, revs):
         if not repo.ui.quiet:
             if revs:
                 revinfo = ' '.join(["-r %s" % rev for rev in revs])
-                line = 'diff %s %s\n' % (revinfo, a)
+                line = 'diff %s %s\n' % (revinfo, f)
             else:
-                line = 'diff %s\n' % a
+                line = 'diff %s\n' % f
         else:
             line = ''
         return line
@@ -1846,7 +1846,7 @@ 
         path2 = posixpath.join(prefix, f2)
         header = []
         if revs:
-            header.append(diffline(path1, path2, revs))
+            header.append(diffline(path1, revs))
         elif opts.git:
             header.append('diff --git %s%s %s%s\n' %
                           (aprefix, path1, bprefix, path2))