##// END OF EJS Templates
files: don't recurse into subrepos without a path or -S (issue5127)...
Matt Harbison -
r28387:97175d9b stable
parent child Browse files
Show More
@@ -2340,14 +2340,15 b' def files(ui, ctx, m, fm, fmt, subrepos)'
2340
2340
2341 for subpath in sorted(ctx.substate):
2341 for subpath in sorted(ctx.substate):
2342 def matchessubrepo(subpath):
2342 def matchessubrepo(subpath):
2343 return (m.always() or m.exact(subpath)
2343 return (m.exact(subpath)
2344 or any(f.startswith(subpath + '/') for f in m.files()))
2344 or any(f.startswith(subpath + '/') for f in m.files()))
2345
2345
2346 if subrepos or matchessubrepo(subpath):
2346 if subrepos or matchessubrepo(subpath):
2347 sub = ctx.sub(subpath)
2347 sub = ctx.sub(subpath)
2348 try:
2348 try:
2349 submatch = matchmod.narrowmatcher(subpath, m)
2349 submatch = matchmod.narrowmatcher(subpath, m)
2350 if sub.printfiles(ui, submatch, fm, fmt, subrepos) == 0:
2350 recurse = m.exact(subpath) or subrepos
2351 if sub.printfiles(ui, submatch, fm, fmt, recurse) == 0:
2351 ret = 0
2352 ret = 0
2352 except error.LookupError:
2353 except error.LookupError:
2353 ui.status(_("skipping missing subrepository: %s\n")
2354 ui.status(_("skipping missing subrepository: %s\n")
@@ -297,6 +297,12 b' Files sees uncommitted adds and removes '
297 sub1/sub2/folder/bar (glob)
297 sub1/sub2/folder/bar (glob)
298 sub1/sub2/x.txt (glob)
298 sub1/sub2/x.txt (glob)
299
299
300 $ hg files
301 .hgsub
302 .hgsubstate
303 foo/bar/abc (glob)
304 main
305
300 $ hg files -S -r '.^' sub1/sub2/folder
306 $ hg files -S -r '.^' sub1/sub2/folder
301 sub1/sub2/folder/test.txt (glob)
307 sub1/sub2/folder/test.txt (glob)
302
308
General Comments 0
You need to be logged in to leave comments. Login now