changeset 507:4ce09bf4d382

wrappers: wrap version with a --svn flag
author Augie Fackler <durin42@gmail.com>
date Mon, 14 Dec 2009 09:35:04 -0600
parents b5f24dd948af
children e5dedda7bee0
files hgsubversion/__init__.py hgsubversion/wrappers.py
diffstat 2 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/hgsubversion/__init__.py
+++ b/hgsubversion/__init__.py
@@ -62,6 +62,8 @@ wrapcmds = { # cmd: generic, target, fix
     'pull': (True, 'sources', True, True, []),
     'push': (True, 'destinations', True, True, []),
     'incoming': (False, 'sources', True, True, []),
+    'version': (False, None, False, False, [
+        ('', 'svn', None, 'print hgsubversion information as well')]),
     'clone': (False, 'sources', True, True, [
         ('T', 'tagpaths', '',
          'list of paths to search for tags in Subversion repositories'),
--- a/hgsubversion/wrappers.py
+++ b/hgsubversion/wrappers.py
@@ -29,6 +29,15 @@ revmeta = [
     ('message', 'message'),
 ]
 
+
+def version(orig, ui, *args, **opts):
+    svn = opts.pop('svn', None)
+    orig(ui, *args, **opts)
+    if svn:
+        ui.status('\nsvn bindings: %s\n' % svnwrap.version())
+        ui.status('hgsubversion: %s\n' % util.version(ui))
+
+
 def parents(orig, ui, repo, *args, **opts):
     """show Mercurial & Subversion parents of the working dir or revision
     """