Rev 1743: Make branchprop code return old property values as well. in http://people.samba.org/bzr/jelmer/bzr-svn/trunk

Jelmer Vernooij jelmer at samba.org
Sun Nov 9 04:40:44 GMT 2008


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

------------------------------------------------------------
revno: 1743
revision-id: jelmer at samba.org-20081109044042-fsf9qv3j1zlpiqn0
parent: jelmer at samba.org-20081109043322-jvzof2b0j6a9klmg
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: 0.4
timestamp: Sun 2008-11-09 05:40:42 +0100
message:
  Make branchprop code return old property values as well.
modified:
  branchprops.py                 branchprops.py-20061223204623-80lvm7pjrpsgk0dd-1
  tests/test_branchprops.py      test_branchprops.py-20061223210444-04xf5224zcg69m3w-1
=== modified file 'branchprops.py'
--- a/branchprops.py	2008-08-23 14:55:24 +0000
+++ b/branchprops.py	2008-11-09 04:40:42 +0000
@@ -73,7 +73,8 @@
             assert isinstance(prev_path, str)
             previous = self.get_properties(prev_path, prev_revnum)
         ret = {}
-        for key, val in current.items():
-            if previous.get(key) != val:
-                ret[key] = val
+        for key, newval in current.items():
+            oldval = previous.get(key)
+            if oldval != newval:
+                ret[key] = (oldval, newval)
         return ret

=== modified file 'tests/test_branchprops.py'
--- a/tests/test_branchprops.py	2008-08-23 15:14:26 +0000
+++ b/tests/test_branchprops.py	2008-11-09 04:40:42 +0000
@@ -81,13 +81,13 @@
         logwalk = self.get_log_walker(transport=SvnRaTransport(repos_url))
 
         bp = PathPropertyProvider(logwalk)
-        self.assertEquals("data\n",
+        self.assertEquals((None, "data\n"),
                           bp.get_changed_properties("", 1)["myprop"])
 
         bp = PathPropertyProvider(logwalk)
-        self.assertEquals("newdata\n", 
+        self.assertEquals(("data\n", "newdata\n"), 
                           bp.get_changed_properties("", 2)["myprop"])
 
         bp = PathPropertyProvider(logwalk)
-        self.assertEquals("newdata\n", 
+        self.assertEquals((None, "newdata\n"), 
                           bp.get_changed_properties("", 3)["myp2"])




More information about the bazaar-commits mailing list