mercurial/cmdutil.py
changeset 41576 15f63ac122ea
parent 41560 66399f2e92aa
child 41591 4d4842445afc
equal deleted inserted replaced
41575:aec185af621e 41576: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())):