Patchwork [2,of,3] extdiff: remove dir2root and pass full path as dir2 in _runperfilediff()

login
register
mail settings
Submitter Pulkit Goyal
Date Sept. 1, 2020, 12:18 p.m.
Message ID <28e81de5f83624341454.1598962732@workspace>
Download mbox | patch
Permalink /patch/47077/
State Accepted
Headers show

Comments

Pulkit Goyal - Sept. 1, 2020, 12:18 p.m.
# HG changeset patch
# User Pulkit Goyal <7895pulkit@gmail.com>
# Date 1598691746 -19800
#      Sat Aug 29 14:32:26 2020 +0530
# Node ID 28e81de5f83624341454eea6ef5973cd7db10675
# Parent  e49d6016a24ce0ead59e32db68489de6c18c779d
# EXP-Topic extdiff-refactor
extdiff: remove dir2root and pass full path as dir2 in _runperfilediff()

The only use of `dir2root` was to join with `dir2` to generate the path for
other side of diff. Like in previous patch, `dir1a` and `dir1b` are full paths
and no longer base names, hence we pass `dir2` as full path too and making
`dir2root` unrequired.

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

Patch

diff --git a/hgext/extdiff.py b/hgext/extdiff.py
--- a/hgext/extdiff.py
+++ b/hgext/extdiff.py
@@ -255,7 +255,6 @@  def _runperfilediff(
     tmproot,
     dir1a,
     dir1b,
-    dir2root,
     dir2,
     rev1a,
     rev1b,
@@ -280,7 +279,7 @@  def _runperfilediff(
             if not os.path.isfile(path1b):
                 path1b = pycompat.osdevnull
 
-        path2 = os.path.join(dir2root, dir2, commonfile)
+        path2 = os.path.join(dir2, commonfile)
         label2 = commonfile + rev2
 
         if confirm:
@@ -501,8 +500,7 @@  def diffrevs(
             tmproot=tmproot,
             dir1a=os.path.join(tmproot, dir1a),
             dir1b=os.path.join(tmproot, dir1b) if do3way else None,
-            dir2root=dir2root,
-            dir2=dir2,
+            dir2=os.path.join(dir2root, dir2),
             rev1a=rev1a,
             rev1b=rev1b,
             rev2=rev2,