comparison mercurial/cmdutil.py @ 41590:15f63ac122ea

files: respect ui.relative-paths Differential Revision: https://phab.mercurial-scm.org/D5801
author Martin von Zweigbergk <martinvonz@google.com>
date Tue, 29 Jan 2019 15:49:20 -0800
parents 66399f2e92aa
children 4d4842445afc
comparison
equal deleted inserted replaced
41589:aec185af621e 41590:15f63ac122ea
2162 2162
2163 def files(ui, ctx, m, fm, fmt, subrepos): 2163 def files(ui, ctx, m, fm, fmt, subrepos):
2164 ret = 1 2164 ret = 1
2165 2165
2166 needsfctx = ui.verbose or {'size', 'flags'} & fm.datahint() 2166 needsfctx = ui.verbose or {'size', 'flags'} & fm.datahint()
2167 uipathfn = scmutil.getuipathfn(ctx.repo(), legacyrelativevalue=True)
2167 for f in ctx.matches(m): 2168 for f in ctx.matches(m):
2168 fm.startitem() 2169 fm.startitem()
2169 fm.context(ctx=ctx) 2170 fm.context(ctx=ctx)
2170 if needsfctx: 2171 if needsfctx:
2171 fc = ctx[f] 2172 fc = ctx[f]
2172 fm.write('size flags', '% 10d % 1s ', fc.size(), fc.flags()) 2173 fm.write('size flags', '% 10d % 1s ', fc.size(), fc.flags())
2173 fm.data(path=f) 2174 fm.data(path=f)
2174 fm.plain(fmt % m.rel(f)) 2175 fm.plain(fmt % uipathfn(f))
2175 ret = 0 2176 ret = 0
2176 2177
2177 for subpath in sorted(ctx.substate): 2178 for subpath in sorted(ctx.substate):
2178 submatch = matchmod.subdirmatcher(subpath, m) 2179 submatch = matchmod.subdirmatcher(subpath, m)
2179 if (subrepos or m.exact(subpath) or any(submatch.files())): 2180 if (subrepos or m.exact(subpath) or any(submatch.files())):