Mercurial > hg-stable
changeset 30527:a8b17859684a
debugcommands: move 'debugextensions' to the new module
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Wed, 17 Aug 2016 20:57:15 -0700 |
parents | a3ec6db36315 |
children | 20a42325fdef |
files | mercurial/commands.py mercurial/debugcommands.py |
diffstat | 2 files changed, 47 insertions(+), 46 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/commands.py Wed Aug 17 20:56:11 2016 -0700 +++ b/mercurial/commands.py Wed Aug 17 20:57:15 2016 -0700 @@ -9,7 +9,6 @@ import difflib import errno -import operator import os import re import shlex @@ -1860,51 +1859,6 @@ with repo.wlock(False): return cmdutil.copy(ui, repo, pats, opts) -@command('debugextensions', formatteropts, [], norepo=True) -def debugextensions(ui, **opts): - '''show information about active extensions''' - exts = extensions.extensions(ui) - hgver = util.version() - fm = ui.formatter('debugextensions', opts) - for extname, extmod in sorted(exts, key=operator.itemgetter(0)): - isinternal = extensions.ismoduleinternal(extmod) - extsource = extmod.__file__ - if isinternal: - exttestedwith = [] # never expose magic string to users - else: - exttestedwith = getattr(extmod, 'testedwith', '').split() - extbuglink = getattr(extmod, 'buglink', None) - - fm.startitem() - - if ui.quiet or ui.verbose: - fm.write('name', '%s\n', extname) - else: - fm.write('name', '%s', extname) - if isinternal or hgver in exttestedwith: - fm.plain('\n') - elif not exttestedwith: - fm.plain(_(' (untested!)\n')) - else: - lasttestedversion = exttestedwith[-1] - fm.plain(' (%s!)\n' % lasttestedversion) - - fm.condwrite(ui.verbose and extsource, 'source', - _(' location: %s\n'), extsource or "") - - if ui.verbose: - fm.plain(_(' bundled: %s\n') % ['no', 'yes'][isinternal]) - fm.data(bundled=isinternal) - - fm.condwrite(ui.verbose and exttestedwith, 'testedwith', - _(' tested with: %s\n'), - fm.formatlist(exttestedwith, name='ver')) - - fm.condwrite(ui.verbose and extbuglink, 'buglink', - _(' bug reporting: %s\n'), extbuglink or "") - - fm.end() - @command('debugfileset', [('r', 'rev', '', _('apply the filespec on this revision'), _('REV'))], _('[-r REV] FILESPEC'))
--- a/mercurial/debugcommands.py Wed Aug 17 20:56:11 2016 -0700 +++ b/mercurial/debugcommands.py Wed Aug 17 20:57:15 2016 -0700 @@ -7,6 +7,7 @@ from __future__ import absolute_import +import operator import os import random @@ -25,6 +26,7 @@ dagutil, error, exchange, + extensions, hg, localrepo, lock as lockmod, @@ -523,3 +525,48 @@ opts.get('remote_head')) localrevs = opts.get('local_head') doit(localrevs, remoterevs) + +@command('debugextensions', commands.formatteropts, [], norepo=True) +def debugextensions(ui, **opts): + '''show information about active extensions''' + exts = extensions.extensions(ui) + hgver = util.version() + fm = ui.formatter('debugextensions', opts) + for extname, extmod in sorted(exts, key=operator.itemgetter(0)): + isinternal = extensions.ismoduleinternal(extmod) + extsource = extmod.__file__ + if isinternal: + exttestedwith = [] # never expose magic string to users + else: + exttestedwith = getattr(extmod, 'testedwith', '').split() + extbuglink = getattr(extmod, 'buglink', None) + + fm.startitem() + + if ui.quiet or ui.verbose: + fm.write('name', '%s\n', extname) + else: + fm.write('name', '%s', extname) + if isinternal or hgver in exttestedwith: + fm.plain('\n') + elif not exttestedwith: + fm.plain(_(' (untested!)\n')) + else: + lasttestedversion = exttestedwith[-1] + fm.plain(' (%s!)\n' % lasttestedversion) + + fm.condwrite(ui.verbose and extsource, 'source', + _(' location: %s\n'), extsource or "") + + if ui.verbose: + fm.plain(_(' bundled: %s\n') % ['no', 'yes'][isinternal]) + fm.data(bundled=isinternal) + + fm.condwrite(ui.verbose and exttestedwith, 'testedwith', + _(' tested with: %s\n'), + fm.formatlist(exttestedwith, name='ver')) + + fm.condwrite(ui.verbose and extbuglink, 'buglink', + _(' bug reporting: %s\n'), extbuglink or "") + + fm.end()