##// END OF EJS Templates
subrepo: use root-repo-relative path from `hg files` with ui.relative-paths=no...
Martin von Zweigbergk -
r41898:4fecf4f6 default draft
parent child Browse files
Show More
@@ -2171,11 +2171,10 def forget(ui, repo, match, prefix, uipa
2171 2171 forgot.extend(f for f in forget if f not in rejected)
2172 2172 return bad, forgot
2173 2173
2174 def files(ui, ctx, m, fm, fmt, subrepos):
2174 def files(ui, ctx, m, uipathfn, fm, fmt, subrepos):
2175 2175 ret = 1
2176 2176
2177 2177 needsfctx = ui.verbose or {'size', 'flags'} & fm.datahint()
2178 uipathfn = scmutil.getuipathfn(ctx.repo(), legacyrelativevalue=True)
2179 2178 for f in ctx.matches(m):
2180 2179 fm.startitem()
2181 2180 fm.context(ctx=ctx)
@@ -2188,11 +2187,13 def files(ui, ctx, m, fm, fmt, subrepos)
2188 2187
2189 2188 for subpath in sorted(ctx.substate):
2190 2189 submatch = matchmod.subdirmatcher(subpath, m)
2190 subuipathfn = scmutil.subdiruipathfn(subpath, uipathfn)
2191 2191 if (subrepos or m.exact(subpath) or any(submatch.files())):
2192 2192 sub = ctx.sub(subpath)
2193 2193 try:
2194 2194 recurse = m.exact(subpath) or subrepos
2195 if sub.printfiles(ui, submatch, fm, fmt, recurse) == 0:
2195 if sub.printfiles(ui, submatch, subuipathfn, fm, fmt,
2196 recurse) == 0:
2196 2197 ret = 0
2197 2198 except error.LookupError:
2198 2199 ui.status(_("skipping missing subrepository: %s\n")
@@ -2213,8 +2213,10 def files(ui, repo, *pats, **opts):
2213 2213
2214 2214 m = scmutil.match(ctx, pats, opts)
2215 2215 ui.pager('files')
2216 uipathfn = scmutil.getuipathfn(ctx.repo(), legacyrelativevalue=True)
2216 2217 with ui.formatter('files', opts) as fm:
2217 return cmdutil.files(ui, ctx, m, fm, fmt, opts.get('subrepos'))
2218 return cmdutil.files(ui, ctx, m, uipathfn, fm, fmt,
2219 opts.get('subrepos'))
2218 2220
2219 2221 @command(
2220 2222 'forget',
@@ -325,7 +325,7 class abstractsubrepo(object):
325 325 """Resolve the fileset expression for this repo"""
326 326 return matchmod.never(badfn=badfn)
327 327
328 def printfiles(self, ui, m, fm, fmt, subrepos):
328 def printfiles(self, ui, m, uipathfn, fm, fmt, subrepos):
329 329 """handle the files command for this subrepo"""
330 330 return 1
331 331
@@ -795,7 +795,7 class hgsubrepo(abstractsubrepo):
795 795 return ctx.flags(name)
796 796
797 797 @annotatesubrepoerror
798 def printfiles(self, ui, m, fm, fmt, subrepos):
798 def printfiles(self, ui, m, uipathfn, fm, fmt, subrepos):
799 799 # If the parent context is a workingctx, use the workingctx here for
800 800 # consistency.
801 801 if self._ctx.rev() is None:
@@ -803,7 +803,7 class hgsubrepo(abstractsubrepo):
803 803 else:
804 804 rev = self._state[1]
805 805 ctx = self._repo[rev]
806 return cmdutil.files(ui, ctx, m, fm, fmt, subrepos)
806 return cmdutil.files(ui, ctx, m, uipathfn, fm, fmt, subrepos)
807 807
808 808 @annotatesubrepoerror
809 809 def matchfileset(self, expr, badfn=None):
@@ -36,7 +36,7 BROKEN: shows subrepo paths relative to
36 36 $ hg files -S --config ui.relative-paths=no
37 37 .hgsub
38 38 a
39 a
39 s/a
40 40
41 41 $ hg -R s ci -Ams0
42 42 $ hg sum
General Comments 0
You need to be logged in to leave comments. Login now