summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons/Node
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2002-04-09 13:49:11 (GMT)
committerSteven Knight <knight@baldmt.com>2002-04-09 13:49:11 (GMT)
commit72b58192cc6bea9962cff01f2d72e8de77591bda (patch)
tree584a5efd3d6ca331f6b3cf93d17f49055ca890df /src/engine/SCons/Node
parent3ccdd2cb4b633d5d3603d1af53c2e578f1af8f1d (diff)
downloadSCons-72b58192cc6bea9962cff01f2d72e8de77591bda.zip
SCons-72b58192cc6bea9962cff01f2d72e8de77591bda.tar.gz
SCons-72b58192cc6bea9962cff01f2d72e8de77591bda.tar.bz2
Implement content signature caching and --max-drift (Anthony Roach)
Diffstat (limited to 'src/engine/SCons/Node')
-rw-r--r--src/engine/SCons/Node/FS.py17
-rw-r--r--src/engine/SCons/Node/NodeTests.py10
-rw-r--r--src/engine/SCons/Node/__init__.py22
3 files changed, 41 insertions, 8 deletions
diff --git a/src/engine/SCons/Node/FS.py b/src/engine/SCons/Node/FS.py
index 0f8425f..c49361d 100644
--- a/src/engine/SCons/Node/FS.py
+++ b/src/engine/SCons/Node/FS.py
@@ -520,10 +520,19 @@ class File(Entry):
else:
return 0
- def store_sigs(self):
- """Update a file's .sconsign entry with its current info."""
- self.dir.sconsign().set(self.name, self.get_timestamp(),
- self.get_bsig(), self.get_csig())
+ def store_csig(self):
+ old = self.get_prevsiginfo()
+ self.dir.sconsign().set(self.name,
+ self.get_timestamp(),
+ old[1],
+ self.get_csig())
+
+ def store_bsig(self):
+ old = self.get_prevsiginfo()
+ self.dir.sconsign().set(self.name,
+ self.get_timestamp(),
+ self.get_bsig(),
+ old[2])
def get_prevsiginfo(self):
"""Fetch the previous signature information from the
diff --git a/src/engine/SCons/Node/NodeTests.py b/src/engine/SCons/Node/NodeTests.py
index 4caebb5..447ef93 100644
--- a/src/engine/SCons/Node/NodeTests.py
+++ b/src/engine/SCons/Node/NodeTests.py
@@ -266,11 +266,17 @@ class NodeTestCase(unittest.TestCase):
node.set_csig('zzz')
assert node.get_csig() == 'zzz'
+ def test_store_bsig(self):
+ """Test calling the method to store a build signature
+ """
+ node = SCons.Node.Node()
+ node.store_bsig()
+
def test_store_sigs(self):
- """Test calling the method to store signatures
+ """Test calling the method to store a content signature
"""
node = SCons.Node.Node()
- node.store_sigs()
+ node.store_csig()
def test_set_precious(self):
"""Test setting a Node's precious value
diff --git a/src/engine/SCons/Node/__init__.py b/src/engine/SCons/Node/__init__.py
index 9c39d25..a9ca790 100644
--- a/src/engine/SCons/Node/__init__.py
+++ b/src/engine/SCons/Node/__init__.py
@@ -120,9 +120,14 @@ class Node:
def get_parents(node, parent): return node.get_parents()
def clear_cache(node, parent):
node.implicit = None
+ node.bsig = None
w = Walker(self, get_parents, ignore_cycle, clear_cache)
while w.next(): pass
+ # clear out the content signature, since the contents of this
+ # node were presumably just changed:
+ self.csig = None
+
def depends_on(self, nodes):
"""Does this node depend on any of 'nodes'?"""
for node in nodes:
@@ -194,6 +199,11 @@ class Node:
of its dependency files and build information)."""
self.bsig = bsig
+ def store_bsig(self):
+ """Make the build signature permanent (that is, store it in the
+ .sconsign file or equivalent)."""
+ pass
+
def get_csig(self):
"""Get the signature of the node's content."""
return self.csig
@@ -202,11 +212,19 @@ class Node:
"""Set the signature of the node's content."""
self.csig = csig
- def store_sigs(self):
- """Make the signatures permanent (that is, store them in the
+ def store_csig(self):
+ """Make the content signature permanent (that is, store it in the
.sconsign file or equivalent)."""
pass
+ def get_prevsiginfo(self):
+ """Fetch the previous signature information from the
+ .sconsign entry."""
+ return None
+
+ def get_timestamp(self):
+ return 0
+
def set_precious(self, precious = 1):
"""Set the Node's precious value."""
self.precious = precious