Print a useful message and exit when the .redo directory disappears.
This commit is contained in:
parent
2dbd47100d
commit
dce0076554
2 changed files with 17 additions and 1 deletions
12
state.py
12
state.py
|
|
@ -1,6 +1,6 @@
|
|||
import sys, os, errno, glob
|
||||
import vars
|
||||
from helpers import unlink, debug2, mkdirp, close_on_exec
|
||||
from helpers import unlink, err, debug2, mkdirp, close_on_exec
|
||||
|
||||
|
||||
def init():
|
||||
|
|
@ -17,6 +17,16 @@ def init():
|
|||
os.unlink(f)
|
||||
|
||||
|
||||
_insane = None
|
||||
def is_sane():
|
||||
global _insane
|
||||
if not _insane:
|
||||
_insane = not os.path.exists('%s/.redo' % vars.BASE)
|
||||
if _insane:
|
||||
err('.redo directory disappeared; cannot continue.\n')
|
||||
return not _insane
|
||||
|
||||
|
||||
def relpath(t, base):
|
||||
t = os.path.normpath(os.path.join(os.getcwd(), t))
|
||||
tparts = t.split('/')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue