Show More
@@ -448,6 +448,39 b' class SvnRemote(object):' | |||||
448 | return False |
|
448 | return False | |
449 |
|
449 | |||
450 | @reraise_safe_exceptions |
|
450 | @reraise_safe_exceptions | |
|
451 | def run_svn_command(self, wire, cmd, **opts): | |||
|
452 | path = wire.get('path', None) | |||
|
453 | ||||
|
454 | if path and os.path.isdir(path): | |||
|
455 | opts['cwd'] = path | |||
|
456 | ||||
|
457 | safe_call = False | |||
|
458 | if '_safe' in opts: | |||
|
459 | safe_call = True | |||
|
460 | ||||
|
461 | svnenv = os.environ.copy() | |||
|
462 | svnenv.update(opts.pop('extra_env', {})) | |||
|
463 | ||||
|
464 | _opts = {'env': svnenv, 'shell': False} | |||
|
465 | ||||
|
466 | try: | |||
|
467 | _opts.update(opts) | |||
|
468 | p = subprocessio.SubprocessIOChunker(cmd, **_opts) | |||
|
469 | ||||
|
470 | return ''.join(p), ''.join(p.error) | |||
|
471 | except (EnvironmentError, OSError) as err: | |||
|
472 | cmd = ' '.join(cmd) # human friendly CMD | |||
|
473 | tb_err = ("Couldn't run svn command (%s).\n" | |||
|
474 | "Original error was:%s\n" | |||
|
475 | "Call options:%s\n" | |||
|
476 | % (cmd, err, _opts)) | |||
|
477 | log.exception(tb_err) | |||
|
478 | if safe_call: | |||
|
479 | return '', err | |||
|
480 | else: | |||
|
481 | raise exceptions.VcsException()(tb_err) | |||
|
482 | ||||
|
483 | @reraise_safe_exceptions | |||
451 | def install_hooks(self, wire, force=False): |
|
484 | def install_hooks(self, wire, force=False): | |
452 | from vcsserver.hook_utils import install_svn_hooks |
|
485 | from vcsserver.hook_utils import install_svn_hooks | |
453 | repo_path = wire['path'] |
|
486 | repo_path = wire['path'] |
General Comments 0
You need to be logged in to leave comments.
Login now