Doh. Don't ask me why I committed a patch for someone who has commit
access.
cmpilato@tigris.org writes:
> Author: cmpilato
> Date: 2002-02-05 18:30 GMT
> New Revision: 1189
>
> Modified:
> trunk/subversion/include/svn_io.h
> trunk/subversion/libsvn_repos/hooks.c
> trunk/subversion/libsvn_subr/io.c
> trunk/subversion/libsvn_wc/log.c
> Log:
> Optionally inherit the environment when running external programs.
> Patch by Daniel Stenberg <daniel@haxx.se>.
>
> * subversion/include/svn_io.h
>
> (svn_io_run_cmd): Added inherit argument.
>
> * subversion/libsvn_repos/hooks.c
>
> (run_cmd_with_output): Modified svn_io_run_cmd() call.
>
> * subversion/libsvn_subr/io.c
>
> (svn_io_run_cmd): Take one more argument to specify whether the
> command to run should inherit our environment or not.
>
> (svn_io_run_diff): Invoke svn_io_run_cmd() with the new argument.
>
> * subversion/libsvn_wc/log.c
>
> (log_do_run_cmd): Invoke svn_io_run_cmd() with the new argument.
>
>
> Modified: trunk/subversion/include/svn_io.h
> ==============================================================================
> --- OLD/trunk/subversion/include/svn_io.h Tue Feb 5 12:30:59 2002
> +++ NEW/trunk/subversion/include/svn_io.h Tue Feb 5 12:30:59 2002
> @@ -301,12 +301,16 @@
> EXITWHY will indicate why the process terminated.
>
> ARGS is a list of (const char *)'s, terminated by NULL. ARGS[0] is
> - the name of the program, though it need not be the same as CMD. */
> + the name of the program, though it need not be the same as CMD.
> +
> + INHERIT sets whether the invoked program shall inherit its environment or
> + run "clean". */
> svn_error_t *svn_io_run_cmd (const char *path,
> const char *cmd,
> const char *const *args,
> int *exitcode,
> apr_exit_why_e *exitwhy,
> + svn_boolean_t inherit,
> apr_file_t *infile,
> apr_file_t *outfile,
> apr_file_t *errfile,
>
> Modified: trunk/subversion/libsvn_wc/log.c
> ==============================================================================
> --- OLD/trunk/subversion/libsvn_wc/log.c Tue Feb 5 12:30:59 2002
> +++ NEW/trunk/subversion/libsvn_wc/log.c Tue Feb 5 12:30:59 2002
> @@ -304,7 +304,7 @@
> "error opening %s", errfile_path->data);
> }
>
> - err = svn_io_run_cmd (loggy->path->data, name, args, NULL, NULL,
> + err = svn_io_run_cmd (loggy->path->data, name, args, NULL, NULL, FALSE,
> infile, outfile, errfile, loggy->pool);
> if (err)
> return svn_error_createf (SVN_ERR_WC_BAD_ADM_LOG, 0, NULL, loggy->pool,
>
> Modified: trunk/subversion/libsvn_subr/io.c
> ==============================================================================
> --- OLD/trunk/subversion/libsvn_subr/io.c Tue Feb 5 12:30:59 2002
> +++ NEW/trunk/subversion/libsvn_subr/io.c Tue Feb 5 12:30:59 2002
> @@ -910,6 +910,9 @@
> * ARGS is a list of (const char *)'s, terminated by NULL.
> * ARGS[0] is the name of the program, though it need not be the same
> * as CMD.
> + *
> + * INHERIT sets whether the invoked program shall inherit its environment or
> + * run "clean".
> */
> svn_error_t *
> svn_io_run_cmd (const char *path,
> @@ -917,6 +920,7 @@
> const char *const *args,
> int *exitcode,
> apr_exit_why_e *exitwhy,
> + svn_boolean_t inherit,
> apr_file_t *infile,
> apr_file_t *outfile,
> apr_file_t *errfile,
> @@ -935,7 +939,8 @@
> cmd);
>
> /* Make sure we invoke cmd directly, not through a shell. */
> - apr_err = apr_procattr_cmdtype_set (cmdproc_attr, APR_PROGRAM);
> + apr_err = apr_procattr_cmdtype_set (cmdproc_attr,
> + inherit?APR_PROGRAM_PATH:APR_PROGRAM);
> if (! APR_STATUS_IS_SUCCESS (apr_err))
> return svn_error_createf
> (apr_err, 0, NULL, pool,
> @@ -1062,8 +1067,8 @@
>
> assert (i == nargs);
>
> - SVN_ERR(svn_io_run_cmd (dir, SVN_CLIENT_DIFF, args, pexitcode, NULL, NULL,
> - outfile, errfile, subpool));
> + SVN_ERR (svn_io_run_cmd (dir, SVN_CLIENT_DIFF, args, pexitcode, NULL, FALSE,
> + NULL, outfile, errfile, subpool));
>
> if (*pexitcode < 0 || *pexitcode > 2)
> return svn_error_createf (SVN_ERR_EXTERNAL_PROGRAM, 0, NULL, subpool,
>
> Modified: trunk/subversion/libsvn_repos/hooks.c
> ==============================================================================
> --- OLD/trunk/subversion/libsvn_repos/hooks.c Tue Feb 5 12:30:59 2002
> +++ NEW/trunk/subversion/libsvn_repos/hooks.c Tue Feb 5 12:30:59 2002
> @@ -59,8 +59,8 @@
> (apr_err, 0, NULL, pool,
> "run_cmd_with_output: can't open handle to stderr");
>
> - return svn_io_run_cmd (".", cmd, args, exitcode, exitwhy, NULL, outhandle,
> - errhandle, pool);
> + return svn_io_run_cmd (".", cmd, args, exitcode, exitwhy, FALSE,
> + NULL, outhandle, errhandle, pool);
> }
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: svn-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: svn-help@subversion.tigris.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:37:04 2006