Patchwork [1,of,2] patch: reverse _inlinediff output for consistency

login
register
mail settings
Submitter matthieu.laneuville@octobus.net
Date Dec. 8, 2017, 9:42 a.m.
Message ID <8e3ebafd54d664a1f3ce.1512726131@carbon>
Download mbox | patch
Permalink /patch/26087/
State Accepted
Headers show

Comments

matthieu.laneuville@octobus.net - Dec. 8, 2017, 9:42 a.m.
# HG changeset patch
# User Matthieu Laneuville <matthieu.laneuville@octobus.net>
# Date 1512719238 -32400
#      Fri Dec 08 16:47:18 2017 +0900
# Node ID 8e3ebafd54d664a1f3ce2032b20cff92b5b399fb
# Parent  483b5dd0f1aa412e9611ab694279c9d3735fee99
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 8e3ebafd54d6
# EXP-Topic inline-diff
patch: reverse _inlinediff output for consistency
Yuya Nishihara - Dec. 8, 2017, 2:58 p.m.
On Fri, 08 Dec 2017 18:42:11 +0900, matthieu.laneuville@octobus.net wrote:
> # HG changeset patch
> # User Matthieu Laneuville <matthieu.laneuville@octobus.net>
> # Date 1512719238 -32400
> #      Fri Dec 08 16:47:18 2017 +0900
> # Node ID 8e3ebafd54d664a1f3ce2032b20cff92b5b399fb
> # Parent  483b5dd0f1aa412e9611ab694279c9d3735fee99
> # Available At https://bitbucket.org/octobus/mercurial-devel/
> #              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 8e3ebafd54d6
> # EXP-Topic inline-diff
> patch: reverse _inlinediff output for consistency

Queued, thanks.

Patch

diff -r 483b5dd0f1aa -r 8e3ebafd54d6 mercurial/patch.py
--- a/mercurial/patch.py	Wed Dec 06 23:33:01 2017 +0100
+++ b/mercurial/patch.py	Fri Dec 08 16:47:18 2017 +0900
@@ -2515,7 +2515,7 @@  def difflabel(func, *args, **kw):
                                 yield (token, 'diff.tab')
                             else:
                                 if i in matches:
-                                    for l, t in _inlinediff(
+                                    for t, l in _inlinediff(
                                                   lines[i].rstrip(),
                                                   lines[matches[i]].rstrip(),
                                                   label):
@@ -2587,10 +2587,10 @@  def _inlinediff(s1, s2, operation):
             token += part[2:]
             continue
         else:
-            buff.append((label, token))
+            buff.append((token, label))
             label = l
             token = part[2:]
-    buff.append((label, token))
+    buff.append((token, label))
 
     return buff