diff: respect ui.relative-paths for warning about path outside --root
authorMartin von Zweigbergk <martinvonz@google.com>
Fri, 08 Feb 2019 11:56:39 -0800
changeset 41655 df59b1078983
parent 41654 f164076427b2
child 41656 dadbfcc63b3e
diff: respect ui.relative-paths for warning about path outside --root I set legacyrelativevalue=True rather than being based on what patterns the user passed (as the current match.uipath() does). I think it simply doesn't really matter for this message (there are not even any tests for it). Differential Revision: https://phab.mercurial-scm.org/D5905
mercurial/logcmdutil.py
--- a/mercurial/logcmdutil.py	Thu Feb 07 23:29:14 2019 -0800
+++ b/mercurial/logcmdutil.py	Fri Feb 08 11:56:39 2019 -0800
@@ -73,12 +73,13 @@
     if relroot != '':
         # XXX relative roots currently don't work if the root is within a
         # subrepo
-        uirelroot = match.uipath(relroot)
+        uipathfn = scmutil.getuipathfn(repo, legacyrelativevalue=True)
+        uirelroot = uipathfn(pathfn(relroot))
         relroot += '/'
         for matchroot in match.files():
             if not matchroot.startswith(relroot):
-                ui.warn(_('warning: %s not inside relative root %s\n') % (
-                    match.uipath(matchroot), uirelroot))
+                ui.warn(_('warning: %s not inside relative root %s\n') %
+                        (uipathfn(pathfn(matchroot)), uirelroot))
 
         relrootmatch = scmutil.match(ctx2, pats=[relroot], default='path')
         match = matchmod.intersectmatchers(match, relrootmatch)