Extract .redo dir state management stuff into its own file.
In preparation for changing the on-disk format eventually, as well as making the main code more readable.
This commit is contained in:
parent
81356931a4
commit
dc3efb69cc
5 changed files with 158 additions and 97 deletions
14
helpers.py
14
helpers.py
|
|
@ -81,17 +81,3 @@ def relpath(t, base):
|
|||
return '/'.join(tparts)
|
||||
|
||||
|
||||
def sname(typ, t, fromdir=None):
|
||||
# FIXME: t.replace(...) is non-reversible and non-unique here!
|
||||
if fromdir:
|
||||
t = os.path.join(fromdir, t)
|
||||
tnew = relpath(t, vars.BASE)
|
||||
v = vars.BASE + ('/.redo/%s^%s' % (typ, tnew.replace('/', '^')))
|
||||
debug2('sname: (%r) %r -> %r\n' % (os.getcwd(), t, tnew))
|
||||
return v
|
||||
|
||||
|
||||
def add_dep(t, mode, dep):
|
||||
debug2('add-dep(%r)\n' % t)
|
||||
open(sname('dep', t), 'a').write('%s %s\n'
|
||||
% (mode, relpath(dep, vars.BASE)))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue