# HG changeset patch # User Pierre-Yves David <pierre-yves.da...@ens-lyon.org> # Date 1486026448 -3600 # Thu Feb 02 10:07:28 2017 +0100 # Node ID f70dc1564b6aa8c49cd0e272f0e40286f59435cc # Parent ef9523dc7f1857d439da0de657ff0ef5c49acb60 # EXP-Topic debugcommands debugcommands: move 'debugwalk' in the new module
diff -r ef9523dc7f18 -r f70dc1564b6a mercurial/commands.py --- a/mercurial/commands.py Thu Feb 02 10:06:01 2017 +0100 +++ b/mercurial/commands.py Thu Feb 02 10:07:28 2017 +0100 @@ -1852,24 +1852,6 @@ def copy(ui, repo, *pats, **opts): with repo.wlock(False): return cmdutil.copy(ui, repo, pats, opts) - -@command('debugwalk', walkopts, _('[OPTION]... [FILE]...'), inferrepo=True) -def debugwalk(ui, repo, *pats, **opts): - """show how files match on given patterns""" - m = scmutil.match(repo[None], pats, opts) - items = list(repo.walk(m)) - if not items: - return - f = lambda fn: fn - if ui.configbool('ui', 'slash') and pycompat.ossep != '/': - f = lambda fn: util.normpath(fn) - fmt = 'f %%-%ds %%-%ds %%s' % ( - max([len(abs) for abs in items]), - max([len(m.rel(abs)) for abs in items])) - for abs in items: - line = fmt % (abs, f(m.rel(abs)), m.exact(abs) and 'exact' or '') - ui.write("%s\n" % line.rstrip()) - @command('debugwireargs', [('', 'three', '', 'three'), ('', 'four', '', 'four'), diff -r ef9523dc7f18 -r f70dc1564b6a mercurial/debugcommands.py --- a/mercurial/debugcommands.py Thu Feb 02 10:06:01 2017 +0100 +++ b/mercurial/debugcommands.py Thu Feb 02 10:07:28 2017 +0100 @@ -2025,3 +2025,21 @@ def debugupgraderepo(ui, repo, run=False unable to access the repository should be low. """ return repair.upgraderepo(ui, repo, run=run, optimize=optimize) + +@command('debugwalk', commands.walkopts, _('[OPTION]... [FILE]...'), + inferrepo=True) +def debugwalk(ui, repo, *pats, **opts): + """show how files match on given patterns""" + m = scmutil.match(repo[None], pats, opts) + items = list(repo.walk(m)) + if not items: + return + f = lambda fn: fn + if ui.configbool('ui', 'slash') and pycompat.ossep != '/': + f = lambda fn: util.normpath(fn) + fmt = 'f %%-%ds %%-%ds %%s' % ( + max([len(abs) for abs in items]), + max([len(m.rel(abs)) for abs in items])) + for abs in items: + line = fmt % (abs, f(m.rel(abs)), m.exact(abs) and 'exact' or '') + ui.write("%s\n" % line.rstrip()) _______________________________________________ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel