Mercurial > public > mercurial-scm > hg
comparison mercurial/posix.py @ 11011:648130161e4d
Merge with crew-stable
author | Patrick Mezard <pmezard@gmail.com> |
---|---|
date | Mon, 26 Apr 2010 22:42:46 +0200 |
parents | ab3782458827 18e81d42ee5c |
children | 99eee847beaa |
comparison
equal
deleted
inserted
replaced
11009:4d3288197717 | 11011:648130161e4d |
---|---|
263 return os.spawnvp(os.P_NOWAIT | getattr(os, 'P_DETACH', 0), | 263 return os.spawnvp(os.P_NOWAIT | getattr(os, 'P_DETACH', 0), |
264 args[0], args) | 264 args[0], args) |
265 | 265 |
266 def gethgcmd(): | 266 def gethgcmd(): |
267 return sys.argv[:1] | 267 return sys.argv[:1] |
268 | |
269 def termwidth_(): | |
270 try: | |
271 import termios, array, fcntl | |
272 for dev in (sys.stderr, sys.stdout, sys.stdin): | |
273 try: | |
274 try: | |
275 fd = dev.fileno() | |
276 except AttributeError: | |
277 continue | |
278 if not os.isatty(fd): | |
279 continue | |
280 arri = fcntl.ioctl(fd, termios.TIOCGWINSZ, '\0' * 8) | |
281 return array.array('h', arri)[1] | |
282 except ValueError: | |
283 pass | |
284 except IOError, e: | |
285 if e[0] == errno.EINVAL: | |
286 pass | |
287 else: | |
288 raise | |
289 except ImportError: | |
290 pass | |
291 return 80 |