Rev 1742: Add test case demonstrating bug 295284. in http://people.samba.org/bzr/jelmer/bzr-svn/trunk

Jelmer Vernooij jelmer at samba.org
Sun Nov 9 04:33:25 GMT 2008


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

------------------------------------------------------------
revno: 1742
revision-id: jelmer at samba.org-20081109043322-jvzof2b0j6a9klmg
parent: jelmer at samba.org-20081108211128-azi6ujhluh03qe7w
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: 0.4
timestamp: Sun 2008-11-09 05:33:22 +0100
message:
  Add test case demonstrating bug 295284.
modified:
  repository.py                  repository.py-20060306123302-1f8c5069b3fe0265
  tests/test_repository.py       test_repos.py-20060508151940-ddc49a59257ca712
=== modified file 'repository.py'
--- a/repository.py	2008-11-05 18:58:00 +0000
+++ b/repository.py	2008-11-09 04:33:22 +0000
@@ -437,7 +437,7 @@
 
     def set_make_working_trees(self, new_value):
         """See Repository.set_make_working_trees()."""
-        pass # FIXME: ignored, nowhere to store it... 
+        pass # ignored, nowhere to store it... 
 
     def make_working_trees(self):
         """See Repository.make_working_trees().

=== modified file 'tests/test_repository.py'
--- a/tests/test_repository.py	2008-08-23 15:14:26 +0000
+++ b/tests/test_repository.py	2008-11-09 04:33:22 +0000
@@ -345,6 +345,39 @@
                           repos.generate_revision_id(2, 'branches/abranch', repos.get_mapping())
                           ], items)
 
+    def test_follow_history_corrupt_fileprops(self):
+        repos_url = self.make_repository("a")
+
+        dc = self.get_commit_editor(repos_url)
+        trunk = dc.add_dir("trunk")
+        trunk.change_prop("bzr:revision-id:v3-trunk0", "1 bla\n")
+        trunk.add_file("trunk/afile").modify("data")
+        dc.add_dir("branches")
+        dc.close()
+
+        dc = self.get_commit_editor(repos_url)
+        trunk = dc.open_dir("trunk")
+        trunk.change_prop("bzr:revision-id:v3-trunk0", "1 bla\n2 blie\n")
+        dc.close()
+
+        dc = self.get_commit_editor(repos_url)
+        trunk = dc.open_dir("trunk")
+        trunk.change_prop("bzr:revision-id:v3-trunk0", "1 bla\n")
+        dc.close()
+
+        dc = self.get_commit_editor(repos_url)
+        trunk = dc.open_dir("trunk")
+        trunk.change_prop("bzr:revision-id:v3-trunk0", "1 bla\n2 hoi\n")
+        dc.close()
+
+        repos = Repository.open(repos_url)
+        set_branching_scheme(repos, TrunkBranchingScheme())
+
+        items = list(repos.iter_reverse_revision_history("hoi"))
+        self.assertEqual(["hoi", 
+                          repos.get_mapping().generate_revision_id(repos.uuid, 3, 'trunk'),
+                          "blie", "bla"], items)
+
     def test_branch_log_specific(self):
         repos_url = self.make_client("a", "dc")
         self.build_tree({




More information about the bazaar-commits mailing list