Mercurial > hgsubversion
changeset 598:e432b61c6d74
Use Mercurial-provided infrastructure for `svn' metacommand help.
author | Dan Villiom Podlaski Christiansen <danchr@gmail.com> |
---|---|
date | Wed, 31 Mar 2010 17:54:08 +0200 |
parents | 737292a31028 |
children | 408869906fbf |
files | hgsubversion/__init__.py hgsubversion/svncommands.py |
diffstat | 2 files changed, 6 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/hgsubversion/__init__.py +++ b/hgsubversion/__init__.py @@ -144,6 +144,7 @@ def svn(ui, repo, subcommand, *args, **o ui.status('Unknown subcommand %s\n' % subcommand) else: raise +svn.__doc__ = svncommands._helpgen() def reposetup(ui, repo): if repo.local(): @@ -176,7 +177,7 @@ cmdtable = { ('', 'password', '', 'password for authentication'), ('r', 'rev', '', 'Mercurial revision'), ], - svncommands._helpgen(), + 'hg svn <subcommand> ...', ), }
--- a/hgsubversion/svncommands.py +++ b/hgsubversion/svncommands.py @@ -2,6 +2,7 @@ import os import posixpath import cPickle as pickle +from mercurial import commands from mercurial import hg from mercurial import node from mercurial import util as hgutil @@ -248,7 +249,7 @@ def help_(ui, args=None, **opts): doc = "No documentation available for %s." % subcommand ui.status(doc.strip(), '\n') return - ui.status(_helpgen()) + commands.help_(ui, 'svn') def update(ui, args, repo, clean=False, **opts): @@ -386,15 +387,14 @@ def listauthors(ui, args, authors=None, def _helpgen(): - ret = ['hg svn ...', '', - 'subcommands for Subversion integration', '', + ret = ['subcommands for Subversion integration', '', 'list of subcommands:', ''] for name, func in sorted(table.items()): if func.__doc__: short_description = func.__doc__.splitlines()[0] else: short_description = '' - ret.append(" %-10s %s" % (name, short_description)) + ret.append(" :%s: %s" % (name, short_description)) return '\n'.join(ret) + '\n'