# HG changeset patch # User Steve Losh # Date 1247625776 14400 # Node ID 64bc932ebad4881d426c34939f8d5ee5843352b1 # Parent 8d824dee6437cb2e9188aeded305ce029c070fe7 Redirect the subprocess' output to /dev/null in a filthy, filthy way. diff -r 8d824dee6437 -r 64bc932ebad4 prompt.py --- a/prompt.py Tue Jul 14 22:27:36 2009 -0400 +++ b/prompt.py Tue Jul 14 22:42:56 2009 -0400 @@ -13,15 +13,19 @@ import subprocess from datetime import datetime, timedelta from os import path -from mercurial import extensions, hg, cmdutil +from mercurial import extensions CACHE_PATH = ".hg/prompt/cache" -CACHE_TIMEOUT = timedelta(minutes=10) +CACHE_TIMEOUT = timedelta(minutes=15) def _cache_remote(repo, kind): cache = path.join(repo.root, CACHE_PATH, kind) c_tmp = cache + '.temp' - subprocess.call(['hg', kind, '--quiet'], stdout=file(c_tmp, 'w')) + + # This is kind of a hack and I feel a little bit dirty for doing it. + IGNORE = open('NUL:','w') if subprocess.mswindows else open('/dev/null','w') + + subprocess.call(['hg', kind, '--quiet'], stdout=file(c_tmp, 'w'), stderr=IGNORE) os.rename(c_tmp, cache) return