diff options
author | Steven Knight <knight@baldmt.com> | 2003-07-21 05:05:04 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2003-07-21 05:05:04 (GMT) |
commit | 6c127c28c6924d7e5b8a0b8e1f2e348f6e53107c (patch) | |
tree | eb080c0e9d4959bd1015f47a303dfbe2ebe9195b /src/engine | |
parent | 67a5558f919e9504d0c8c564d72458cd32fac906 (diff) | |
download | SCons-6c127c28c6924d7e5b8a0b8e1f2e348f6e53107c.zip SCons-6c127c28c6924d7e5b8a0b8e1f2e348f6e53107c.tar.gz SCons-6c127c28c6924d7e5b8a0b8e1f2e348f6e53107c.tar.bz2 |
Fix the return value of the base Node.get_prevsiginfo(). (Gary Oberbrunner)
Diffstat (limited to 'src/engine')
-rw-r--r-- | src/engine/SCons/Node/NodeTests.py | 7 | ||||
-rw-r--r-- | src/engine/SCons/Node/__init__.py | 2 | ||||
-rw-r--r-- | src/engine/SCons/Sig/__init__.py | 13 |
3 files changed, 17 insertions, 5 deletions
diff --git a/src/engine/SCons/Node/NodeTests.py b/src/engine/SCons/Node/NodeTests.py index 103cfae..2d6e0bc 100644 --- a/src/engine/SCons/Node/NodeTests.py +++ b/src/engine/SCons/Node/NodeTests.py @@ -971,6 +971,13 @@ class NodeTestCase(unittest.TestCase): assert n.get_subst_proxy() == n, n.get_subst_proxy() + def test_get_prevsiginfo(self): + """Test the base Node get_prevsiginfo() method""" + n = SCons.Node.Node() + siginfo = n.get_prevsiginfo() + assert siginfo == (None, None, None), siginfo + + if __name__ == "__main__": suite = unittest.makeSuite(NodeTestCase, 'test_') diff --git a/src/engine/SCons/Node/__init__.py b/src/engine/SCons/Node/__init__.py index 6947c93..1a80d5a 100644 --- a/src/engine/SCons/Node/__init__.py +++ b/src/engine/SCons/Node/__init__.py @@ -513,7 +513,7 @@ class Node: def get_prevsiginfo(self): """Fetch the previous signature information from the .sconsign entry.""" - return None + return SCons.Sig._SConsign.null_siginfo def get_timestamp(self): return 0 diff --git a/src/engine/SCons/Sig/__init__.py b/src/engine/SCons/Sig/__init__.py index 36145cb..b4b70b4 100644 --- a/src/engine/SCons/Sig/__init__.py +++ b/src/engine/SCons/Sig/__init__.py @@ -103,6 +103,11 @@ class _SConsign: global sig_files sig_files.append(self) + # A null .sconsign entry. We define this here so that it will + # be easy to keep this in sync if/whenever we change the type of + # information returned by the get() method, below. + null_siginfo = (None, None, None) + def get(self, filename): """ Get the .sconsign entry for a file @@ -321,15 +326,15 @@ class Calculator: return csig if self.max_drift >= 0: - info = node.get_prevsiginfo() + oldtime, oldbsig, oldcsig = node.get_prevsiginfo() else: - info = None + oldtime, oldbsig, oldcsig = _SConsign.null_siginfo mtime = node.get_timestamp() - if (info and info[0] and info[2] and info[0] == mtime): + if (oldtime and oldcsig and oldtime == mtime): # use the signature stored in the .sconsign file - csig = info[2] + csig = oldcsig # Set the csig here so it doesn't get recalculated unnecessarily # and so it's set when the .sconsign file gets written cache.set_csig(csig) |