Patchwork [5,of,4] trydiff: inline indexmeta()

login
register
mail settings
Submitter Martin von Zweigbergk
Date Feb. 3, 2015, 12:11 a.m.
Message ID <891ed406d6bdb81faaf6.1422922315@martinvonz.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/7613/
State Accepted
Headers show

Comments

Martin von Zweigbergk - Feb. 3, 2015, 12:11 a.m.
# HG changeset patch
# User Martin von Zweigbergk <martinvonz@google.com>
# Date 1421451659 28800
#      Fri Jan 16 15:40:59 2015 -0800
# Node ID 891ed406d6bdb81faaf6619a89f37ce0c95bb579
# Parent  d77b71a6b396569da1a10ae5b5a6365fc9f9f0a3
trydiff: inline indexmeta()

The function is trivial and is only called in one place.
Pierre-Yves David - Feb. 3, 2015, 11:22 a.m.
On 02/03/2015 12:11 AM, Martin von Zweigbergk wrote:
> # HG changeset patch
> # User Martin von Zweigbergk <martinvonz@google.com>
> # Date 1421451659 28800
> #      Fri Jan 16 15:40:59 2015 -0800
> # Node ID 891ed406d6bdb81faaf6619a89f37ce0c95bb579
> # Parent  d77b71a6b396569da1a10ae5b5a6365fc9f9f0a3
> trydiff: inline indexmeta()
>
> The function is trivial and is only called in one place.

This patch seems to have been separated from the pack. pushed to the 
clowncopter.

Patch

diff -r d77b71a6b396 -r 891ed406d6bd mercurial/patch.py
--- a/mercurial/patch.py	Fri Jan 16 14:49:08 2015 -0800
+++ b/mercurial/patch.py	Fri Jan 16 15:40:59 2015 -0800
@@ -1739,9 +1739,6 @@ 
 def trydiff(repo, revs, ctx1, ctx2, modified, added, removed,
             copy, getfilectx, opts, losedatafn, prefix):
 
-    def addindexmeta(meta, index1, index2):
-        meta.append('index %s..%s\n' % (index1, index2))
-
     def gitindex(text):
         if not text:
             text = ""
@@ -1869,7 +1866,8 @@ 
         if binarydiff and not opts.nobinary:
             text = mdiff.b85diff(content1, content2)
             if text and opts.git:
-                addindexmeta(header, gitindex(content1), gitindex(content2))
+                header.append('index %s..%s\n' %
+                              (gitindex(content1), gitindex(content2)))
         else:
             text = mdiff.unidiff(content1, date1,
                                  content2, date2,