Gary's bug.
authorstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Sat, 11 Jun 2005 12:34:46 +0000 (12:34 +0000)
committerstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Sat, 11 Jun 2005 12:34:46 +0000 (12:34 +0000)
git-svn-id: http://scons.tigris.org/svn/scons/trunk@1312 fdb21ef1-2011-0410-befe-b5e4ea1792b1

src/engine/SCons/Node/FS.py
src/engine/SCons/Node/FSTests.py

index a1cadf093c01d599612e47cbc8b2ccba86ec28fb..f2eb1aa4ed0727837ace284f6d84b421cc9bd180 100644 (file)
@@ -909,7 +909,15 @@ class FS(LocalFS):
         # Lookup the directory
         for orig, norm in map(None, path_orig, path_norm):
             try:
-                directory = directory.entries[norm]
+                entries = directory.entries
+            except AttributeError:
+                # We tried to look up the entry in either an Entry or
+                # a File.  Give whatever it is a chance to do what's
+                # appropriate: morph into a Dir or raise an exception.
+                directory.must_be_a_Dir()
+                entries = directory.entries
+            try:
+                directory = entries[norm]
             except KeyError:
                 if not create:
                     raise SCons.Errors.UserError
@@ -923,12 +931,6 @@ class FS(LocalFS):
                 directory.entries[norm] = d
                 directory.add_wkid(d)
                 directory = d
-            except AttributeError:
-                # We tried to look up the entry in either an Entry or
-                # a File.  Give whatever it is a chance to do what's
-                # appropriate: morph into a Dir or raise an exception.
-                directory.must_be_a_Dir()
-                directory = directory.entries[norm]
 
         directory.must_be_a_Dir()
 
index f7a2a636374d752826e9ff45b6f433743968a9d0..a8b5b6d3ec1c541530823c2a6de5b868ee0dc819 100644 (file)
@@ -1713,8 +1713,8 @@ class DirTestCase(_tempdirTestCase):
         r = sub.file_on_disk('dir')
         assert not r, r
 
-class EntryTestCase(unittest.TestCase):
-    def runTest(self):
+class EntryTestCase(_tempdirTestCase):
+    def test_runTest(self):
         """Test methods specific to the Entry sub-class.
         """
         test = TestCmd(workdir='')
@@ -1803,7 +1803,10 @@ class EntryTestCase(unittest.TestCase):
         # Doesn't exist, no sources, and no builder: no sig
         assert sig is None, sig
 
-
+    def test_Entry_Entry_lookup(self):
+        """Test looking up an Entry within another Entry"""
+        self.fs.Entry('#topdir')
+        self.fs.Entry('#topdir/a/b/c')
 
 class RepositoryTestCase(_tempdirTestCase):
 
@@ -2779,7 +2782,6 @@ class SaveStringsTestCase(unittest.TestCase):
 if __name__ == "__main__":
     suite = unittest.TestSuite()
     suite.addTest(BuildDirTestCase())
-    suite.addTest(EntryTestCase())
     suite.addTest(find_fileTestCase())
     suite.addTest(StringDirTestCase())
     suite.addTest(stored_infoTestCase())
@@ -2795,6 +2797,7 @@ if __name__ == "__main__":
     tclasses = [
         BaseTestCase,
         BuildInfoTestCase,
+        EntryTestCase,
         NodeInfoTestCase,
         FSTestCase,
         DirTestCase,