# HG changeset patch # User Dan Villiom Podlaski Christiansen # Date 1242726229 -7200 # Node ID 88ba55ad58c045d474be2437a6b8608eb2911eba # Parent 13998e698d3e1433f6e13a790e94317372a5c894 Minor tweaks to wrapper documentation. diff --git a/.hgignore b/.hgignore --- a/.hgignore +++ b/.hgignore @@ -1,4 +1,5 @@ syntax:glob +build *.pyc *.pyo .DS_Store diff --git a/hgsubversion/__init__.py b/hgsubversion/__init__.py --- 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) diff --git a/hgsubversion/svnexternals.py b/hgsubversion/svnexternals.py --- 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 diff --git a/tests/test_push_command.py b/tests/test_push_command.py --- 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