Rev 1246: Cherrypick repository C bindings. in file:///data/jelmer/bzr-svn/0.4-ra/

Jelmer Vernooij jelmer at samba.org
Thu Jun 19 18:20:14 BST 2008


At file:///data/jelmer/bzr-svn/0.4-ra/

------------------------------------------------------------
revno: 1246
revision-id: jelmer at samba.org-20080619172013-73xy4dzdrmin6lmw
parent: jelmer at samba.org-20080619155742-cb10ki8v5ceflqyw
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: 0.4-ra
timestamp: Thu 2008-06-19 19:20:13 +0200
message:
  Cherrypick repository C bindings.
modified:
  repos.c                        repos.pyx-20080314114432-g2b5lqe776tkbl4k-1
  tests/test_repos.py            test_repos.py-20060508151940-ddc49a59257ca712
=== modified file 'repos.c'
--- a/repos.c	2008-06-19 15:57:42 +0000
+++ b/repos.c	2008-06-19 17:20:13 +0000
@@ -48,9 +48,9 @@
     pool = Pool();
 	if (pool == NULL)
 		return NULL;
-    hash_config = NULL; /* FIXME */
-    hash_fs_config = NULL; /* FIXME */
-    RUN_SVN_WITH_POOL(pool, svn_repos_create(&repos, path, "", "", 
+    hash_config = apr_hash_make(pool); /* FIXME */
+    hash_fs_config = apr_hash_make(pool); /* FIXME */
+    RUN_SVN_WITH_POOL(pool, svn_repos_create(&repos, path, NULL, NULL, 
                 hash_config, hash_fs_config, pool));
 
 	ret = PyObject_New(RepositoryObject, &Repository_Type);
@@ -110,6 +110,11 @@
 
 	fs = svn_repos_fs(reposobj->repos);
 
+	if (fs == NULL) {
+		PyErr_SetString(PyExc_RuntimeError, "Unable to obtain fs handle");
+		return NULL;
+	}
+
 	ret = PyObject_New(FileSystemObject, &FileSystem_Type);
 	if (ret == NULL)
 		return NULL;
@@ -227,6 +232,7 @@
 	pool = Pool();
 	if (pool == NULL)
 		return;
+
 	svn_fs_initialize(pool);
 
 	mod = Py_InitModule3("repos", repos_module_methods, "Local repository management");

=== modified file 'tests/test_repos.py'
--- a/tests/test_repos.py	2008-06-15 02:48:51 +0000
+++ b/tests/test_repos.py	2008-06-19 17:20:13 +0000
@@ -31,8 +31,6 @@
 
 import os, sys
 
-import svn.fs
-
 from bzrlib.plugins.svn import format
 from bzrlib.plugins.svn.mapping import (escape_svn_path, unescape_svn_path, 
                      SVN_PROP_BZR_REVISION_ID)
@@ -500,7 +498,7 @@
         self.assertTrue(isinstance(bzrdir, BzrDir))
         repository = bzrdir._find_repository()
         fs = self.open_fs('c')
-        self.assertEqual(svn.fs.get_uuid(fs), repository.uuid)
+        self.assertEqual(fs.get_uuid(), repository.uuid)
 
     def test_get_inventory_weave(self):
         bzrdir = self.make_client_and_bzrdir('d', 'dc')




More information about the bazaar-commits mailing list