Rev 1298: Add test for revprop_list, remove special casing in mapping code. in http://people.samba.org/bzr/jelmer/bzr-svn/0.4

Jelmer Vernooij jelmer at samba.org
Mon Jun 23 00:44:08 BST 2008


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

------------------------------------------------------------
revno: 1298
revision-id: jelmer at samba.org-20080622234407-jstmw70khapy37eg
parent: jelmer at samba.org-20080622233507-nxncgla58u1o7swx
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: 0.4
timestamp: Mon 2008-06-23 01:44:07 +0200
message:
  Add test for revprop_list, remove special casing in mapping code.
modified:
  mapping.py                     mapping.py-20080128201303-6cp01phc0dmc0kiv-1
  tests/test_logwalker.py        test_logwalker.py-20060622141944-pkocc3rj8g62ukbi-1
=== modified file 'mapping.py'
--- a/mapping.py	2008-06-22 18:53:14 +0000
+++ b/mapping.py	2008-06-22 23:44:07 +0000
@@ -149,10 +149,8 @@
         except UnicodeDecodeError:
             pass
 
-    if svn_revprops.has_key(properties.PROP_REVISION_DATE):
-        rev.timestamp = properties.time_from_cstring(svn_revprops[properties.PROP_REVISION_DATE]) / 1000000.0
-    else:
-        rev.timestamp = 0.0 # FIXME: Obtain repository creation time
+    assert svn_revprops.has_key(properties.PROP_REVISION_DATE)
+    rev.timestamp = properties.time_from_cstring(svn_revprops[properties.PROP_REVISION_DATE]) / 1000000.0
     rev.timezone = None
     rev.properties = {}
 

=== modified file 'tests/test_logwalker.py'
--- a/tests/test_logwalker.py	2008-06-15 02:48:51 +0000
+++ b/tests/test_logwalker.py	2008-06-22 23:44:07 +0000
@@ -544,6 +544,21 @@
         self.assertEqual(set(['trunk/data', 'trunk/data/bla', 'trunk/file']), 
                 set(walker.find_children("trunk", 2)))
 
+    def test_revprop_list(self):
+        repos_url = self.make_repository("a")
+
+        cb = self.commit_editor(repos_url)
+        cb.add_dir("trunk")
+        cb.done()
+
+        walker = self.get_log_walker(transport=SvnRaTransport(repos_url))
+
+        props = walker.revprop_list(1)
+        self.assertEquals(set(["svn:date", "svn:author", "svn:log"]), set(props.keys()))
+
+        props = walker.revprop_list(0)
+        self.assertEquals(set(["svn:date"]), set(props.keys()))
+
     def test_find_children_copy(self):
         repos_url = self.make_repository("a")
 




More information about the bazaar-commits mailing list