comparison mercurial/cmdutil.py @ 25228:63a57a2727b6

files: recurse into subrepos automatically with an explicit path
author Matt Harbison <matt_harbison@yahoo.com>
date Sun, 17 May 2015 22:42:47 -0400
parents 7855d1f5f152
children 5a8398b085ed
comparison
equal deleted inserted replaced
25227:fd0f919170d2 25228:63a57a2727b6
2295 fm.write('size flags', '% 10d % 1s ', fc.size(), fc.flags()) 2295 fm.write('size flags', '% 10d % 1s ', fc.size(), fc.flags())
2296 fm.data(abspath=f) 2296 fm.data(abspath=f)
2297 fm.write('path', fmt, m.rel(f)) 2297 fm.write('path', fmt, m.rel(f))
2298 ret = 0 2298 ret = 0
2299 2299
2300 if subrepos: 2300 for subpath in sorted(ctx.substate):
2301 for subpath in sorted(ctx.substate): 2301 def matchessubrepo(subpath):
2302 return (m.always() or m.exact(subpath)
2303 or any(f.startswith(subpath + '/') for f in m.files()))
2304
2305 if subrepos or matchessubrepo(subpath):
2302 sub = ctx.sub(subpath) 2306 sub = ctx.sub(subpath)
2303 try: 2307 try:
2304 submatch = matchmod.narrowmatcher(subpath, m) 2308 submatch = matchmod.narrowmatcher(subpath, m)
2305 if sub.printfiles(ui, submatch, fm, fmt) == 0: 2309 if sub.printfiles(ui, submatch, fm, fmt, subrepos) == 0:
2306 ret = 0 2310 ret = 0
2307 except error.LookupError: 2311 except error.LookupError:
2308 ui.status(_("skipping missing subrepository: %s\n") 2312 ui.status(_("skipping missing subrepository: %s\n")
2309 % m.abs(subpath)) 2313 % m.abs(subpath))
2310 2314