[Svnmerge] Running svnmerge in a subprocess
Simon Brunning
simon at brunningonline.net
Thu Aug 21 04:33:21 PDT 2008
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
--
Cheers,
Simon B.
simon at brunningonline.net
http://www.brunningonline.net/simon/blog/
GTalk: simon.brunning | MSN: small_values | Yahoo: smallvalues | Twitter: brunns
More information about the Svnmerge
mailing list