diff -r b8e3aeb7542c -r 9501cde4c034 mercurial/cmdutil.py --- 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)