mercurial/cmdutil.py
changeset 10344 9501cde4c034
parent 10282 08a0f04b56bd
child 10401 6252852b4332
--- a/mercurial/cmdutil.py	Sat Feb 06 17:31:54 2010 +0100
+++ b/mercurial/cmdutil.py	Sat Feb 06 16:50:00 2010 +0100
@@ -584,9 +584,11 @@
                 elif runargs[i].startswith('--cwd'):
                     del runargs[i:i + 2]
                     break
-            pid = util.spawndetached(runargs)
-            while os.path.exists(lockpath):
-                time.sleep(0.1)
+            def condfn():
+                return not os.path.exists(lockpath)
+            pid = util.rundetached(runargs, condfn)
+            if pid < 0:
+                raise util.Abort(_('child process failed to start'))
         finally:
             try:
                 os.unlink(lockpath)