Mercurial > hgsubversion
comparison util.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 | 1da7aafdd323 |
children | 291925677a9f |
comparison
equal
deleted
inserted
replaced
114:3c5c2683eebb | 115:ed42f6e5705a |
---|---|
9 def register_subcommand(name): | 9 def register_subcommand(name): |
10 def inner(fn): | 10 def inner(fn): |
11 svn_subcommands[name] = fn | 11 svn_subcommands[name] = fn |
12 return fn | 12 return fn |
13 return inner | 13 return inner |
14 | |
15 | |
16 def generate_help(): | |
17 ret = ['', 'hg svn subcommand\n', 'Subcommands:\n'] | |
18 | |
19 for name, func in sorted(svn_subcommands.items()): | |
20 short_description = (func.__doc__ or '').split('\n')[0] | |
21 ret.append(" %-10s %s" % (name, short_description)) | |
22 | |
23 return "\n".join(ret) + '\n' | |
14 | 24 |
15 | 25 |
16 def wipe_all_files(hg_wc_path): | 26 def wipe_all_files(hg_wc_path): |
17 files = [f for f in os.listdir(hg_wc_path) if f != '.hg'] | 27 files = [f for f in os.listdir(hg_wc_path) if f != '.hg'] |
18 for f in files: | 28 for f in files: |