[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] Allow testing of svn client exit codes

From: Stefan Sperling <stsp_at_elego.de>
Date: Sun, 24 Feb 2008 11:27:16 +0100

On Sat, Feb 23, 2008 at 11:24:08PM -0700, jeremy hinds wrote:
> I don't know if exit codes are as interesting for the other binaries,
> so this patch only deals with the client. And since I am still trying
> to familiarize myself with the conventions, and I'm no Python expert,
> please let me know what I can do to make this better.

I skimmed over it, some function arguments aren't aligned properly (see below).
This is only a stylistic issue obviously, I like the idea of your patch.

> @@ -193,7 +193,21 @@
> False)
> return out, err
>
> +def run_and_verify_svn_with_exit(message, expected_stdout, expected_stderr,
> + expected_exit, *varargs):

def run_and_verify_svn_with_exit(message, expected_stdout, expected_stderr,
                                 expected_exit, *varargs):

> @@ -312,6 +312,13 @@
> return run_command_stdin(command, error_expected, binary_mode,
> None, *varargs)
>
> +def run_command_2(command, error_expected, binary_mode=0, *varargs):
> + """Like run_command, but returning exit code, stdout, and stderr"""
> +
> + return run_command_stdin_2(command, error_expected, binary_mode,
> + None, *varargs)

return run_command_stdin_2(command, error_expected, binary_mode,
                           None, *varargs)

> + exit_code, stdout_lines, stderr_lines = run_command_stdin_2(command,
> + error_expected,
> + binary_mode,
> + stdin_lines,
> + *varargs);

exit_code, stdout_lines, stderr_lines = run_command_stdin_2(command,
                                                            error_expected,
                                                            binary_mode,
                                                            stdin_lines,
                                                            *varargs);

> + return stdout_lines, stderr_lines
> +
> +def run_command_stdin_2(command, error_expected, binary_mode=0,
> + stdin_lines=None, *varargs):

def run_command_stdin_2(command, error_expected, binary_mode=0,
                        stdin_lines=None, *varargs):

> @@ -493,6 +512,11 @@
> return run_command(svn_binary, error_expected, 0,
> *(_with_auth(_with_config_dir(varargs))))
>
> +def run_svn_2(error_expected, *varargs):
> + """Like run_svn, but also returns exit code."""
> + return run_command_2(svn_binary, error_expected, 0,
> + *(_with_auth(_with_config_dir(varargs))))

return run_command_2(svn_binary, error_expected, 0,
                     *(_with_auth(_with_config_dir(varargs))))

> @@ -324,3 +329,13 @@
> raisable = main.SVNLineUnequal
>
> compare_and_display_lines(message, label, expected, actual, raisable)
> +
> +def verify_exit_code(message, actual, expected,
> + raisable=SVNUnexpectedExitCode):

def verify_exit_code(message, actual, expected,
                     raisable=SVNUnexpectedExitCode):

-- 
Stefan Sperling <stsp_at_elego.de>                 Software Developer
elego Software Solutions GmbH                            HRB 77719
Gustav-Meyer-Allee 25, Gebaeude 12        Tel:  +49 30 23 45 86 96 
13355 Berlin                              Fax:  +49 30 23 45 86 95
http://www.elego.de                 Geschaeftsfuehrer: Olaf Wagner

  • application/pgp-signature attachment: stored
Received on 2008-02-24 11:27:31 CET

This is an archived mail posted to the Subversion Dev mailing list.