Don't update the database during redo-ood.
Makes it slightly faster.
This commit is contained in:
parent
3b19ccad9f
commit
560f95fd77
3 changed files with 23 additions and 6 deletions
12
deps.py
12
deps.py
|
|
@ -5,7 +5,9 @@ from log import debug
|
|||
CLEAN = 0
|
||||
DIRTY = 1
|
||||
|
||||
def isdirty(f, depth, max_changed):
|
||||
def isdirty(f, depth, max_changed,
|
||||
is_checked=state.File.is_checked,
|
||||
set_checked=state.File.set_checked_save):
|
||||
if vars.DEBUG >= 1:
|
||||
debug('%s?%s\n' % (depth, f.nicename()))
|
||||
|
||||
|
|
@ -18,7 +20,7 @@ def isdirty(f, depth, max_changed):
|
|||
if f.changed_runid > max_changed:
|
||||
debug('%s-- DIRTY (built)\n' % depth)
|
||||
return DIRTY # has been built more recently than parent
|
||||
if f.is_checked():
|
||||
if is_checked(f):
|
||||
if vars.DEBUG >= 1:
|
||||
debug('%s-- CLEAN (checked)\n' % depth)
|
||||
return CLEAN # has already been checked during this session
|
||||
|
|
@ -47,7 +49,8 @@ def isdirty(f, depth, max_changed):
|
|||
elif mode == 'm':
|
||||
sub = isdirty(f2, depth = depth + ' ',
|
||||
max_changed = max(f.changed_runid,
|
||||
f.checked_runid))
|
||||
f.checked_runid),
|
||||
is_checked=is_checked, set_checked=set_checked)
|
||||
if sub:
|
||||
debug('%s-- DIRTY (sub)\n' % depth)
|
||||
dirty = sub
|
||||
|
|
@ -84,8 +87,7 @@ def isdirty(f, depth, max_changed):
|
|||
# if we get here, it's because the target is clean
|
||||
if f.is_override:
|
||||
state.warn_override(f.name)
|
||||
f.set_checked()
|
||||
f.save()
|
||||
set_checked(f)
|
||||
return CLEAN
|
||||
|
||||
|
||||
|
|
|
|||
13
redo-ood.py
13
redo-ood.py
|
|
@ -11,7 +11,18 @@ if len(sys.argv[1:]) != 0:
|
|||
err('%s: no arguments expected.\n' % sys.argv[0])
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
cache = {}
|
||||
|
||||
def is_checked(f):
|
||||
return cache.get(f.id, 0)
|
||||
|
||||
def set_checked(f):
|
||||
cache[f.id] = 1
|
||||
|
||||
|
||||
for f in state.files():
|
||||
if f.is_generated and f.read_stamp() != state.STAMP_MISSING:
|
||||
if deps.isdirty(f, depth='', max_changed=vars.RUNID):
|
||||
if deps.isdirty(f, depth='', max_changed=vars.RUNID,
|
||||
is_checked=is_checked, set_checked=set_checked):
|
||||
print f.nicename()
|
||||
|
|
|
|||
4
state.py
4
state.py
|
|
@ -199,6 +199,10 @@ class File(object):
|
|||
def set_checked(self):
|
||||
self.checked_runid = vars.RUNID
|
||||
|
||||
def set_checked_save(self):
|
||||
self.set_checked()
|
||||
self.save()
|
||||
|
||||
def set_changed(self):
|
||||
debug2('BUILT: %r (%r)\n' % (self.name, self.stamp))
|
||||
self.changed_runid = vars.RUNID
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue