changeset 3830:08d439bfbd8c beta

fixed handling shell argument in subprocess calls, it always was hardcoded even when passed properly in arguments
author Marcin Kuzminski <marcin@python-works.com>
date Thu, 09 May 2013 13:29:03 +0200
parents 5067d6e826a5
children bd39c1f70e35
files rhodecode/lib/vcs/backends/git/repository.py rhodecode/lib/vcs/subprocessio.py
diffstat 2 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/rhodecode/lib/vcs/backends/git/repository.py	Thu May 09 00:04:43 2013 +0200
+++ b/rhodecode/lib/vcs/backends/git/repository.py	Thu May 09 13:29:03 2013 +0200
@@ -125,10 +125,11 @@
         cmd = [_git_path] + _copts + cmd
         if _str_cmd:
             cmd = ' '.join(cmd)
+
         try:
             _opts = dict(
                 env=gitenv,
-                shell=False,
+                shell=True,
             )
             _opts.update(opts)
             p = subprocessio.SubprocessIOChunker(cmd, **_opts)
--- a/rhodecode/lib/vcs/subprocessio.py	Thu May 09 00:04:43 2013 +0200
+++ b/rhodecode/lib/vcs/subprocessio.py	Thu May 09 13:29:03 2013 +0200
@@ -342,10 +342,10 @@
             input_streamer.start()
             inputstream = input_streamer.output
 
+        _shell = kwargs.get('shell', True)
         if isinstance(cmd, (list, tuple)):
             cmd = ' '.join(cmd)
 
-        _shell = kwargs.get('shell') or True
         kwargs['shell'] = _shell
         _p = subprocess.Popen(cmd,
             bufsize=-1,
@@ -353,7 +353,7 @@
             stdout=subprocess.PIPE,
             stderr=subprocess.PIPE,
             **kwargs
-            )
+        )
 
         bg_out = BufferedGenerator(_p.stdout, buffer_size, chunk_size, starting_values)
         bg_err = BufferedGenerator(_p.stderr, 16000, 1, bottomless=True)