Mercurial > public > mercurial-scm > hg
diff mercurial/debugcommands.py @ 30959:bd5694ce8beb
debugcommands: move 'debugwireargs' in the new module
author | Pierre-Yves David <pierre-yves.david@ens-lyon.org> |
---|---|
date | Thu, 02 Feb 2017 10:07:53 +0100 |
parents | df73368c87c3 |
children | d194f0dba7ac |
line wrap: on
line diff
--- a/mercurial/debugcommands.py Thu Feb 02 10:07:28 2017 +0100 +++ b/mercurial/debugcommands.py Thu Feb 02 10:07:53 2017 +0100 @@ -2043,3 +2043,25 @@ 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'), + ('', 'five', '', 'five'), + ] + commands.remoteopts, + _('REPO [OPTIONS]... [ONE [TWO]]'), + norepo=True) +def debugwireargs(ui, repopath, *vals, **opts): + repo = hg.peer(ui, opts, repopath) + for opt in commands.remoteopts: + del opts[opt[1]] + args = {} + for k, v in opts.iteritems(): + if v: + args[k] = v + # run twice to check that we don't mess up the stream for the next command + res1 = repo.debugwireargs(*vals, **args) + res2 = repo.debugwireargs(*vals, **args) + ui.write("%s\n" % res1) + if res1 != res2: + ui.warn("%s\n" % res2)