changeset 340:88ba55ad58c0

Minor tweaks to wrapper documentation.
author Dan Villiom Podlaski Christiansen <danchr@gmail.com>
date Tue, 19 May 2009 11:43:49 +0200
parents 13998e698d3e
children cfbd0e563af9
files .hgignore hgsubversion/__init__.py hgsubversion/svnexternals.py tests/test_push_command.py
diffstat 4 files changed, 20 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/.hgignore
+++ b/.hgignore
@@ -1,4 +1,5 @@
 syntax:glob
+build
 *.pyc
 *.pyo
 .DS_Store
--- a/hgsubversion/__init__.py
+++ b/hgsubversion/__init__.py
@@ -51,8 +51,9 @@ optionmap = {
 
 def wrapper(orig, ui, repo, *args, **opts):
     """
-    Subversion repositories are also supported for this command. See
-    `hg help %(extension)s` for details.
+    Some of the options listed below only apply to Subversion 
+    %(action)s. See 'hg help %(extension)s' for more information on 
+    them as well as other ways of customising the conversion process.
     """
     for opt, (section, name) in optionmap.iteritems():
         if opt in opts:
@@ -81,17 +82,19 @@ def uisetup(ui):
     entry[1].append(('', 'svn', None,
                      "show svn-style diffs, default against svn parent"))
 
-    newflags = (('A', 'authors', '', 'path to file containing username '
-                 'mappings for Subversion sources'),
-                ('', 'filemap', '', 'path to file containing rules for file '
-                 'name mapping used for sources)'),
+    newflags = (('A', 'authors', '', 'path to file mapping Subversion '
+                 'usernames to Mercurial authors.'),
+                ('', 'filemap', '', 'path to file containing rules for '
+                 'mapping Subversion repository paths.'),
                 ('T', 'tagpaths', ['tags'], 'list of paths to search for tags '
                  'in Subversion repositories.'))
-    extname = 'hgsubversion'
 
-    for command in ['clone']:
-        doc = wrapper.__doc__.strip() % { 'extension': extname }
-        getattr(commands, command).__doc__ += doc
+    for command, action in [('clone', 'sources'), ('pull', 'sources'),
+                            ('push', 'destinations')]:
+        doc = wrapper.__doc__.strip() % { 'extension': 'hgsubversion',
+                                          'action': action }
+        fn = getattr(commands, command)
+        fn.__doc__ = fn.__doc__.rstrip() + '\n\n    ' + doc
         entry = extensions.wrapcommand(commands.table, command, wrapper)
         entry[1].extend(newflags)
 
--- a/hgsubversion/svnexternals.py
+++ b/hgsubversion/svnexternals.py
@@ -242,8 +242,9 @@ class externalsupdater:
         args = ['svn'] + args
         self.ui.debug(_('updating externals: %r, cwd=%s\n') % (args, cwd))
         shell = os.name == 'nt'
-        if subprocess.call(args, cwd=cwd, shell=shell) != 0:
-            raise hgutil.Abort("subprocess '%s' failed" % ' '.join(args))
+        r = subprocess.call(args, cwd=cwd, shell=shell,
+                            stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+        if r != 0: raise hgutil.Abort("subprocess '%s' failed" % ' '.join(args))
 
 def updateexternals(ui, args, repo, **opts):
     """update repository externals
--- a/tests/test_push_command.py
+++ b/tests/test_push_command.py
@@ -60,7 +60,9 @@ class PushTests(test_util.TestBase):
                 '--listen-host=%s' % self.host,
                 '--root=%s' % self.repo_path]
 
-        self.svnserve_pid = subprocess.Popen(args).pid
+        svnserve = subprocess.Popen(args, stdout=subprocess.PIPE,
+                                    stderr=subprocess.STDOUT)
+        self.svnserve_pid = svnserve.pid
         try:
             time.sleep(2)
             import shutil