Rev 2469: Fix bug #110399 by changing _iter_changes to never descend into unknown directories. in http://bzr.arbash-meinel.com/branches/bzr/0.16-dev/iter_changes_ignores_unknowns

John Arbash Meinel john at arbash-meinel.com
Fri Apr 27 00:01:59 BST 2007


At http://bzr.arbash-meinel.com/branches/bzr/0.16-dev/iter_changes_ignores_unknowns

------------------------------------------------------------
revno: 2469
revision-id: john at arbash-meinel.com-20070426230146-ip22905t91xhkjs9
parent: john at arbash-meinel.com-20070426225601-ae4qfcb8bzcfomny
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: iter_changes_ignores_unknowns
timestamp: Thu 2007-04-26 18:01:46 -0500
message:
  Fix bug #110399 by changing _iter_changes to never descend into unknown directories.
  There was a bug when a versioned directory had no versioned children.
  It would descend into all unknown subdirs.
  This was originally fixed when 'want_unchanged=True', but now it is
  also fixed when 'want_unchanged=False'.
  
  We really should have an intertree test for this, but to detect
  descent, we spy on walkdirs, which WT3 doesn't use.
modified:
  NEWS                           NEWS-20050323055033-4e00b5db738777ff
  bzrlib/workingtree_4.py        workingtree_4.py-20070208044105-5fgpc5j3ljlh5q6c-1
-------------- next part --------------
=== modified file 'NEWS'
--- a/NEWS	2007-04-26 18:53:33 +0000
+++ b/NEWS	2007-04-26 23:01:46 +0000
@@ -11,6 +11,9 @@
       empty value. And when the value is not ASCII.
       (John Arbash Meinel, #109613)
 
+    * ``WorkingTree4._iter_changes`` should not descend into unversioned
+      directories. (John Arbash Meinel, #110399)
+
 
 bzr 0.16rc1  2007-04-26
 

=== modified file 'bzrlib/workingtree_4.py'
--- a/bzrlib/workingtree_4.py	2007-04-25 22:07:09 +0000
+++ b/bzrlib/workingtree_4.py	2007-04-26 23:01:46 +0000
@@ -2132,10 +2132,10 @@
                         # new unknown files or directories.
                         # if (B) then we should ignore it, because we don't
                         # recurse into unknown directories.
-                        if want_unversioned:
-                            path_index = 0
-                            while path_index < len(current_dir_info[1]):
-                                    current_path_info = current_dir_info[1][path_index]
+                        path_index = 0
+                        while path_index < len(current_dir_info[1]):
+                                current_path_info = current_dir_info[1][path_index]
+                                if want_unversioned:
                                     if current_path_info[2] == 'directory':
                                         if self.target._directory_is_tree_reference(
                                             current_path_info[0].decode('utf8')):
@@ -2152,13 +2152,13 @@
                                         (None, utf8_decode_or_none(current_path_info[1])),
                                         (None, current_path_info[2]),
                                         (None, new_executable))
-                                    # dont descend into this unversioned path if it is
-                                    # a dir
-                                    if current_path_info[2] in ('directory',
-                                                                'tree-reference'):
-                                        del current_dir_info[1][path_index]
-                                        path_index -= 1
-                                    path_index += 1
+                                # dont descend into this unversioned path if it is
+                                # a dir
+                                if current_path_info[2] in ('directory',
+                                                            'tree-reference'):
+                                    del current_dir_info[1][path_index]
+                                    path_index -= 1
+                                path_index += 1
 
                         # This dir info has been handled, go to the next
                         try:



More information about the bazaar-commits mailing list