comparison utility_commands.py @ 196:77812f98e250

Add a naive hg svn version command that works as long as hgsubversion is run from a checkout.
author Augie Fackler <durin42@gmail.com>
date Tue, 10 Feb 2009 14:52:26 -0600
parents 57355b0e7bd1
children 91db8fc049b0
comparison
equal deleted inserted replaced
195:906d3f302b45 196:77812f98e250
1 import mercurial
1 from mercurial import cmdutil 2 from mercurial import cmdutil
2 from mercurial import node 3 from mercurial import node
3 from mercurial import util as mutil 4 from mercurial import util as mutil
4 from hgext import rebase 5 from hgext import rebase
5 6
7 import svnwrap
6 import util 8 import util
7 import hg_delta_editor 9 import hg_delta_editor
8 10
9 def print_wc_url(ui, repo, hg_repo_path, **opts): 11 def print_wc_url(ui, repo, hg_repo_path, **opts):
10 """show the location (URL) of the Subversion repository 12 """show the location (URL) of the Subversion repository
143 return 0 145 return 0
144 displayer = cmdutil.show_changeset(ui, repo, opts, buffered=False) 146 displayer = cmdutil.show_changeset(ui, repo, opts, buffered=False)
145 for node in reversed(o_r): 147 for node in reversed(o_r):
146 displayer.show(repo[node]) 148 displayer.show(repo[node])
147 show_outgoing_to_svn = util.register_subcommand('outgoing')(show_outgoing_to_svn) 149 show_outgoing_to_svn = util.register_subcommand('outgoing')(show_outgoing_to_svn)
150
151
152 def version(ui, **opts):
153 """Show current version of hg and hgsubversion.
154 """
155 ui.status('hg: %s\n' % mutil.version())
156 ui.status('svn bindings: %s\n' % svnwrap.version())
157 ui.status('hgsubversion: %s\n' % util.version(ui))
158 version = util.register_subcommand('version')(version)
159 version = util.command_needs_no_url(version)