At file:///data/jelmer/bzr-svn/trunk/
------------------------------------------------------------
revno: 1878
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Jelmer Vernooij <[EMAIL PROTECTED]>
branch nick: trunk
timestamp: Tue 2008-09-09 03:09:58 +0200
message:
load default config just once.
modified:
util.c util.c-20080531154025-s8ef6ej9tytsnkkw-1
=== modified file 'util.c'
--- a/util.c 2008-09-09 00:32:05 +0000
+++ b/util.c 2008-09-09 01:09:58 +0000
@@ -401,6 +401,22 @@
return NULL;
}
+static apr_hash_t *get_default_config(void)
+{
+ static bool initialised = false;
+ static apr_pool_t *pool = NULL;
+ static apr_hash_t *default_config = NULL;
+
+ if (!initialised) {
+ pool = Pool(NULL);
+ RUN_SVN_WITH_POOL(pool,
+
svn_config_get_config(&default_config, NULL, pool));
+ initialised = true;
+ }
+
+ return default_config;
+}
+
apr_hash_t *config_hash_from_object(PyObject *config, apr_pool_t *pool)
{
Py_ssize_t idx = 0;
@@ -409,9 +425,7 @@
PyObject *dict;
if (config == Py_None) {
- RUN_SVN_WITH_POOL(pool,
- svn_config_get_config(&config_hash,
NULL, pool));
- return config_hash;
+ return get_default_config();
}
config_hash = apr_hash_make(pool);
--
bazaar-commits mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/bazaar-commits