[Svnmerge] Running svnmerge in a subprocess

Giovanni Bajo rasky at develer.com
Thu Aug 28 11:42:56 PDT 2008


On 8/21/2008 1:33 PM, Simon Brunning wrote:
> 2008/8/19 Dustin J. Mitchell <dustin at zmanda.com>:
>> On Tue, Aug 19, 2008 at 10:29 AM, Simon Brunning
>> <simon at brunningonline.net> wrote:
>>> I've had trouble running svnmerge programmatically via another Python
>>> script. I've tried both popen2.popen4() and the subcomand module, but
>>> both give me "stty: stdin isn't a terminal".
>> BTW: please attach patches as plain text.
> 
> Patch in plain text as requested:
> Index: svnmerge.py
> ===================================================================
> --- svnmerge.py	(revision 32538)
> +++ svnmerge.py	(working copy)
> @@ -191,10 +191,11 @@
>          pass
> 
>      # Parse the output of stty -a
> -    out = os.popen("stty -a").read()
> -    m = re.search(r"columns (\d+);", out)
> -    if m:
> -        return int(m.group(1))
> +    if os.isatty(1):
> +        out = os.popen("stty -a").read()
> +        m = re.search(r"columns (\d+);", out)
> +        if m:
> +            return int(m.group(1))
> 
>      # sensible default
>      return 80

Patch is obviously OK.
-- 
Giovanni Bajo
Develer S.r.l.
http://www.develer.com



More information about the Svnmerge mailing list