[PATCH 6 of 6 V3] util.system: rename to rawsystem in favor of ui.system()

Pierre-Yves David pierre-yves.david at ens-lyon.org
Wed Nov 12 11:56:26 CST 2014



On 11/12/2014 02:38 PM, Yuya Nishihara wrote:
> # HG changeset patch
> # User Yuya Nishihara <yuya at tcha.org>
> # Date 1415799589 -32400
> #      Wed Nov 12 22:39:49 2014 +0900
> # Node ID 18c87a673070fbce78849c3beced2b9d14835abe
> # Parent  b6944cd4197b1bb1d1fd9e2d6f94453d297c3f03
> util.system: rename to rawsystem in favor of ui.system()
>
> This forces third-party extensions to migrate to ui.system(). util.rawsystem()
> is unsafe in command server.

So this needs an (API) flag to be properly included in  3.3 changelog.

> -def system(cmd, environ={}, cwd=None, onerr=None, errprefix=None, out=None):
> +def rawsystem(cmd, environ={}, cwd=None, onerr=None, errprefix=None, out=None):
>       '''enhanced shell command execution.
>       run with environment maybe modified, maybe in different dir.
>
> @@ -623,7 +623,10 @@ def system(cmd, environ={}, cwd=None, on
>       object as exception.
>
>       if out is specified, it is assumed to be a file-like object that has a
> -    write() method. stdout and stderr will be redirected to out.'''
> +    write() method. stdout and stderr will be redirected to out.
> +
> +    use ui.system() unless you want to redirect output to the specified file.
> +    '''

Can we make a reference to ui.system here? This is probably a layer 
violation but this would clarify thing a alot.


-- 
Pierre-Yves David


More information about the Mercurial-devel mailing list