Rev 2298: Add a test for bug 316384. in http://people.samba.org/bzr/jelmer/bzr-svn/0.5

Jelmer Vernooij jelmer at samba.org
Tue Jan 13 14:20:53 GMT 2009


At http://people.samba.org/bzr/jelmer/bzr-svn/0.5

------------------------------------------------------------
revno: 2298
revision-id: jelmer at samba.org-20090113142050-igd54psus60gk56m
parent: jelmer at samba.org-20090113031811-9yg5mqwet7sdxsu1
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: 0.5
timestamp: Tue 2009-01-13 15:20:50 +0100
message:
  Add a test for bug 316384.
modified:
  tests/test_fetch.py            test_fetch.py-20070624210302-luvgwjmlfysk5qeq-1
=== modified file 'tests/test_fetch.py'
--- a/tests/test_fetch.py	2008-12-07 23:25:07 +0000
+++ b/tests/test_fetch.py	2009-01-13 14:20:50 +0000
@@ -1276,6 +1276,48 @@
                 oldrepos.generate_revision_id(5, "", mapping))
         self.assertNotEqual(inv1.path2id("y"), inv2.path2id("y"))
 
+    def test_fetch_dir_replace_self(self):
+        repos_url = self.make_repository('d')
+
+        dc = self.get_commit_editor(repos_url)
+        dc.add_dir("branches")
+        trunk = dc.add_dir("trunk")
+        dir1 = trunk.add_dir("trunk/dir1")
+        dir2 = dir1.add_dir("trunk/dir1/dir2")
+        dir3 = dir2.add_dir("trunk/dir1/dir2/dir3")
+        file = dir3.add_file("trunk/dir1/dir2/dir3/file.txt")
+        file.modify()
+        file = dir1.add_file("trunk/dir1/file.txt")
+        file.modify()
+        dc.close()
+
+        dc = self.get_commit_editor(repos_url)
+        trunk = dc.open_dir("trunk")
+        dir1 = trunk.open_dir("trunk/dir1")
+        dir1.open_file("trunk/dir1/file.txt").modify()
+        dc.close()
+
+        dc = self.get_commit_editor(repos_url)
+        trunk = dc.open_dir("trunk")
+        dir1 = trunk.open_dir("trunk/dir1")
+        dir2 = dir1.open_dir("trunk/dir1/dir2")
+        dir3 = dir1.open_dir("trunk/dir1/dir2/dir3")
+        dir3.open_file("trunk/dir1/dir2/dir3/file.txt").modify()
+        dc.close()
+
+        dc = self.get_commit_editor(repos_url)
+        branches = dc.open_dir("branches")
+        branch1 = branches.add_dir("branches/1.0", "trunk", 3)
+        branch1.delete("branches/1.0/dir1")
+        branch1.add_dir("branches/1.0/dir1", "trunk/dir1", 2)
+        dc.close()
+
+        oldrepos = Repository.open(repos_url)
+        oldrepos.set_layout(TrunkLayout(0))
+        dir = BzrDir.create("f", format.get_rich_root_format())
+        newrepos = dir.create_repository()
+        oldrepos.copy_content_into(newrepos)
+
     def test_fetch_dir_upgrade(self):
         repos_url = self.make_repository('d')
 




More information about the bazaar-commits mailing list