Rev 2493: Dont walk unversioned directories in _iter_changes. in http://bazaar.launchpad.net/~bzr/bzr/dirstate
Robert Collins
robertc at robertcollins.net
Fri Mar 2 02:50:46 GMT 2007
At http://bazaar.launchpad.net/~bzr/bzr/dirstate
------------------------------------------------------------
revno: 2493
revision-id: robertc at robertcollins.net-20070302024953-pc6v83lxtj1n22st
parent: john at arbash-meinel.com-20070302023327-t7w84ndc43ik7mn5
committer: Robert Collins <robertc at robertcollins.net>
branch nick: dirstate.dogfood
timestamp: Fri 2007-03-02 13:49:53 +1100
message:
Dont walk unversioned directories in _iter_changes.
modified:
bzrlib/tests/intertree_implementations/test_compare.py test_compare.py-20060724101752-09ysswo1a92uqyoz-2
bzrlib/workingtree_4.py workingtree_4.py-20070208044105-5fgpc5j3ljlh5q6c-1
=== modified file 'bzrlib/tests/intertree_implementations/test_compare.py'
--- a/bzrlib/tests/intertree_implementations/test_compare.py 2007-03-02 01:06:12 +0000
+++ b/bzrlib/tests/intertree_implementations/test_compare.py 2007-03-02 02:49:53 +0000
@@ -652,7 +652,6 @@
# except ???:
# links_supported = False
tree1, tree2 = self.mutable_trees_to_test_trees(tree1, tree2)
- root_id = tree1.path2id('')
tree1.lock_read()
self.addCleanup(tree1.unlock)
tree2.lock_read()
@@ -677,7 +676,6 @@
# except ???:
# links_supported = False
tree1, tree2 = self.mutable_trees_to_test_trees(tree1, tree2)
- root_id = tree1.path2id('')
tree1.lock_read()
self.addCleanup(tree1.unlock)
tree2.lock_read()
@@ -745,6 +743,17 @@
specific_files=specific_files, require_versioned=False,
want_unversioned=True))
+ def test_unversioned_subtree_only_emits_root(self):
+ tree1 = self.make_branch_and_tree('tree1')
+ tree2 = self.make_to_branch_and_tree('tree2')
+ self.build_tree(['tree2/dir/', 'tree2/dir/file'])
+ tree1, tree2 = self.mutable_trees_to_test_trees(tree1, tree2)
+ expected = [
+ self.unversioned(tree2, 'dir'),
+ ]
+ self.assertEqual(expected, self.do_iter_changes(tree1, tree2,
+ want_unversioned=True))
+
def make_trees_with_symlinks(self):
tree1 = self.make_branch_and_tree('tree1')
tree2 = self.make_to_branch_and_tree('tree2')
=== modified file 'bzrlib/workingtree_4.py'
--- a/bzrlib/workingtree_4.py 2007-03-02 02:33:27 +0000
+++ b/bzrlib/workingtree_4.py 2007-03-02 02:49:53 +0000
@@ -1996,17 +1996,24 @@
else:
advance_entry = True # reset the advance flaga
if advance_path and current_path_info is not None:
- if want_unversioned and not path_handled:
- new_executable = bool(
- stat.S_ISREG(current_path_info[3].st_mode)
- and stat.S_IEXEC & current_path_info[3].st_mode)
+ if not path_handled:
+ # unversioned in all regards
if want_unversioned:
- yield (None, current_path_info[0], True,
- (False, False),
- (None, None),
- (None, current_path_info[1]),
- (None, current_path_info[2]),
- (None, new_executable))
+ new_executable = bool(
+ stat.S_ISREG(current_path_info[3].st_mode)
+ and stat.S_IEXEC & current_path_info[3].st_mode)
+ if want_unversioned:
+ yield (None, current_path_info[0], True,
+ (False, False),
+ (None, None),
+ (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] == 'directory':
+ del current_dir_info[1][path_index]
+ path_index -= 1
path_index += 1
if path_index < len(current_dir_info[1]):
current_path_info = current_dir_info[1][path_index]
More information about the bazaar-commits
mailing list