mirror of
https://github.com/facebook/sapling.git
synced 2024-10-06 23:07:18 +03:00
ab3a7cb21f
Summary: In preparation for merging fb-mercurial sources to the Eden repository, move everything from the top-level directory into an `eden/scm` subdirectory.
23 lines
612 B
Python
23 lines
612 B
Python
import os
|
|
import random
|
|
import sys
|
|
import time
|
|
|
|
|
|
def waithook(ui, repo, **kwargs):
|
|
"""This hook is used to block pushes in some pushrebase tests
|
|
|
|
It spins until `.hg/flag` exists
|
|
"""
|
|
start = time.time()
|
|
repo._wlockfreeprefix.add("hookrunning")
|
|
repo.localvfs.write("hookrunning", "")
|
|
while not repo.localvfs.exists("flag"):
|
|
if time.time() - start > 20:
|
|
print >>sys.stderr, "ERROR: Timeout waiting for .hg/flag"
|
|
repo.localvfs.unlink("hookrunning")
|
|
return True
|
|
time.sleep(0.05)
|
|
repo.localvfs.unlink("hookrunning")
|
|
return False
|