From 4a825527f0e66ee1860ed8c76c8c5546bbf4eeab Mon Sep 17 00:00:00 2001 From: Adam Hupp <142939708+adamh-oai@users.noreply.github.com> Date: Sat, 26 Jul 2025 21:59:28 -0700 Subject: [PATCH] Use extdiff commands when diff tool configured --- eden/scm/sapling/cmdutil.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/eden/scm/sapling/cmdutil.py b/eden/scm/sapling/cmdutil.py index b5bd55286c35b..90107f8aafbe9 100644 --- a/eden/scm/sapling/cmdutil.py +++ b/eden/scm/sapling/cmdutil.py @@ -1911,6 +1911,23 @@ def diffordiffstat( hunksfilterfn=None, ): """show diff or diffstat.""" + exttool = ui.config("diff", "tool") + if exttool and not stat: + from sapling.ext import extdiff + + if not extdiff.cmdtable: + raise error.Abort(_("extdiff plugin not enabled")) + + if exttool not in extdiff.cmdtable: + raise error.Abort(_("unknown extdiff tool '%s'") % exttool) + + opts = { + "rev": [str(ctx1.rev()), str(ctx2.rev())], + "option": [], + } + + extdiff.cmdtable[exttool][0](ui, repo, *list(match.files()), **opts) + return if fp is None: if stat: write = ui.write