Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/debugcommands.py @ 38274:7c3a59e2971b
debugwalk: show matcher output only if -v/--verbose
And drop "egrep -v". This matches the behavior of "hg debugrevspec".
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 10 Jun 2018 11:53:56 +0900 |
parents | f3033692ccef |
children | dbf31732ef64 |
comparison
equal
deleted
inserted
replaced
38273:f3033692ccef | 38274:7c3a59e2971b |
---|---|
2540 inferrepo=True) | 2540 inferrepo=True) |
2541 def debugwalk(ui, repo, *pats, **opts): | 2541 def debugwalk(ui, repo, *pats, **opts): |
2542 """show how files match on given patterns""" | 2542 """show how files match on given patterns""" |
2543 opts = pycompat.byteskwargs(opts) | 2543 opts = pycompat.byteskwargs(opts) |
2544 m = scmutil.match(repo[None], pats, opts) | 2544 m = scmutil.match(repo[None], pats, opts) |
2545 ui.write(('matcher: %r\n' % m)) | 2545 if ui.verbose: |
2546 ui.write(('matcher: %r\n' % m)) | |
2546 items = list(repo[None].walk(m)) | 2547 items = list(repo[None].walk(m)) |
2547 if not items: | 2548 if not items: |
2548 return | 2549 return |
2549 f = lambda fn: fn | 2550 f = lambda fn: fn |
2550 if ui.configbool('ui', 'slash') and pycompat.ossep != '/': | 2551 if ui.configbool('ui', 'slash') and pycompat.ossep != '/': |