Rev 2729: Deleted paths. in http://people.ubuntu.com/~robertc/baz2.0/commit-candidates

Robert Collins robertc at robertcollins.net
Thu Aug 23 07:42:32 BST 2007


At http://people.ubuntu.com/~robertc/baz2.0/commit-candidates

------------------------------------------------------------
revno: 2729
revision-id: robertc at robertcollins.net-20070823064228-onf9ozxb7wa8umiz
parent: robertc at robertcollins.net-20070823063224-1048jolgyv7qyrt1
committer: Robert Collins <robertc at robertcollins.net>
branch nick: commit-candidates
timestamp: Thu 2007-08-23 16:42:28 +1000
message:
  Deleted paths.
modified:
  bzrlib/tests/workingtree_implementations/test_iter_commit_candidates.py test_iter_commit_can-20070822055451-ygz697i0te0mcg8p-1
=== modified file 'bzrlib/tests/workingtree_implementations/test_iter_commit_candidates.py'
--- a/bzrlib/tests/workingtree_implementations/test_iter_commit_candidates.py	2007-08-23 06:32:24 +0000
+++ b/bzrlib/tests/workingtree_implementations/test_iter_commit_candidates.py	2007-08-23 06:42:28 +0000
@@ -217,7 +217,44 @@
                     {tree.last_revision():tree.basis_tree()},
                     specific_files=new_specific_files[2:3],
                     )))
+
+    def test_deleted_items(self):
+        tree = self.make_branch_and_tree('tree')
+        # get a tree with one symlink/file/dir committed, so we can 
+        # delta them
+        paths = ['dir', 'file']
+        ids = ['dirid', 'fileid']
+        self.build_tree(['tree/dir/', 'tree/file'])
+        if has_symlinks():
+            paths.append('link')
+            ids.append('linkid')
+            os.symlink('target', 'tree/link')
+        tree.add(paths, ids)
+        rev_id1 = tree.commit('commit')
+        # now delete the files
+        tree.remove(['file', 'dir'], keep_files=False)
+        if has_symlinks():
+            tree.remove(['link'], keep_files=False)
+        tree.lock_write()
+        tree_root = tree.path2id('')
+        expected_result = [
+            ((None, 'dirid', None, None, None, None, None),
+             ((tree_root, 'dir', 'directory', False, None, rev_id1),),
+             True),
+            ((None, 'fileid', None, None, None, None, None),
+             ((tree_root, 'file', 'file', False,
+              'fdd68fdc095181052aaa4f74fdb2db4a2ce6eb9f', rev_id1),),
+             True)]
+        if has_symlinks():
+            expected_result.append(
+                ((None, 'linkid', None, None, None, None, None),
+                 ((tree_root, 'link', 'symlink', False, None, rev_id1),),
+                 True))
+        try:
+            self.assertEqual(expected_result,
+                list(tree.iter_commit_candidates({tree.last_revision():tree.basis_tree()})))
+        finally:
+            tree.unlock()
+
 # tests to write:
 # strict
-# on directory callback
-# deleted items



More information about the bazaar-commits mailing list