scmutil: respect ui.relative-paths in default match.badfn
authorMartin von Zweigbergk <martinvonz@google.com>
Fri, 08 Feb 2019 13:33:40 -0800
changeset 41665 0ed7a8ac5711
parent 41664 0cbf491db7ee
child 41666 a950b65cbe1b
scmutil: respect ui.relative-paths in default match.badfn We should probably be passing in a uipathfn here instead, so the caller can get consistent output (between match.badfn and whatever else it prints). I think we should ideally remove the badfn from the matcher completely, but that's a different story. This patch is at least not making it worse. Differential Revision: https://phab.mercurial-scm.org/D5916
mercurial/scmutil.py
--- a/mercurial/scmutil.py	Fri Feb 08 13:00:28 2019 -0800
+++ b/mercurial/scmutil.py	Fri Feb 08 13:33:40 2019 -0800
@@ -802,8 +802,9 @@
     if not globbed and default == 'relpath':
         pats = expandpats(pats or [])
 
+    uipathfn = getuipathfn(ctx.repo(), legacyrelativevalue=True)
     def bad(f, msg):
-        ctx.repo().ui.warn("%s: %s\n" % (m.rel(f), msg))
+        ctx.repo().ui.warn("%s: %s\n" % (uipathfn(f), msg))
 
     if badfn is None:
         badfn = bad