Rev 649: Add test for get_changed_properties. in file:///data/jelmer/bzr-svn/noschemes/

Jelmer Vernooij jelmer at samba.org
Mon Feb 4 03:21:35 GMT 2008


At file:///data/jelmer/bzr-svn/noschemes/

------------------------------------------------------------
revno: 649
revision-id:jelmer at samba.org-20080204032132-3hi6jevfrg5y17ez
parent: jelmer at samba.org-20080204000504-sxfo0zzk0p05ogi3
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: noschemes
timestamp: Mon 2008-02-04 04:21:32 +0100
message:
  Add test for get_changed_properties.
modified:
  branch.py                      svnbranch.py-20051017135706-11c749eb0dab04a7
  tests/test_branchprops.py      test_branchprops.py-20061223210444-04xf5224zcg69m3w-1
=== modified file 'branch.py'
--- a/branch.py	2008-02-04 00:05:04 +0000
+++ b/branch.py	2008-02-04 03:21:32 +0000
@@ -201,8 +201,6 @@
         revhistory = []
         for (branch, rev) in self.repository.follow_branch(
                 self.get_branch_path(last_revnum), last_revnum, self.mapping):
-            from bzrlib.trace import mutter
-            mutter('revhistory %r, %r' % (branch, rev))
             revhistory.append(
                 self.repository.generate_revision_id(rev, branch, 
                     self.mapping))

=== modified file 'tests/test_branchprops.py'
--- a/tests/test_branchprops.py	2007-07-23 20:18:26 +0000
+++ b/tests/test_branchprops.py	2008-02-04 03:21:32 +0000
@@ -115,6 +115,32 @@
         bp = BranchPropertyList(logwalk, self.db)
         self.assertEqual("data2\n", bp.get_property_diff("", 2, "myprop"))
 
+    def test_get_changed_properties(self):
+        repos_url = self.make_client('d', 'dc')
+        self.client_set_prop("dc", "myprop", "data\n")
+        self.client_commit("dc", "My Message")
+        self.client_update("dc")
+        self.client_set_prop("dc", "myprop", "newdata\n")
+        self.client_commit("dc", "My Message")
+        self.client_update("dc")
+        self.client_set_prop("dc", "myp2", "newdata\n")
+        self.client_commit("dc", "My Message")
+        self.client_update("dc")
+
+        logwalk = LogWalker(transport=SvnRaTransport(repos_url))
+
+        bp = BranchPropertyList(logwalk, self.db)
+        self.assertEquals("data\n",
+                          bp.get_changed_properties("", 1)["myprop"])
+
+        bp = BranchPropertyList(logwalk, self.db)
+        self.assertEquals("newdata\n", 
+                          bp.get_changed_properties("", 2)["myprop"])
+
+        bp = BranchPropertyList(logwalk, self.db)
+        self.assertEquals("newdata\n", 
+                          bp.get_changed_properties("", 3)["myp2"])
+
     def test_touches_property(self):
         repos_url = self.make_client('d', 'dc')
         self.client_set_prop("dc", "myprop", "data\n")




More information about the bazaar-commits mailing list