Rev 3562: Test that the empty-directory logic for all _walkdirs implementations is correct. in http://bzr.arbash-meinel.com/branches/bzr/1.6-dev/win32_find_files

John Arbash Meinel john at arbash-meinel.com
Thu Jul 17 16:29:08 BST 2008


At http://bzr.arbash-meinel.com/branches/bzr/1.6-dev/win32_find_files

------------------------------------------------------------
revno: 3562
revision-id: john at arbash-meinel.com-20080717152900-0qm7pf511hjgutzy
parent: john at arbash-meinel.com-20080717152134-8xz1wvbu47mhc1oe
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: win32_find_files
timestamp: Thu 2008-07-17 10:29:00 -0500
message:
  Test that the empty-directory logic for all _walkdirs implementations is correct.
  Also, I was forgetting to actually build the extension between tests.
  Fix a couple small typos that crept in.
-------------- next part --------------
=== modified file 'bzrlib/_walkdirs_win32.pyx'
--- a/bzrlib/_walkdirs_win32.pyx	2008-07-17 15:13:32 +0000
+++ b/bzrlib/_walkdirs_win32.pyx	2008-07-17 15:29:00 +0000
@@ -107,10 +107,10 @@
 
     mode_bits = 0100666 # writeable file, the most common
     if data.dwFileAttributes & FILE_ATTRIBUTE_READONLY == FILE_ATTRIBUTE_READONLY:
-        mode_bits = mode ^ 0222 # remove the write bits
+        mode_bits = mode_bits ^ 0222 # remove the write bits
     if data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY == FILE_ATTRIBUTE_DIRECTORY:
         # Remove the FILE bit, set the DIR bit, and set the EXEC bits
-        mode_bits = mode ^ 0140111
+        mode_bits = mode_bits ^ 0140111
     return mode_bits
 
 
@@ -206,7 +206,6 @@
         :return: A dirblock for all the files of the form
             [(utf8_relpath, utf8_fname, kind, _Win32Stat, unicode_abspath)]
         """
-        dirblock = self._get_files_in(top_slash, relprefix)
         cdef WIN32_FIND_DATAW search_data
         cdef HANDLE hFindFile
         cdef int last_err

=== modified file 'bzrlib/tests/test_osutils.py'
--- a/bzrlib/tests/test_osutils.py	2008-07-17 15:21:34 +0000
+++ b/bzrlib/tests/test_osutils.py	2008-07-17 15:29:00 +0000
@@ -858,7 +858,7 @@
         # Force it to redetect
         osutils._real_walkdirs_utf8 = None
         # Nothing to list, but should still trigger the selection logic
-        list(osutils._walkdirs_utf8('.'))
+        self.assertEqual([(('', '.'), [])], list(osutils._walkdirs_utf8('.')))
         self.assertIs(expected, osutils._real_walkdirs_utf8)
 
     def test_force_walkdirs_utf8_fs_utf8(self):



More information about the bazaar-commits mailing list