comparison mercurial/logcmdutil.py @ 41666:df59b1078983

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
author Martin von Zweigbergk <martinvonz@google.com>
date Fri, 08 Feb 2019 11:56:39 -0800
parents ec37db02fc72
children db69a763bc89
comparison
equal deleted inserted replaced
41665:f164076427b2 41666:df59b1078983
71 def pathfn(f): 71 def pathfn(f):
72 return posixpath.join(prefix, f) 72 return posixpath.join(prefix, f)
73 if relroot != '': 73 if relroot != '':
74 # XXX relative roots currently don't work if the root is within a 74 # XXX relative roots currently don't work if the root is within a
75 # subrepo 75 # subrepo
76 uirelroot = match.uipath(relroot) 76 uipathfn = scmutil.getuipathfn(repo, legacyrelativevalue=True)
77 uirelroot = uipathfn(pathfn(relroot))
77 relroot += '/' 78 relroot += '/'
78 for matchroot in match.files(): 79 for matchroot in match.files():
79 if not matchroot.startswith(relroot): 80 if not matchroot.startswith(relroot):
80 ui.warn(_('warning: %s not inside relative root %s\n') % ( 81 ui.warn(_('warning: %s not inside relative root %s\n') %
81 match.uipath(matchroot), uirelroot)) 82 (uipathfn(pathfn(matchroot)), uirelroot))
82 83
83 relrootmatch = scmutil.match(ctx2, pats=[relroot], default='path') 84 relrootmatch = scmutil.match(ctx2, pats=[relroot], default='path')
84 match = matchmod.intersectmatchers(match, relrootmatch) 85 match = matchmod.intersectmatchers(match, relrootmatch)
85 copysourcematch = relrootmatch 86 copysourcematch = relrootmatch
86 87