diff mercurial/logcmdutil.py @ 41670:db69a763bc89

diff: make --stat respect ui.relative-paths It would have been easy to make all diffs respect ui.relative-paths, but we don't want that since it makes the diff invalid. Perhaps it makes sense to do that with --noprefix since the point of that is to make paths that are easy to copy&paste, and the diff is already invalid anyway. But this patch just makes the --stat version respect the config option. The --stat view is not even close to a valid diff, so I think it makes sense to show the paths in more human-friendly form. Differential Revision: https://phab.mercurial-scm.org/D5896
author Martin von Zweigbergk <martinvonz@google.com>
date Thu, 31 Jan 2019 15:35:51 -0800
parents df59b1078983
children 77ef3498ceb3
line wrap: on
line diff
--- a/mercurial/logcmdutil.py	Sat Feb 09 23:48:19 2019 -0800
+++ b/mercurial/logcmdutil.py	Thu Jan 31 15:35:51 2019 -0800
@@ -99,6 +99,9 @@
         width = 80
         if not ui.plain():
             width = ui.termwidth() - graphwidth
+        # If an explicit --root was given, don't respect ui.relative-paths
+        if not relroot:
+            pathfn = compose(scmutil.getuipathfn(repo), pathfn)
 
     chunks = ctx2.diff(ctx1, match, changes, opts=diffopts, pathfn=pathfn,
                        copysourcematch=copysourcematch,