Touch the cache if it does not exist to prevent multiple forks.
author |
Steve Losh <steve@stevelosh.com> |
date |
Tue, 14 Jul 2009 22:27:36 -0400 |
parents |
7a87d26c99ac
|
children |
64bc932ebad4
|
branches/tags |
(none) |
files |
prompt.py |
Changes
--- a/prompt.py Tue Jul 14 22:24:27 2009 -0400
+++ b/prompt.py Tue Jul 14 22:27:36 2009 -0400
@@ -119,6 +119,8 @@
cache_time = (datetime.fromtimestamp(os.stat(cache).st_mtime)
if cache_exists else None)
if not cache_exists or cache_time < datetime.now() - CACHE_TIMEOUT:
+ if not cache_exists:
+ open(cache, 'w').close()
subprocess.Popen(['hg', 'prompt', '--cache-%s' % kind])
if cache_exists: