comparison svncommand.py @ 115:ed42f6e5705a

Clean up help text, document subcommands.
author Luke Opperman <luke@loppear.com>
date Thu, 20 Nov 2008 22:03:30 -0600
parents 91ce18fa0375
children 291925677a9f
comparison
equal deleted inserted replaced
114:3c5c2683eebb 115:ed42f6e5705a
9 from mercurial import util as merc_util 9 from mercurial import util as merc_util
10 10
11 import svnwrap 11 import svnwrap
12 import hg_delta_editor 12 import hg_delta_editor
13 import util 13 import util
14 from util import register_subcommand, svn_subcommands 14 from util import register_subcommand, svn_subcommands, generate_help
15 # dirty trick to force demandimport to run my decorator anyway. 15 # dirty trick to force demandimport to run my decorator anyway.
16 from utility_commands import print_wc_url 16 from utility_commands import print_wc_url
17 from fetch_command import fetch_revisions 17 from fetch_command import fetch_revisions
18 from push_cmd import commit_from_rev 18 from push_cmd import commit_from_rev
19 from diff_cmd import diff_command 19 from diff_cmd import diff_command
51 if len(tb) == 1: 51 if len(tb) == 1:
52 ui.status('Unknown subcommand %s\n' % subcommand) 52 ui.status('Unknown subcommand %s\n' % subcommand)
53 else: 53 else:
54 raise 54 raise
55 55
56
56 @register_subcommand('help') 57 @register_subcommand('help')
57 def help_command(ui, args=None, **opts): 58 def help_command(ui, args=None, **opts):
58 """Get help on the subsubcommands. 59 """Get help on the subsubcommands.
59 """ 60 """
60 if args: 61 if args:
73 doc = svn_subcommands[subcommand].__doc__ 74 doc = svn_subcommands[subcommand].__doc__
74 if doc is None: 75 if doc is None:
75 doc = "No documentation available for %s." % subcommand 76 doc = "No documentation available for %s." % subcommand
76 ui.status(doc.strip(), '\n') 77 ui.status(doc.strip(), '\n')
77 return 78 return
78 ui.status('Valid commands: ', ' '.join(sorted(svn_subcommands.keys())), 79 ui.status(generate_help())
79 '\n') 80
80 81
81 @register_subcommand('gentags') 82 @register_subcommand('gentags')
82 def generate_hg_tags(ui, hg_repo_path, **opts): 83 def generate_hg_tags(ui, hg_repo_path, **opts):
83 """Save tags to .hg/localtags 84 """Save tags to .hg/localtags
84 """ 85 """
152 return 0 153 return 0
153 return 1 154 return 1
154 155
155 @register_subcommand('verify_all_revisions') 156 @register_subcommand('verify_all_revisions')
156 def verify_all_revisions(ui, args, repo, **opts): 157 def verify_all_revisions(ui, args, repo, **opts):
157 """Verify all the converted revisions, optionally starting at a revision. 158 """Verify all the converted revisions
159 optionally starting at a revision.
158 160
159 Note: This is *extremely* abusive of the Subversion server. It exports every 161 Note: This is *extremely* abusive of the Subversion server. It exports every
160 revision of the code one revision at a time. 162 revision of the code one revision at a time.
161 """ 163 """
162 assert repo.status(ignored=True, 164 assert repo.status(ignored=True,