Patchwork [3,of,5,V2] extdiff: remove unrequired do3way argument to diffpatch()

login
register
mail settings
Submitter Pulkit Goyal
Date July 16, 2020, 9:56 a.m.
Message ID <9d17a3f106a78059d3d3.1594893408@workspace>
Download mbox | patch
Permalink /patch/46762/
State Accepted
Headers show

Comments

Pulkit Goyal - July 16, 2020, 9:56 a.m.
# HG changeset patch
# User Pulkit Goyal <7895pulkit@gmail.com>
# Date 1594108453 -19800
#      Tue Jul 07 13:24:13 2020 +0530
# Node ID 9d17a3f106a78059d3d315d577490182653a2075
# Parent  5a5891c75cc4646e4e6ea10ed4e9c3aab7e9a049
# EXP-Topic diff-refactor
extdiff: remove unrequired do3way argument to diffpatch()

When we are diffing patches, there is no 3 way diff.

Differential Revision: https://phab.mercurial-scm.org/D8688

Patch

diff --git a/hgext/extdiff.py b/hgext/extdiff.py
--- a/hgext/extdiff.py
+++ b/hgext/extdiff.py
@@ -350,7 +350,7 @@  def _runperfilediff(
                 proc.wait()
 
 
-def diffpatch(ui, repo, node1a, node2, tmproot, matcher, cmdline, do3way):
+def diffpatch(ui, repo, node1a, node2, tmproot, matcher, cmdline):
     template = b'hg-%h.patch'
     with formatter.nullformatter(ui, b'extdiff', {}) as fm:
         cmdutil.export(
@@ -369,12 +369,13 @@  def diffpatch(ui, repo, node1a, node2, t
     cmdline = formatcmdline(
         cmdline,
         repo.root,
-        do3way=do3way,
         parent1=dir1a,
         plabel1=label1a,
         parent2=dir1b,
         plabel2=label1b,
         child=dir2,
+        # no 3way while comparing patches
+        do3way=False,
         clabel=label2,
     )
     ui.debug(b'running %r in %s\n' % (pycompat.bytestr(cmdline), tmproot))
@@ -567,9 +568,7 @@  def dodiff(ui, repo, cmdline, pats, opts
     tmproot = pycompat.mkdtemp(prefix=b'extdiff.')
     try:
         if opts.get(b'patch'):
-            return diffpatch(
-                ui, repo, node1a, node2, tmproot, matcher, cmdline, do3way
-            )
+            return diffpatch(ui, repo, node1a, node2, tmproot, matcher, cmdline)
 
         return diffrevs(
             ui,