comparison utility_commands.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 a3b717e4abf5
children 04800fda7af5
comparison
equal deleted inserted replaced
114:3c5c2683eebb 115:ed42f6e5705a
6 import util 6 import util
7 import hg_delta_editor 7 import hg_delta_editor
8 8
9 @util.register_subcommand('url') 9 @util.register_subcommand('url')
10 def print_wc_url(ui, repo, hg_repo_path, **opts): 10 def print_wc_url(ui, repo, hg_repo_path, **opts):
11 """Url of Subversion repository
12 """
11 hge = hg_delta_editor.HgChangeReceiver(hg_repo_path, 13 hge = hg_delta_editor.HgChangeReceiver(hg_repo_path,
12 ui_=ui) 14 ui_=ui)
13 ui.status(hge.url, '\n') 15 ui.status(hge.url, '\n')
14 16
15 17
16 @util.register_subcommand('info') 18 @util.register_subcommand('info')
17 def run_svn_info(ui, repo, hg_repo_path, **opts): 19 def run_svn_info(ui, repo, hg_repo_path, **opts):
20 """Like svn info details
21 """
18 hge = hg_delta_editor.HgChangeReceiver(hg_repo_path, 22 hge = hg_delta_editor.HgChangeReceiver(hg_repo_path,
19 ui_=ui) 23 ui_=ui)
20 svn_commit_hashes = dict(zip(hge.revmap.itervalues(), 24 svn_commit_hashes = dict(zip(hge.revmap.itervalues(),
21 hge.revmap.iterkeys())) 25 hge.revmap.iterkeys()))
22 o_r = util.outgoing_revisions(ui, repo, hge, svn_commit_hashes) 26 o_r = util.outgoing_revisions(ui, repo, hge, svn_commit_hashes)
52 }) 56 })
53 57
54 58
55 @util.register_subcommand('parent') 59 @util.register_subcommand('parent')
56 def print_parent_revision(ui, repo, hg_repo_path, **opts): 60 def print_parent_revision(ui, repo, hg_repo_path, **opts):
57 """Prints the hg hash and svn revision info for the nearest svn parent of 61 """Display hg hash and svn revision of nearest svn parent
58 the current revision""" 62 """
59 hge = hg_delta_editor.HgChangeReceiver(hg_repo_path, 63 hge = hg_delta_editor.HgChangeReceiver(hg_repo_path,
60 ui_=ui) 64 ui_=ui)
61 svn_commit_hashes = dict(zip(hge.revmap.itervalues(), 65 svn_commit_hashes = dict(zip(hge.revmap.itervalues(),
62 hge.revmap.iterkeys())) 66 hge.revmap.iterkeys()))
63 ha = repo.parents()[0] 67 ha = repo.parents()[0]
73 return 0 77 return 0
74 78
75 79
76 @util.register_subcommand('rebase') 80 @util.register_subcommand('rebase')
77 def rebase_commits(ui, repo, hg_repo_path, **opts): 81 def rebase_commits(ui, repo, hg_repo_path, **opts):
78 """Rebases the current unpushed revisions onto the top of the Subversion branch. 82 """Rebases current unpushed revisions onto Subversion head
79 83
80 This moves a line of development from making its own head to the top of 84 This moves a line of development from making its own head to the top of
81 Subversion development, linearizing the changes. In order to make sure you 85 Subversion development, linearizing the changes. In order to make sure you
82 rebase on top of the current top of Subversion work, you should probably run 86 rebase on top of the current top of Subversion work, you should probably run
83 'hg svn pull' before running this. 87 'hg svn pull' before running this.