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