You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by da...@apache.org on 2012/03/05 10:25:33 UTC
svn commit: r1296975 [2/12] - in /subversion/branches/revprop-packing: ./
build/ build/ac-macros/ build/generator/ build/generator/templates/
build/win32/ notes/ notes/api-errata/1.7/
subversion/bindings/javahl/native/ subversion/bindings/javahl/tests/...
Modified: subversion/branches/revprop-packing/subversion/bindings/swig/python/tests/repository.py
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/bindings/swig/python/tests/repository.py?rev=1296975&r1=1296974&r2=1296975&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/bindings/swig/python/tests/repository.py (original)
+++ subversion/branches/revprop-packing/subversion/bindings/swig/python/tests/repository.py Mon Mar 5 09:25:25 2012
@@ -170,9 +170,11 @@ class SubversionRepositoryTestCase(unitt
repos.dir_delta(prev_root, '', '', this_root, '', e_ptr, e_baton,
_authz_callback, 1, 1, 0, 0)
- # Check results
- self.assertEqual(editor.textdeltas[0].new_data, "This is a test.\n")
- self.assertEqual(editor.textdeltas[1].new_data, "A test.\n")
+ # Check results.
+ # Ignore the order in which the editor delivers the two sibling files.
+ self.assertEqual(set([editor.textdeltas[0].new_data,
+ editor.textdeltas[1].new_data]),
+ set(["This is a test.\n", "A test.\n"]))
self.assertEqual(len(editor.textdeltas), 2)
def test_retrieve_and_change_rev_prop(self):
Modified: subversion/branches/revprop-packing/subversion/bindings/swig/python/tests/trac/versioncontrol/tests/svn_fs.py
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/bindings/swig/python/tests/trac/versioncontrol/tests/svn_fs.py?rev=1296975&r1=1296974&r2=1296975&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/bindings/swig/python/tests/trac/versioncontrol/tests/svn_fs.py (original)
+++ subversion/branches/revprop-packing/subversion/bindings/swig/python/tests/trac/versioncontrol/tests/svn_fs.py Mon Mar 5 09:25:25 2012
@@ -264,30 +264,50 @@ class SubversionRepositoryTestCase(unitt
def test_diff_dir_different_revs(self):
diffs = self.repos.get_deltas('trunk', 4, 'trunk', 8)
- self._cmp_diff((None, ('trunk/dir1/dir2', 8),
- (Node.DIRECTORY, Changeset.ADD)), diffs.next())
- self._cmp_diff((None, ('trunk/dir1/dir3', 8),
- (Node.DIRECTORY, Changeset.ADD)), diffs.next())
- self._cmp_diff((None, ('trunk/README2.txt', 6),
- (Node.FILE, Changeset.ADD)), diffs.next())
- self._cmp_diff((('trunk/dir2', 4), None,
- (Node.DIRECTORY, Changeset.DELETE)), diffs.next())
- self._cmp_diff((('trunk/dir3', 4), None,
- (Node.DIRECTORY, Changeset.DELETE)), diffs.next())
+ expected = [
+ (None, ('trunk/README2.txt', 6),
+ (Node.FILE, Changeset.ADD)),
+ (None, ('trunk/dir1/dir2', 8),
+ (Node.DIRECTORY, Changeset.ADD)),
+ (None, ('trunk/dir1/dir3', 8),
+ (Node.DIRECTORY, Changeset.ADD)),
+ (('trunk/dir2', 4), None,
+ (Node.DIRECTORY, Changeset.DELETE)),
+ (('trunk/dir3', 4), None,
+ (Node.DIRECTORY, Changeset.DELETE)),
+ ]
+ actual = [diffs.next() for i in range(5)]
+ actual = sorted(actual,
+ key=lambda diff: ((diff[0] or diff[1]).path,
+ (diff[0] or diff[1]).rev))
+ self.assertEqual(len(expected), len(actual))
+ for e,a in zip(expected, actual):
+ self._cmp_diff(e,a)
self.assertRaises(StopIteration, diffs.next)
def test_diff_dir_different_dirs(self):
diffs = self.repos.get_deltas('trunk', 1, 'branches/v1x', 12)
- self._cmp_diff((None, ('branches/v1x/dir1', 12),
- (Node.DIRECTORY, Changeset.ADD)), diffs.next())
- self._cmp_diff((None, ('branches/v1x/dir1/dir2', 12),
- (Node.DIRECTORY, Changeset.ADD)), diffs.next())
- self._cmp_diff((None, ('branches/v1x/dir1/dir3', 12),
- (Node.DIRECTORY, Changeset.ADD)), diffs.next())
- self._cmp_diff((None, ('branches/v1x/README.txt', 12),
- (Node.FILE, Changeset.ADD)), diffs.next())
- self._cmp_diff((None, ('branches/v1x/README2.txt', 12),
- (Node.FILE, Changeset.ADD)), diffs.next())
+ expected = [
+ (None, ('branches/v1x/README.txt', 12),
+ (Node.FILE, Changeset.ADD)),
+ (None, ('branches/v1x/README2.txt', 12),
+ (Node.FILE, Changeset.ADD)),
+ (None, ('branches/v1x/dir1', 12),
+ (Node.DIRECTORY, Changeset.ADD)),
+ (None, ('branches/v1x/dir1/dir2', 12),
+ (Node.DIRECTORY, Changeset.ADD)),
+ (None, ('branches/v1x/dir1/dir3', 12),
+ (Node.DIRECTORY, Changeset.ADD)),
+ ]
+ actual = [diffs.next() for i in range(5)]
+ actual = sorted(actual, key=lambda diff: (diff[1].path, diff[1].rev))
+ # for e,a in zip(expected, actual):
+ # t.write("%r\n" % (e,))
+ # t.write("%r\n" % ((None, (a[1].path, a[1].rev), (a[2], a[3])),) )
+ # t.write('\n')
+ self.assertEqual(len(expected), len(actual))
+ for e,a in zip(expected, actual):
+ self._cmp_diff(e,a)
self.assertRaises(StopIteration, diffs.next)
def test_diff_dir_no_change(self):
Modified: subversion/branches/revprop-packing/subversion/bindings/swig/python/tests/wc.py
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/bindings/swig/python/tests/wc.py?rev=1296975&r1=1296974&r2=1296975&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/bindings/swig/python/tests/wc.py (original)
+++ subversion/branches/revprop-packing/subversion/bindings/swig/python/tests/wc.py Mon Mar 5 09:25:25 2012
@@ -216,8 +216,9 @@ class SubversionWorkingCopyTestCase(unit
def test_entries_read(self):
entries = wc.entries_read(self.wc, True)
-
- self.assertEqual(['', 'tags', 'branches', 'trunk'], list(entries.keys()))
+ keys = list(entries.keys())
+ keys.sort()
+ self.assertEqual(['', 'branches', 'tags', 'trunk'], keys)
def test_get_ignores(self):
self.assert_(isinstance(wc.get_ignores(None, self.wc), list))
Modified: subversion/branches/revprop-packing/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.c?rev=1296975&r1=1296974&r2=1296975&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.c (original)
+++ subversion/branches/revprop-packing/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.c Mon Mar 5 09:25:25 2012
@@ -1313,6 +1313,9 @@ DEFINE_APR_ARRAY_TO_ARRAY(VALUE, svn_swi
DEFINE_APR_ARRAY_TO_ARRAY(VALUE, svn_swig_rb_apr_array_to_array_merge_range,
c2r_merge_range_dup, EMPTY_CPP_ARGUMENT,
svn_merge_range_t *, NULL)
+DEFINE_APR_ARRAY_TO_ARRAY(VALUE, svn_swig_rb_apr_array_to_array_auth_provider_object,
+ c2r_swig_type, EMPTY_CPP_ARGUMENT,
+ svn_auth_provider_object_t *, "svn_auth_provider_object_t*")
static VALUE
c2r_merge_range_array(void *value, void *ctx)
@@ -2960,6 +2963,41 @@ svn_swig_rb_auth_simple_prompt_func(svn_
}
svn_error_t *
+svn_swig_rb_auth_gnome_keyring_unlock_prompt_func(char **keyring_passwd,
+ const char *keyring_name,
+ void *baton,
+ apr_pool_t *pool)
+{
+ svn_error_t *err = SVN_NO_ERROR;
+ VALUE proc, rb_pool;
+ *keyring_passwd = NULL;
+
+ svn_swig_rb_from_baton((VALUE)baton, &proc, &rb_pool);
+
+ if (!NIL_P(proc)) {
+ char error_message[] =
+ "svn_auth_gnome_keyring_unlock_prompt_func_t should"
+ "return a string, not '%s'.";
+
+ callback_baton_t cbb;
+ VALUE result;
+
+ cbb.receiver = proc;
+ cbb.message = id_call;
+ cbb.args = rb_ary_new3(1, c2r_string2(keyring_name));
+ result = invoke_callback_handle_error((VALUE)(&cbb), rb_pool, &err);
+
+ if (!NIL_P(result)) {
+ if (!RTEST(rb_obj_is_kind_of(result, rb_cString)))
+ rb_raise(rb_eTypeError, error_message, r2c_inspect(result));
+ *keyring_passwd = (char *)r2c_string(result, NULL, pool);
+ }
+ }
+
+ return err;
+}
+
+svn_error_t *
svn_swig_rb_auth_username_prompt_func(svn_auth_cred_username_t **cred,
void *baton,
const char *realm,
Modified: subversion/branches/revprop-packing/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h?rev=1296975&r1=1296974&r2=1296975&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h (original)
+++ subversion/branches/revprop-packing/subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.h Mon Mar 5 09:25:25 2012
@@ -154,6 +154,8 @@ SVN_RB_SWIG_SWIGUTIL_EXPORT
VALUE svn_swig_rb_apr_array_to_array_external_item2(const apr_array_header_t *ary);
SVN_RB_SWIG_SWIGUTIL_EXPORT
VALUE svn_swig_rb_apr_array_to_array_merge_range(const apr_array_header_t *ary);
+SVN_RB_SWIG_SWIGUTIL_EXPORT
+VALUE svn_swig_rb_apr_array_to_array_auth_provider_object(const apr_array_header_t *ary);
SVN_RB_SWIG_SWIGUTIL_EXPORT
VALUE svn_swig_rb_prop_apr_array_to_hash_prop(const apr_array_header_t *ary);
@@ -378,6 +380,13 @@ svn_error_t *svn_swig_rb_wc_relocation_v
/* auth provider callbacks */
SVN_RB_SWIG_SWIGUTIL_EXPORT
+svn_error_t * svn_swig_rb_auth_gnome_keyring_unlock_prompt_func(
+ char **keyring_passwd,
+ const char *keyring_name,
+ void *baton,
+ apr_pool_t *pool);
+
+SVN_RB_SWIG_SWIGUTIL_EXPORT
svn_error_t *svn_swig_rb_auth_simple_prompt_func(
svn_auth_cred_simple_t **cred,
void *baton,
Modified: subversion/branches/revprop-packing/subversion/bindings/swig/ruby/svn/core.rb
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/bindings/swig/ruby/svn/core.rb?rev=1296975&r1=1296974&r2=1296975&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/bindings/swig/ruby/svn/core.rb (original)
+++ subversion/branches/revprop-packing/subversion/bindings/swig/ruby/svn/core.rb Mon Mar 5 09:25:25 2012
@@ -279,6 +279,10 @@ module Svn
add_prompt_provider("ssl_client_cert_pw", args, prompt, klass)
end
+ def add_platform_specific_client_providers(config=nil)
+ add_providers(Core.auth_get_platform_specific_client_providers(config))
+ end
+
private
def add_prompt_provider(name, args, prompt, credential_class)
real_prompt = Proc.new do |*prompt_args|
@@ -294,6 +298,10 @@ module Svn
end
def add_provider(provider)
+ add_providers([provider])
+ end
+
+ def add_providers(new_providers)
if auth_baton
providers = auth_baton.providers
parameters = auth_baton.parameters
@@ -301,7 +309,7 @@ module Svn
providers = []
parameters = {}
end
- self.auth_baton = AuthBaton.new(providers + [provider], parameters)
+ self.auth_baton = AuthBaton.new(providers + new_providers, parameters)
end
end
Modified: subversion/branches/revprop-packing/subversion/bindings/swig/ruby/test/util.rb
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/bindings/swig/ruby/test/util.rb?rev=1296975&r1=1296974&r2=1296975&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/bindings/swig/ruby/test/util.rb (original)
+++ subversion/branches/revprop-packing/subversion/bindings/swig/ruby/test/util.rb Mon Mar 5 09:25:25 2012
@@ -42,7 +42,7 @@ module SvnTestUtil
@repos_uri = "file://#{@full_repos_path.sub(/^\/?/, '/')}"
@svnserve_host = "127.0.0.1"
@svnserve_ports = (64152..64282).collect{|x| x.to_s}
- @wc_base_dir = File.join(Dir.tmpdir, "wc-tmp")
+ @wc_base_dir = Dir.mktmpdir
@wc_path = File.join(@wc_base_dir, "wc")
@full_wc_path = File.expand_path(@wc_path)
@tmp_path = "tmp"
Modified: subversion/branches/revprop-packing/subversion/include/private/svn_auth_private.h
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/include/private/svn_auth_private.h?rev=1296975&r1=1296974&r2=1296975&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/include/private/svn_auth_private.h (original)
+++ subversion/branches/revprop-packing/subversion/include/private/svn_auth_private.h Mon Mar 5 09:25:25 2012
@@ -53,9 +53,12 @@ extern "C" {
from an external store, using REALMSTRING and USERNAME as keys.
(The behavior is undefined if REALMSTRING or USERNAME are NULL.)
If NON_INTERACTIVE is set, the user must not be involved in the
- retrieval process. POOL is used for any necessary allocation. */
-typedef svn_boolean_t (*svn_auth__password_get_t)
- (const char **password,
+ retrieval process. Set *DONE to TRUE if a password was stored
+ in *PASSWORD, to FALSE otherwise. POOL is used for any necessary
+ allocation. */
+typedef svn_error_t * (*svn_auth__password_get_t)
+ (svn_boolean_t *done,
+ const char **password,
apr_hash_t *creds,
const char *realmstring,
const char *username,
@@ -66,10 +69,12 @@ typedef svn_boolean_t (*svn_auth__passwo
/* A function that stores PASSWORD (or some encrypted version thereof)
either directly in CREDS, or externally using REALMSTRING and USERNAME
as keys into the external store. If NON_INTERACTIVE is set, the user
- must not be involved in the storage process. POOL is used for any
- necessary allocation. */
-typedef svn_boolean_t (*svn_auth__password_set_t)
- (apr_hash_t *creds,
+ must not be involved in the storage process. Set *DONE to TRUE if the
+ password was store, to FALSE otherwise. POOL is used for any necessary
+ allocation. */
+typedef svn_error_t * (*svn_auth__password_set_t)
+ (svn_boolean_t *done,
+ apr_hash_t *creds,
const char *realmstring,
const char *username,
const char *password,
@@ -111,8 +116,9 @@ svn_auth__simple_save_creds_helper(svn_b
/* Implementation of svn_auth__password_get_t that retrieves
the plaintext password from CREDS when USERNAME matches the stored
credentials. */
-svn_boolean_t
-svn_auth__simple_password_get(const char **password,
+svn_error_t *
+svn_auth__simple_password_get(svn_boolean_t *done,
+ const char **password,
apr_hash_t *creds,
const char *realmstring,
const char *username,
@@ -122,8 +128,9 @@ svn_auth__simple_password_get(const char
/* Implementation of svn_auth__password_set_t that stores
the plaintext password in CREDS. */
-svn_boolean_t
-svn_auth__simple_password_set(apr_hash_t *creds,
+svn_error_t *
+svn_auth__simple_password_set(svn_boolean_t *done,
+ apr_hash_t *creds,
const char *realmstring,
const char *username,
const char *password,
@@ -169,8 +176,9 @@ svn_auth__ssl_client_cert_pw_file_save_c
/* This implements the svn_auth__password_get_t interface.
Set **PASSPHRASE to the plaintext passphrase retrieved from CREDS;
ignore other parameters. */
-svn_boolean_t
-svn_auth__ssl_client_cert_pw_get(const char **passphrase,
+svn_error_t *
+svn_auth__ssl_client_cert_pw_get(svn_boolean_t *done,
+ const char **passphrase,
apr_hash_t *creds,
const char *realmstring,
const char *username,
@@ -180,8 +188,9 @@ svn_auth__ssl_client_cert_pw_get(const c
/* This implements the svn_auth__password_set_t interface.
Store PASSPHRASE in CREDS; ignore other parameters. */
-svn_boolean_t
-svn_auth__ssl_client_cert_pw_set(apr_hash_t *creds,
+svn_error_t *
+svn_auth__ssl_client_cert_pw_set(svn_boolean_t *done,
+ apr_hash_t *creds,
const char *realmstring,
const char *username,
const char *passphrase,
Modified: subversion/branches/revprop-packing/subversion/include/private/svn_cache.h
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/include/private/svn_cache.h?rev=1296975&r1=1296974&r2=1296975&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/include/private/svn_cache.h (original)
+++ subversion/branches/revprop-packing/subversion/include/private/svn_cache.h Mon Mar 5 09:25:25 2012
@@ -296,7 +296,7 @@ svn_cache__membuffer_cache_create(svn_me
* assumed to be an svn_stringbuf_t.
*
* If @a thread_safe is true, and APR is compiled with threads, all
- * accesses to the cache will be protected with a mutex, if the shared
+ * accesses to the cache will be protected with a mutex, if the shared
* @a memcache has also been created with thread_safe flag set.
*
* These caches do not support svn_cache__iter.
@@ -342,9 +342,9 @@ svn_cache__is_cachable(svn_cache__t *cac
/**
* Fetches a value indexed by @a key from @a cache into @a *value,
* setting @a *found to TRUE iff it is in the cache and FALSE if it is
- * not found. The value is copied into @a result_pool using the copy
+ * not found. @a key may be NULL in which case @a *found will be
+ * FALSE. The value is copied into @a result_pool using the deserialize
* function provided to the cache's constructor.
- * ### what copy function? there are serialize/deserialize functions, no copy functions
*/
svn_error_t *
svn_cache__get(void **value,
@@ -357,7 +357,8 @@ svn_cache__get(void **value,
* Stores the value @a value under the key @a key in @a cache. Uses @a
* scratch_pool for temporary allocations. The cache makes copies of
* @a key and @a value if necessary (that is, @a key and @a value may
- * have shorter lifetimes than the cache).
+ * have shorter lifetimes than the cache). @a key may be NULL in which
+ * case the cache will remain unchanged.
*
* If there is already a value for @a key, this will replace it. Bear
* in mind that in some circumstances this may leak memory (that is,
@@ -401,8 +402,10 @@ svn_cache__iter(svn_boolean_t *completed
/**
* Similar to svn_cache__get() but will call a specific de-serialization
* function @a func. @a found will be set depending on whether the @a key
- * has been found. Even if that reports @c TRUE, @a values may still return
- * a @c NULL pointer depending on the logic inside @a func.
+ * has been found. Even if that reports @c TRUE, @a value may still return
+ * a @c NULL pointer depending on the logic inside @a func. For a @a NULL
+ * @a key, no data will be found. @a value will be allocated in
+ * @a result_pool.
*/
svn_error_t *
svn_cache__get_partial(void **value,
@@ -417,8 +420,8 @@ svn_cache__get_partial(void **value,
* Find the item identified by @a key in the @a cache. If it has been found,
* call @a func for it and @a baton to potentially modify the data. Changed
* data will be written back to the cache. If the item cannot be found,
- * @a func does not get called. @a scratch_pool is used for temporary
- * allocations.
+ * or if @a key is NULL, @a func does not get called. @a scratch_pool is
+ * used for temporary allocations.
*/
svn_error_t *
svn_cache__set_partial(svn_cache__t *cache,
Modified: subversion/branches/revprop-packing/subversion/include/private/svn_cmdline_private.h
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/include/private/svn_cmdline_private.h?rev=1296975&r1=1296974&r2=1296975&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/include/private/svn_cmdline_private.h (original)
+++ subversion/branches/revprop-packing/subversion/include/private/svn_cmdline_private.h Mon Mar 5 09:25:25 2012
@@ -92,7 +92,7 @@ svn_cmdline__parse_config_option(apr_arr
apr_pool_t *pool);
/** Sets the config options in @a config_options, an apr array containing
- * svn_cmdline__config_argument_t* elements to the configuration in @a cfg,
+ * @c svn_cmdline__config_argument_t* elements, to the configuration in @a cfg,
* a hash mapping of <tt>const char *</tt> configuration file names to
* @c svn_config_t *'s. Write warnings to stderr.
*
Modified: subversion/branches/revprop-packing/subversion/include/private/svn_mutex.h
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/include/private/svn_mutex.h?rev=1296975&r1=1296974&r2=1296975&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/include/private/svn_mutex.h (original)
+++ subversion/branches/revprop-packing/subversion/include/private/svn_mutex.h Mon Mar 5 09:25:25 2012
@@ -59,7 +59,7 @@ typedef void svn_mutex__t;
* actually be created with a lifetime defined by @a result_pool. Otherwise,
* the pointer will be set to @c NULL and @ref svn_mutex__lock as well as
* @ref svn_mutex__unlock will be no-ops.
- *
+ *
* If threading is not supported by APR, this function is a no-op.
*/
svn_error_t *
@@ -68,9 +68,9 @@ svn_mutex__init(svn_mutex__t **mutex,
apr_pool_t *result_pool);
/** Acquire the @a mutex, if that has been enabled in @ref svn_mutex__init.
- * Make sure to call @ref svn_mutex__unlock some time later in the same
+ * Make sure to call @ref svn_mutex__unlock some time later in the same
* thread to release the mutex again. Recursive locking are not supported.
- *
+ *
* @note You should use @ref SVN_MUTEX__WITH_LOCK instead of explicit lock
* aquisition and release.
*/
@@ -79,14 +79,14 @@ svn_mutex__lock(svn_mutex__t *mutex);
/** Release the @a mutex, previously acquired using @ref svn_mutex__lock
* that has been enabled in @ref svn_mutex__init.
- *
- * Since this is often used as part of the calling function's exit
- * sequence, we accept that function's current return code in @a err.
+ *
+ * Since this is often used as part of the calling function's exit
+ * sequence, we accept that function's current return code in @a err.
* If it is not @ref SVN_NO_ERROR, it will be used as the return value -
* irrespective of the possible internal failures during unlock. If @a err
- * is @ref SVN_NO_ERROR, internal failures of this function will be
+ * is @ref SVN_NO_ERROR, internal failures of this function will be
* reported in the return value.
- *
+ *
* @note You should use @ref SVN_MUTEX__WITH_LOCK instead of explicit lock
* aquisition and release.
*/
@@ -99,7 +99,7 @@ svn_mutex__unlock(svn_mutex__t *mutex,
* this macro will return an @ref svn_error_t. This macro guarantees that
* the @a mutex will always be unlocked again if it got locked successfully
* locked by the first step.
- *
+ *
* @note Prefer using this macro instead of explicit lock aquisition and
* release.
*/
Modified: subversion/branches/revprop-packing/subversion/include/private/svn_ra_private.h
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/include/private/svn_ra_private.h?rev=1296975&r1=1296974&r2=1296975&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/include/private/svn_ra_private.h (original)
+++ subversion/branches/revprop-packing/subversion/include/private/svn_ra_private.h Mon Mar 5 09:25:25 2012
@@ -31,6 +31,7 @@
#include "svn_error.h"
#include "svn_ra.h"
+#include "svn_delta.h"
#ifdef __cplusplus
extern "C" {
@@ -126,6 +127,11 @@ svn_ra__get_fspath_relative_to_root(svn_
const char *url,
apr_pool_t *pool);
+/** Register CALLBACKS to be used with the Ev2 shims in RA_SESSION. */
+svn_error_t *
+svn_ra__register_editor_shim_callbacks(svn_ra_session_t *ra_session,
+ svn_delta_shim_callbacks_t *callbacks);
+
#ifdef __cplusplus
}
#endif /* __cplusplus */
Modified: subversion/branches/revprop-packing/subversion/include/private/svn_repos_private.h
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/include/private/svn_repos_private.h?rev=1296975&r1=1296974&r2=1296975&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/include/private/svn_repos_private.h (original)
+++ subversion/branches/revprop-packing/subversion/include/private/svn_repos_private.h Mon Mar 5 09:25:25 2012
@@ -51,7 +51,7 @@ extern "C" {
* repository via tools that use the svn_fs_* API directly (possibly
* including svnadmin and svnlook). This has happened before and there
* are known (documented, but unsupported) upgrade paths in some cases.
- *
+ *
* @since New in 1.7.
*/
svn_error_t *
Modified: subversion/branches/revprop-packing/subversion/include/private/svn_wc_private.h
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/include/private/svn_wc_private.h?rev=1296975&r1=1296974&r2=1296975&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/include/private/svn_wc_private.h (original)
+++ subversion/branches/revprop-packing/subversion/include/private/svn_wc_private.h Mon Mar 5 09:25:25 2012
@@ -263,6 +263,15 @@ svn_wc__externals_gather_definitions(apr
apr_pool_t *result_pool,
apr_pool_t *scratch_pool);
+/* Close the DB for LOCAL_ABSPATH. Perform temporary allocations in
+ SCRATCH_POOL.
+
+ Wraps svn_wc__db_drop_root(). */
+svn_error_t *
+svn_wc__close_db(const char *external_abspath,
+ svn_wc_context_t *wc_ctx,
+ apr_pool_t *scratch_pool);
+
/** Set @a *tree_conflict to a newly allocated @c
* svn_wc_conflict_description_t structure describing the tree
* conflict state of @a victim_abspath, or to @c NULL if @a victim_abspath
@@ -540,7 +549,7 @@ svn_wc__node_is_status_deleted(svn_boole
* set @a *deleted_ancestor_abspath to @c NULL.
* @a *deleted_ancestor_abspath is allocated in @a result_pool.
* Use @a scratch_pool for all temporary allocations.
- */
+ */
svn_error_t *
svn_wc__node_get_deleted_ancestor(const char **deleted_ancestor_abspath,
svn_wc_context_t *wc_ctx,
@@ -1303,6 +1312,316 @@ svn_wc__resolve_relative_external_url(co
apr_pool_t *result_pool,
apr_pool_t *scratch_pool);
+
+/**
+ * Set @a *editor and @a *edit_baton to an editor that generates
+ * #svn_wc_status3_t structures and sends them through @a status_func /
+ * @a status_baton. @a anchor_abspath is a working copy directory
+ * directory which will be used as the root of our editor. If @a
+ * target_basename is not "", it represents a node in the @a anchor_abspath
+ * which is the subject of the editor drive (otherwise, the @a
+ * anchor_abspath is the subject).
+ *
+ * If @a set_locks_baton is non-@c NULL, it will be set to a baton that can
+ * be used in a call to the svn_wc_status_set_repos_locks() function.
+ *
+ * Callers drive this editor to describe working copy out-of-dateness
+ * with respect to the repository. If this information is not
+ * available or not desired, callers should simply call the
+ * close_edit() function of the @a editor vtable.
+ *
+ * If the editor driver calls @a editor's set_target_revision() vtable
+ * function, then when the edit drive is completed, @a *edit_revision
+ * will contain the revision delivered via that interface.
+ *
+ * Assuming the target is a directory, then:
+ *
+ * - If @a get_all is FALSE, then only locally-modified entries will be
+ * returned. If TRUE, then all entries will be returned.
+ *
+ * - If @a depth is #svn_depth_empty, a status structure will
+ * be returned for the target only; if #svn_depth_files, for the
+ * target and its immediate file children; if
+ * #svn_depth_immediates, for the target and its immediate
+ * children; if #svn_depth_infinity, for the target and
+ * everything underneath it, fully recursively.
+ *
+ * If @a depth is #svn_depth_unknown, take depths from the
+ * working copy and behave as above in each directory's case.
+ *
+ * If the given @a depth is incompatible with the depth found in a
+ * working copy directory, the found depth always governs.
+ *
+ * If @a no_ignore is set, statuses that would typically be ignored
+ * will instead be reported.
+ *
+ * @a ignore_patterns is an array of file patterns matching
+ * unversioned files to ignore for the purposes of status reporting,
+ * or @c NULL if the default set of ignorable file patterns should be used.
+ *
+ * If @a cancel_func is non-NULL, call it with @a cancel_baton while building
+ * the @a statushash to determine if the client has canceled the operation.
+ *
+ * If @a depth_as_sticky is set handle @a depth like when depth_is_sticky is
+ * passed for updating. This will show excluded nodes show up as added in the
+ * repository.
+ *
+ * If @a server_performs_filtering is TRUE, assume that the server handles
+ * the ambient depth filtering, so this doesn't have to be handled in the
+ * editor.
+ *
+ * Allocate the editor itself in @a result_pool, and use @a scratch_pool
+ * for temporary allocations. The editor will do its temporary allocations
+ * in a subpool of @a result_pool.
+ *
+ * @since New in 1.8.
+ */
+svn_error_t *
+svn_wc__get_status_editor(const svn_delta_editor_t **editor,
+ void **edit_baton,
+ void **set_locks_baton,
+ svn_revnum_t *edit_revision,
+ svn_wc_context_t *wc_ctx,
+ const char *anchor_abspath,
+ const char *target_basename,
+ svn_depth_t depth,
+ svn_boolean_t get_all,
+ svn_boolean_t no_ignore,
+ svn_boolean_t depth_as_sticky,
+ svn_boolean_t server_performs_filtering,
+ const apr_array_header_t *ignore_patterns,
+ svn_wc_status_func4_t status_func,
+ void *status_baton,
+ svn_cancel_func_t cancel_func,
+ void *cancel_baton,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
+
+
+/**
+ * Set @a *editor and @a *edit_baton to an editor and baton for updating a
+ * working copy.
+ *
+ * @a anchor_abspath is a local working copy directory, with a fully recursive
+ * write lock in @a wc_ctx, which will be used as the root of our editor.
+ *
+ * @a target_basename is the entry in @a anchor_abspath that will actually be
+ * updated, or the empty string if all of @a anchor_abspath should be updated.
+ *
+ * The editor invokes @a notify_func with @a notify_baton as the update
+ * progresses, if @a notify_func is non-NULL.
+ *
+ * If @a cancel_func is non-NULL, the editor will invoke @a cancel_func with
+ * @a cancel_baton as the update progresses to see if it should continue.
+ *
+ * If @a conflict_func is non-NULL, then invoke it with @a
+ * conflict_baton whenever a conflict is encountered, giving the
+ * callback a chance to resolve the conflict before the editor takes
+ * more drastic measures (such as marking a file conflicted, or
+ * bailing out of the update).
+ *
+ * If @a external_func is non-NULL, then invoke it with @a external_baton
+ * whenever external changes are encountered, giving the callback a chance
+ * to store the external information for processing.
+ *
+ * If @a diff3_cmd is non-NULL, then use it as the diff3 command for
+ * any merging; otherwise, use the built-in merge code.
+ *
+ * @a preserved_exts is an array of filename patterns which, when
+ * matched against the extensions of versioned files, determine for
+ * which such files any related generated conflict files will preserve
+ * the original file's extension as their own. If a file's extension
+ * does not match any of the patterns in @a preserved_exts (which is
+ * certainly the case if @a preserved_exts is @c NULL or empty),
+ * generated conflict files will carry Subversion's custom extensions.
+ *
+ * @a target_revision is a pointer to a revision location which, after
+ * successful completion of the drive of this editor, will be
+ * populated with the revision to which the working copy was updated.
+ *
+ * If @a use_commit_times is TRUE, then all edited/added files will
+ * have their working timestamp set to the last-committed-time. If
+ * FALSE, the working files will be touched with the 'now' time.
+ *
+ * If @a allow_unver_obstructions is TRUE, then allow unversioned
+ * obstructions when adding a path.
+ *
+ * If @a adds_as_modification is TRUE, a local addition at the same path
+ * as an incoming addition of the same node kind results in a normal node
+ * with a possible local modification, instead of a tree conflict.
+ *
+ * If @a depth is #svn_depth_infinity, update fully recursively.
+ * Else if it is #svn_depth_immediates, update the uppermost
+ * directory, its file entries, and the presence or absence of
+ * subdirectories (but do not descend into the subdirectories).
+ * Else if it is #svn_depth_files, update the uppermost directory
+ * and its immediate file entries, but not subdirectories.
+ * Else if it is #svn_depth_empty, update exactly the uppermost
+ * target, and don't touch its entries.
+ *
+ * If @a depth_is_sticky is set and @a depth is not
+ * #svn_depth_unknown, then in addition to updating PATHS, also set
+ * their sticky ambient depth value to @a depth.
+ *
+ * If @a server_performs_filtering is TRUE, assume that the server handles
+ * the ambient depth filtering, so this doesn't have to be handled in the
+ * editor.
+ *
+ * If @a fetch_dirents_func is not NULL, the update editor may call this
+ * callback, when asked to perform a depth restricted update. It will do this
+ * before returning the editor to allow using the primary ra session for this.
+ *
+ * @since New in 1.8.
+ */
+svn_error_t *
+svn_wc__get_update_editor(const svn_delta_editor_t **editor,
+ void **edit_baton,
+ svn_revnum_t *target_revision,
+ svn_wc_context_t *wc_ctx,
+ const char *anchor_abspath,
+ const char *target_basename,
+ svn_boolean_t use_commit_times,
+ svn_depth_t depth,
+ svn_boolean_t depth_is_sticky,
+ svn_boolean_t allow_unver_obstructions,
+ svn_boolean_t adds_as_modification,
+ svn_boolean_t server_performs_filtering,
+ svn_boolean_t clean_checkout,
+ const char *diff3_cmd,
+ const apr_array_header_t *preserved_exts,
+ svn_wc_dirents_func_t fetch_dirents_func,
+ void *fetch_dirents_baton,
+ svn_wc_conflict_resolver_func2_t conflict_func,
+ void *conflict_baton,
+ svn_wc_external_update_t external_func,
+ void *external_baton,
+ svn_cancel_func_t cancel_func,
+ void *cancel_baton,
+ svn_wc_notify_func2_t notify_func,
+ void *notify_baton,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
+
+
+/**
+ * A variant of svn_wc__get_update_editor().
+ *
+ * Set @a *editor and @a *edit_baton to an editor and baton for "switching"
+ * a working copy to a new @a switch_url. (Right now, this URL must be
+ * within the same repository that the working copy already comes
+ * from.) @a switch_url must not be @c NULL.
+ *
+ * All other parameters behave as for svn_wc__get_update_editor().
+ *
+ * @since New in 1.8.
+ */
+svn_error_t *
+svn_wc__get_switch_editor(const svn_delta_editor_t **editor,
+ void **edit_baton,
+ svn_revnum_t *target_revision,
+ svn_wc_context_t *wc_ctx,
+ const char *anchor_abspath,
+ const char *target_basename,
+ const char *switch_url,
+ svn_boolean_t use_commit_times,
+ svn_depth_t depth,
+ svn_boolean_t depth_is_sticky,
+ svn_boolean_t allow_unver_obstructions,
+ svn_boolean_t server_performs_filtering,
+ const char *diff3_cmd,
+ const apr_array_header_t *preserved_exts,
+ svn_wc_dirents_func_t fetch_dirents_func,
+ void *fetch_dirents_baton,
+ svn_wc_conflict_resolver_func2_t conflict_func,
+ void *conflict_baton,
+ svn_wc_external_update_t external_func,
+ void *external_baton,
+ svn_cancel_func_t cancel_func,
+ void *cancel_baton,
+ svn_wc_notify_func2_t notify_func,
+ void *notify_baton,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
+
+
+
+/**
+ * Return an @a editor/@a edit_baton for diffing a working copy against the
+ * repository. The editor is allocated in @a result_pool; temporary
+ * calculations are performed in @a scratch_pool.
+ *
+ * This editor supports diffing either the actual files and properties in the
+ * working copy (when @a use_text_base is #FALSE), or the current pristine
+ * information (when @a use_text_base is #TRUE) against the editor driver.
+ *
+ * @a anchor_abspath/@a target represent the base of the hierarchy to be
+ * compared. The diff callback paths will be relative to this path.
+ *
+ * Diffs will be reported as valid relpaths, with @a anchor_abspath being
+ * the root ("").
+ *
+ * @a callbacks/@a callback_baton is the callback table to use.
+ *
+ * If @a depth is #svn_depth_empty, just diff exactly @a target or
+ * @a anchor_path if @a target is empty. If #svn_depth_files then do the same
+ * and for top-level file entries as well (if any). If
+ * #svn_depth_immediates, do the same as #svn_depth_files but also diff
+ * top-level subdirectories at #svn_depth_empty. If #svn_depth_infinity,
+ * then diff fully recursively.
+ *
+ * @a ignore_ancestry determines whether paths that have discontinuous node
+ * ancestry are treated as delete/add or as simple modifications. If
+ * @a ignore_ancestry is @c FALSE, then any discontinuous node ancestry will
+ * result in the diff given as a full delete followed by an add.
+ *
+ * @a show_copies_as_adds determines whether paths added with history will
+ * appear as a diff against their copy source, or whether such paths will
+ * appear as if they were newly added in their entirety.
+ *
+ * If @a use_git_diff_format is TRUE, copied paths will be treated as added
+ * if they weren't modified after being copied. This allows the callbacks
+ * to generate appropriate --git diff headers for such files.
+ *
+ * Normally, the difference from repository->working_copy is shown.
+ * If @a reverse_order is TRUE, then show working_copy->repository diffs.
+ *
+ * If @a cancel_func is non-NULL, it will be used along with @a cancel_baton
+ * to periodically check if the client has canceled the operation.
+ *
+ * @a changelist_filter is an array of <tt>const char *</tt> changelist
+ * names, used as a restrictive filter on items whose differences are
+ * reported; that is, don't generate diffs about any item unless
+ * it's a member of one of those changelists. If @a changelist_filter is
+ * empty (or altogether @c NULL), no changelist filtering occurs.
+ *
+ * If @a server_performs_filtering is TRUE, assume that the server handles
+ * the ambient depth filtering, so this doesn't have to be handled in the
+ * editor.
+ *
+ * @since New in 1.8.
+ */
+svn_error_t *
+svn_wc__get_diff_editor(const svn_delta_editor_t **editor,
+ void **edit_baton,
+ svn_wc_context_t *wc_ctx,
+ const char *anchor_abspath,
+ const char *target,
+ svn_depth_t depth,
+ svn_boolean_t ignore_ancestry,
+ svn_boolean_t show_copies_as_adds,
+ svn_boolean_t use_git_diff_format,
+ svn_boolean_t use_text_base,
+ svn_boolean_t reverse_order,
+ svn_boolean_t server_performs_filtering,
+ const apr_array_header_t *changelist_filter,
+ const svn_wc_diff_callbacks4_t *callbacks,
+ void *callback_baton,
+ svn_cancel_func_t cancel_func,
+ void *cancel_baton,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
+
+
#ifdef __cplusplus
}
#endif /* __cplusplus */
Modified: subversion/branches/revprop-packing/subversion/include/svn_checksum.h
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/include/svn_checksum.h?rev=1296975&r1=1296974&r2=1296975&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/include/svn_checksum.h (original)
+++ subversion/branches/revprop-packing/subversion/include/svn_checksum.h Mon Mar 5 09:25:25 2012
@@ -239,6 +239,14 @@ svn_checksum_final(svn_checksum_t **chec
apr_size_t
svn_checksum_size(const svn_checksum_t *checksum);
+/**
+ * Return @c TRUE iff CHECKSUM matches the checksum for the empty string.
+ *
+ * @since New in 1.8.
+ */
+svn_boolean_t
+svn_checksum_is_empty_checksum(svn_checksum_t *checksum);
+
/**
* Return an error of type #SVN_ERR_CHECKSUM_MISMATCH for @a actual and
Modified: subversion/branches/revprop-packing/subversion/include/svn_client.h
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/include/svn_client.h?rev=1296975&r1=1296974&r2=1296975&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/include/svn_client.h (original)
+++ subversion/branches/revprop-packing/subversion/include/svn_client.h Mon Mar 5 09:25:25 2012
@@ -2255,7 +2255,7 @@ typedef struct svn_client_status_t
* This will be NULL for moved-here nodes that are just part of a subtree
* that was moved along (and are not themselves a root of a different move
* operation).
- *
+ *
* @since New in 1.8. */
const char *moved_from_abspath;
Modified: subversion/branches/revprop-packing/subversion/include/svn_config.h
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/include/svn_config.h?rev=1296975&r1=1296974&r2=1296975&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/include/svn_config.h (original)
+++ subversion/branches/revprop-packing/subversion/include/svn_config.h Mon Mar 5 09:25:25 2012
@@ -135,6 +135,8 @@ typedef struct svn_config_t svn_config_t
#define SVN_CONFIG_OPTION_USE_SASL "use-sasl"
#define SVN_CONFIG_OPTION_MIN_SSF "min-encryption"
#define SVN_CONFIG_OPTION_MAX_SSF "max-encryption"
+/** @since New in 1.8. */
+#define SVN_CONFIG_SECTION_HOOKS_ENV "hooks-env"
/* For repository password database */
#define SVN_CONFIG_SECTION_USERS "users"
Modified: subversion/branches/revprop-packing/subversion/include/svn_delta.h
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/include/svn_delta.h?rev=1296975&r1=1296974&r2=1296975&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/include/svn_delta.h (original)
+++ subversion/branches/revprop-packing/subversion/include/svn_delta.h Mon Mar 5 09:25:25 2012
@@ -651,7 +651,7 @@ svn_txdelta_skip_svndiff_window(apr_file
* Each of these takes a directory baton, indicating the directory
* in which the change takes place, and a @a path argument, giving the
* path of the file, subdirectory, or directory entry to change.
- *
+ *
* The @a path argument to each of the callbacks is relative to the
* root of the edit. Editors will usually want to join this relative
* path with some base stored in the edit baton (e.g. a URL, or a
@@ -792,8 +792,9 @@ svn_txdelta_skip_svndiff_window(apr_file
* number of operations later. As a result, an editor driver must not
* assume that an error from an editing function resulted from the
* particular operation being detected. Moreover, once an editing
- * function returns an error, the edit is dead; the only further
- * operation which may be called on the editor is abort_edit.
+ * function (including @c close_edit) returns an error, the edit is
+ * dead; the only further operation which may be called on the editor
+ * is @c abort_edit.
*/
typedef struct svn_delta_editor_t
{
Modified: subversion/branches/revprop-packing/subversion/include/svn_editor.h
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/include/svn_editor.h?rev=1296975&r1=1296974&r2=1296975&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/include/svn_editor.h (original)
+++ subversion/branches/revprop-packing/subversion/include/svn_editor.h Mon Mar 5 09:25:25 2012
@@ -176,9 +176,9 @@ extern "C" {
* svn_editor_setcb_add_file() \n
* svn_editor_setcb_add_symlink() \n
* svn_editor_setcb_add_absent() \n
- * svn_editor_setcb_set_props() \n
- * svn_editor_setcb_set_text() \n
- * svn_editor_setcb_set_target() \n
+ * svn_editor_setcb_alter_directory() \n
+ * svn_editor_setcb_alter_file() \n
+ * svn_editor_setcb_alter_symlink() \n
* svn_editor_setcb_delete() \n
* svn_editor_setcb_copy() \n
* svn_editor_setcb_move() \n
@@ -199,9 +199,9 @@ extern "C" {
* svn_editor_add_file() \n
* svn_editor_add_symlink() \n
* svn_editor_add_absent() \n
- * svn_editor_set_props() \n
- * svn_editor_set_text() \n
- * svn_editor_set_target() \n
+ * svn_editor_alter_directory() \n
+ * svn_editor_alter_file() \n
+ * svn_editor_alter_symlink() \n
* svn_editor_delete() \n
* svn_editor_copy() \n
* svn_editor_move() \n
@@ -241,34 +241,25 @@ extern "C" {
* follow for each child mentioned in the @a children argument of any
* svn_editor_add_directory() call.
*
- * - svn_editor_set_props()
- * - The @a complete argument must be TRUE if no more calls will follow on
- * the same path. @a complete must always be TRUE for directories.
- * - If @a complete is FALSE, and:
- * - if @a relpath is a file, this must (at some point) be followed by
- * an svn_editor_set_text() call on the same path.
- * - if @a relpath is a symlink, this must (at some point) be followed by
- * an svn_editor_set_target() call on the same path.
+ * - For each node created with add_*, if its parent was created using
+ * svn_editor_add_directory(), then the new child node MUST have been
+ * mentioned in the @a children parameter of the parent's creation.
+ * This allows the parent directory to properly mark the child as
+ * "incomplete" until the child's add_* call arrives.
*
- * - svn_editor_set_text() and svn_editor_set_target() must always occur
- * @b after an svn_editor_set_props() call on the same path, if any.
- *
- * In other words, if there are two calls coming in on the same path, the
- * first of them has to be svn_editor_set_props().
- *
- * - Other than the above two pairs of linked operations, a path should
- * never be referenced more than once by the add_* and set_* and the
+ * - A path should
+ * never be referenced more than once by the add_*, alter_*, and
* delete operations (the "Once Rule"). The source path of a copy (and
* its children, if a directory) may be copied many times, and are
* otherwise subject to the Once Rule. The destination path of a copy
- * or move may have set_* operations applied, but not add_* or delete.
+ * or move may have alter_* operations applied, but not add_* or delete.
* If the destination path of a copy, move, or rotate is a directory,
* then its children are subject to the Once Rule. The source path of
* a move (and its child paths) may be referenced in add_*, or as the
* destination of a copy (where these new or copied nodes are subject
* to the Once Rule). Paths listed in a rotation are both sources and
* destinations, so they may not be referenced again in an add_* or a
- * deletion; these paths may have set_* operations applied.
+ * deletion; these paths may have alter_* operations applied.
*
* - The ancestor of an added, copied-here, moved-here, rotated, or
* modified node may not be deleted. The ancestor may not be moved
@@ -294,7 +285,7 @@ extern "C" {
* should be used to describe a semantic move.
*
* - Paths mentioned in svn_editor_rotate() may have their properties
- * and contents edited (via set_* calls) by a previous or later call,
+ * and contents edited (via alter_* calls) by a previous or later call,
* but they may not be subject to a later move, rotate, or deletion.
*
* - One of svn_editor_complete() or svn_editor_abort() must be called
@@ -304,18 +295,16 @@ extern "C" {
* svn_editor_abort() must imply that the transformation was not completed
* successfully.
*
- * - If any callback invocation returns with an error, the driver must
- * invoke svn_editor_abort() and stop transmitting operations.
+ * - If any callback invocation (besides svn_editor_complete()) returns
+ * with an error, the driver must invoke svn_editor_abort() and stop
+ * transmitting operations.
* \n\n
*
* <h3>Receiving Restrictions</h3>
- * All callbacks must complete their handling of a path before they
- * return, except for the following pairs, where a change must be completed
- * when receiving the second callback in each pair:
- * - svn_editor_set_props() (if @a complete is FALSE) and
- * svn_editor_set_text() (if the node is a file)
- * - svn_editor_set_props() (if @a complete is FALSE) and
- * svn_editor_set_target() (if the node is a symbolic link)
+ *
+ * All callbacks must complete their handling of a path before they return.
+ * Since future callbacks will never reference this path again (due to the
+ * Once Rule), the changes can and should be completed.
*
* This restriction is not recursive -- a directory's children may remain
* incomplete until later callback calls are received.
@@ -394,6 +383,13 @@ extern "C" {
*/
typedef struct svn_editor_t svn_editor_t;
+/** The kind of the checksum to be used throughout the #svn_editor_t APIs.
+ *
+ * @note ### This may change before Ev2 is official released, so just like
+ * everything else in this file, please don't rely upon it until then.
+ */
+#define SVN_EDITOR_CHECKSUM_KIND svn_checksum_sha1
+
/** These function types define the callback functions a tree delta consumer
* implements.
@@ -463,35 +459,36 @@ typedef svn_error_t *(*svn_editor_cb_add
svn_revnum_t replaces_rev,
apr_pool_t *scratch_pool);
-/** @see svn_editor_set_props(), svn_editor_t.
+/** @see svn_editor_alter_directory(), svn_editor_t.
* @since New in 1.8.
*/
-typedef svn_error_t *(*svn_editor_cb_set_props_t)(
+typedef svn_error_t *(*svn_editor_cb_alter_directory_t)(
void *baton,
const char *relpath,
svn_revnum_t revision,
apr_hash_t *props,
- svn_boolean_t complete,
apr_pool_t *scratch_pool);
-/** @see svn_editor_set_text(), svn_editor_t.
+/** @see svn_editor_alter_file(), svn_editor_t.
* @since New in 1.8.
*/
-typedef svn_error_t *(*svn_editor_cb_set_text_t)(
+typedef svn_error_t *(*svn_editor_cb_alter_file_t)(
void *baton,
const char *relpath,
svn_revnum_t revision,
+ apr_hash_t *props,
const svn_checksum_t *checksum,
svn_stream_t *contents,
apr_pool_t *scratch_pool);
-/** @see svn_editor_set_target(), svn_editor_t.
+/** @see svn_editor_alter_symlink(), svn_editor_t.
* @since New in 1.8.
*/
-typedef svn_error_t *(*svn_editor_cb_set_target_t)(
+typedef svn_error_t *(*svn_editor_cb_alter_symlink_t)(
void *baton,
const char *relpath,
svn_revnum_t revision,
+ apr_hash_t *props,
const char *target,
apr_pool_t *scratch_pool);
@@ -619,38 +616,38 @@ svn_editor_setcb_add_absent(svn_editor_t
svn_editor_cb_add_absent_t callback,
apr_pool_t *scratch_pool);
-/** Sets the #svn_editor_cb_set_props_t callback in @a editor
+/** Sets the #svn_editor_cb_alter_directory_t callback in @a editor
* to @a callback.
* @a scratch_pool is used for temporary allocations (if any).
* @see also svn_editor_setcb_many().
* @since New in 1.8.
*/
svn_error_t *
-svn_editor_setcb_set_props(svn_editor_t *editor,
- svn_editor_cb_set_props_t callback,
- apr_pool_t *scratch_pool);
+svn_editor_setcb_alter_directory(svn_editor_t *editor,
+ svn_editor_cb_alter_directory_t callback,
+ apr_pool_t *scratch_pool);
-/** Sets the #svn_editor_cb_set_text_t callback in @a editor
+/** Sets the #svn_editor_cb_alter_file_t callback in @a editor
* to @a callback.
* @a scratch_pool is used for temporary allocations (if any).
* @see also svn_editor_setcb_many().
* @since New in 1.8.
*/
svn_error_t *
-svn_editor_setcb_set_text(svn_editor_t *editor,
- svn_editor_cb_set_text_t callback,
- apr_pool_t *scratch_pool);
+svn_editor_setcb_alter_file(svn_editor_t *editor,
+ svn_editor_cb_alter_file_t callback,
+ apr_pool_t *scratch_pool);
-/** Sets the #svn_editor_cb_set_target_t callback in @a editor
+/** Sets the #svn_editor_cb_alter_symlink_t callback in @a editor
* to @a callback.
* @a scratch_pool is used for temporary allocations (if any).
* @see also svn_editor_setcb_many().
* @since New in 1.8.
*/
svn_error_t *
-svn_editor_setcb_set_target(svn_editor_t *editor,
- svn_editor_cb_set_target_t callback,
- apr_pool_t *scratch_pool);
+svn_editor_setcb_alter_symlink(svn_editor_t *editor,
+ svn_editor_cb_alter_symlink_t callback,
+ apr_pool_t *scratch_pool);
/** Sets the #svn_editor_cb_delete_t callback in @a editor
* to @a callback.
@@ -730,9 +727,9 @@ typedef struct svn_editor_cb_many_t
svn_editor_cb_add_file_t cb_add_file;
svn_editor_cb_add_symlink_t cb_add_symlink;
svn_editor_cb_add_absent_t cb_add_absent;
- svn_editor_cb_set_props_t cb_set_props;
- svn_editor_cb_set_text_t cb_set_text;
- svn_editor_cb_set_target_t cb_set_target;
+ svn_editor_cb_alter_directory_t cb_alter_directory;
+ svn_editor_cb_alter_file_t cb_alter_file;
+ svn_editor_cb_alter_symlink_t cb_alter_symlink;
svn_editor_cb_delete_t cb_delete;
svn_editor_cb_copy_t cb_copy;
svn_editor_cb_move_t cb_move;
@@ -773,7 +770,9 @@ svn_editor_setcb_many(svn_editor_t *edit
*
* A complete listing of the immediate children of @a relpath that will be
* added subsequently is given in @a children. @a children is an array of
- * const char*s, each giving the basename of an immediate child.
+ * const char*s, each giving the basename of an immediate child. It is an
+ * error to pass NULL for @a children; use an empty array to indicate
+ * the new directory will have no children.
*
* For all restrictions on driving the editor, see #svn_editor_t.
*/
@@ -790,17 +789,18 @@ svn_editor_add_directory(svn_editor_t *e
* is expected to exist.
*
* The file's contents are specified in @a contents which has a checksum
- * matching @a checksum.
+ * matching @a checksum. Both values must be non-NULL.
*
* Set the properties of the new file to @a props, which is an
* apr_hash_t holding key-value pairs. Each key is a const char* of a
* property name, each value is a const svn_string_t*. If no properties are
- * being set on the new file, @a props must be NULL.
+ * being set on the new file, @a props must be the empty hash. It is an
+ * error to pass NULL for @a props.
*
* If this add is expected to replace a previously existing file, symlink or
* directory at @a relpath, the revision number of the node to be replaced
* must be given in @a replaces_rev. Otherwise, @a replaces_rev must be
- * SVN_INVALID_REVNUM. Note: it is not allowed to call a "delete" followed
+ * #SVN_INVALID_REVNUM. Note: it is not allowed to call a "delete" followed
* by an "add" on the same path. Instead, an "add" with @a replaces_rev set
* accordingly MUST be used.
*
@@ -851,66 +851,82 @@ svn_editor_add_absent(svn_editor_t *edit
svn_kind_t kind,
svn_revnum_t replaces_rev);
-/** Drive @a editor's #svn_editor_cb_set_props_t callback.
+/** Drive @a editor's #svn_editor_cb_alter_directory_t callback.
*
- * Set or change properties on the existing node at @a relpath. This
- * function sends *all* properties, both existing and changes.
- * ### TODO @todo What is REVISION for?
- * ### HKW: This is puzzling to me as well...
- * ###
- * ### what about "entry props"? will these still be handled via
- * ### the general prop function?
+ * Alter the properties of the directory at @a relpath. @a revision
+ * specifies the expected revision of the directory. This is used to
+ * catched attempts at altering out-of-date directories. If the
+ * directory does not have a corresponding revision in the repository
+ * (e.g. it has not yet been committed), then @a revision should be
+ * #SVN_INVALID_REVNUM.
*
* For a description of @a props, see svn_editor_add_file().
*
- * @a complete must be FALSE if and only if
- * - @a relpath is a file and an svn_editor_set_text() call will follow on
- * the same path, or
- * - @a relpath is a symbolic link and an svn_editor_set_target() call will
- * follow on the same path.
- *
* For all restrictions on driving the editor, see #svn_editor_t.
* @since New in 1.8.
*/
svn_error_t *
-svn_editor_set_props(svn_editor_t *editor,
- const char *relpath,
- svn_revnum_t revision,
- apr_hash_t *props,
- svn_boolean_t complete);
+svn_editor_alter_directory(svn_editor_t *editor,
+ const char *relpath,
+ svn_revnum_t revision,
+ apr_hash_t *props);
-/** Drive @a editor's #svn_editor_cb_set_text_t callback.
+/** Drive @a editor's #svn_editor_cb_alter_file_t callback.
+ *
+ * Alter the properties and/or the contents of the file at @a relpath
+ * with @a revision as its expected revision. See svn_editor_alter_directory()
+ * for more information about @a revision.
+ *
+ * If @a props is non-NULL, then the properties will be applied.
*
- * Set/change the text content of a file at @a relpath to @a contents
- * with checksum @a checksum.
- * ### TODO @todo Does this send the *complete* content, always?
- * ### TODO @todo What is REVISION for?
- * ### TODO @todo Who is responsible for closing the stream?
+ * If @a contents is non-NULL, then the stream will be copied to
+ * the file, and its checksum must match @a checksum (which must also
+ * be non-NULL). If @a contents is NULL, then @a checksum must also
+ * be NULL, and no change will be applied to the file's contents.
+ *
+ * The properties and/or the contents must be changed. It is an error to
+ * pass NULL for @a props, @a checksum, and @a contents.
+ *
+ * For a description of @a checksum, and @a contents see
+ * svn_editor_add_file(). This functions allows @a props to be NULL, but
+ * the parameter is otherwise described by svn_editor_add_file().
*
* For all restrictions on driving the editor, see #svn_editor_t.
* @since New in 1.8.
*/
svn_error_t *
-svn_editor_set_text(svn_editor_t *editor,
- const char *relpath,
- svn_revnum_t revision,
- const svn_checksum_t *checksum,
- svn_stream_t *contents);
+svn_editor_alter_file(svn_editor_t *editor,
+ const char *relpath,
+ svn_revnum_t revision,
+ apr_hash_t *props,
+ const svn_checksum_t *checksum,
+ svn_stream_t *contents);
-/** Drive @a editor's #svn_editor_cb_set_target_t callback.
+/** Drive @a editor's #svn_editor_cb_alter_symlink_t callback.
+ *
+ * Alter the properties and/or the target of the symlink at @a relpath
+ * with @a revision as its expected revision. See svn_editor_alter_directory()
+ * for more information about @a revision.
+ *
+ * If @a props is non-NULL, then the properties will be applied.
*
- * Set/change the link target that a symbolic link at @a relpath points at
- * to @a target.
- * ### TODO @todo What is REVISION for?
+ * If @a target is non-NULL, then the symlink's target will be updated.
+ *
+ * The properties and/or the target must be changed. It is an error to
+ * pass NULL for @a props and @a target.
+ *
+ * This functions allows @a props to be NULL, but the parameter is
+ * otherwise described by svn_editor_add_file().
*
* For all restrictions on driving the editor, see #svn_editor_t.
* @since New in 1.8.
*/
svn_error_t *
-svn_editor_set_target(svn_editor_t *editor,
- const char *relpath,
- svn_revnum_t revision,
- const char *target);
+svn_editor_alter_symlink(svn_editor_t *editor,
+ const char *relpath,
+ svn_revnum_t revision,
+ apr_hash_t *props,
+ const char *target);
/** Drive @a editor's #svn_editor_cb_delete_t callback.
*
@@ -948,20 +964,6 @@ svn_editor_copy(svn_editor_t *editor,
*
* For a description of @a replaces_rev, see svn_editor_add_file().
*
- * ### stsp: How would I describe a merge of revision range rA-rB,
- * ### within which a file foo.c was delete in rN, re-created in rM,
- * ### and then renamed to bar.c in rX?
- * ### Would the following be valid?
- * ### svn_editor_add_file(ed, "foo.c", props, rN);
- * ### svn_editor_move(ed, "foo.c", rM, "bar.c", rN);
- * ###
- * ### gstein: An editor is used to make changes to a tree rather than
- * ### model *how* the tree changed. If the receiver's tree is at
- * ### revision N-1, then the operations would be:
- * ### svn_editor_delete(ed, "foo.c", N-1);
- * ### svn_editor_copy(ed, "foo.c", M, "bar.c", SVN_INVALID_REVNUM);
- * ### That edits the tree to the appropriate state.
- *
* For all restrictions on driving the editor, see #svn_editor_t.
* @since New in 1.8.
*/
@@ -976,7 +978,7 @@ svn_editor_move(svn_editor_t *editor,
*
* Perform a rotation among multiple nodes in the target tree.
*
- * The @relpaths and @revisions arrays (pair-wise) specify nodes in the
+ * The @a relpaths and @a revisions arrays (pair-wise) specify nodes in the
* tree which are located at a path and expected to be at a specific
* revision. These nodes are simultaneously moved in a rotation pattern.
* For example, the node at index 0 of @a relpaths and @a revisions will
Modified: subversion/branches/revprop-packing/subversion/include/svn_error.h
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/include/svn_error.h?rev=1296975&r1=1296974&r2=1296975&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/include/svn_error.h (original)
+++ subversion/branches/revprop-packing/subversion/include/svn_error.h Mon Mar 5 09:25:25 2012
@@ -479,11 +479,16 @@ svn_error_t *svn_error_purge_tracing(svn
*
* @since New in 1.6.
*/
+#ifdef __clang_analyzer__
+#include <assert.h>
+#define SVN_ERR_ASSERT(expr) assert((expr))
+#else
#define SVN_ERR_ASSERT(expr) \
do { \
if (!(expr)) \
SVN_ERR(svn_error__malfunction(TRUE, __FILE__, __LINE__, #expr)); \
} while (0)
+#endif
/** Similar to SVN_ERR_ASSERT(), but without the option of returning
* an error to the calling function.
Modified: subversion/branches/revprop-packing/subversion/include/svn_fs.h
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/include/svn_fs.h?rev=1296975&r1=1296974&r2=1296975&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/include/svn_fs.h (original)
+++ subversion/branches/revprop-packing/subversion/include/svn_fs.h Mon Mar 5 09:25:25 2012
@@ -257,6 +257,10 @@ svn_fs_upgrade(const char *path,
* to the Subversion filesystem located in the directory @a path.
* Use @a pool for necessary allocations.
*
+ * @a start and @a end may be #SVN_INVALID_REVNUM, in which case
+ * svn_repos_verify_fs2()'s semantics apply. When @c r0 is being
+ * verified, global invariants may be verified as well.
+ *
* @note You probably don't want to use this directly. Take a look at
* svn_repos_verify_fs2() instead, which does non-backend-specific
* verifications as well.
@@ -267,7 +271,9 @@ svn_error_t *
svn_fs_verify(const char *path,
svn_cancel_func_t cancel_func,
void *cancel_baton,
- apr_pool_t *pool);
+ svn_revnum_t start,
+ svn_revnum_t end,
+ apr_pool_t *scratch_pool);
/**
* Return, in @a *fs_type, a string identifying the back-end type of
Modified: subversion/branches/revprop-packing/subversion/include/svn_ra_svn.h
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/include/svn_ra_svn.h?rev=1296975&r1=1296974&r2=1296975&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/include/svn_ra_svn.h (original)
+++ subversion/branches/revprop-packing/subversion/include/svn_ra_svn.h Mon Mar 5 09:25:25 2012
@@ -157,6 +157,15 @@ typedef struct svn_ra_svn_item_t
typedef svn_error_t *(*svn_ra_svn_edit_callback)(void *baton);
+/**
+ * Set the shim callbacks to be used by @a conn to @a shim_callbacks.
+ *
+ * @note This is a private API, external consumers should not use it.
+ */
+svn_error_t *
+svn_ra_svn__set_shim_callbacks(svn_ra_svn_conn_t *conn,
+ svn_delta_shim_callbacks_t *shim_callbacks);
+
/** Initialize a connection structure for the given socket or
* input/output files.
*
Modified: subversion/branches/revprop-packing/subversion/include/svn_repos.h
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/include/svn_repos.h?rev=1296975&r1=1296974&r2=1296975&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/include/svn_repos.h (original)
+++ subversion/branches/revprop-packing/subversion/include/svn_repos.h Mon Mar 5 09:25:25 2012
@@ -532,7 +532,7 @@ svn_repos_hotcopy2(const char *src_path,
void *cancel_baton,
apr_pool_t *pool);
-/**
+/**
* Like svn_repos_hotcopy2(), but without the @a incremental parameter
* and without cancellation support.
*
@@ -764,6 +764,17 @@ const char *
svn_repos_post_unlock_hook(svn_repos_t *repos,
apr_pool_t *pool);
+/** Set the environment that @a repos's hooks will inherit to @a hooks_env,
+ * a hash table where keys and values represent names and values of environment
+ * variables. @a hooks_env must live at least as long as @a repos.
+ *
+ * If this function is not called, hooks will run in an empty environment.
+ *
+ * @since New in 1.8. */
+void
+svn_repos_hooks_setenv(svn_repos_t *repos,
+ apr_hash_t *hooks_env);
+
/** @} */
/* ---------------------------------------------------------------*/
@@ -3016,6 +3027,10 @@ svn_repos_authz_read(svn_authz_t **authz
* For compatibility with 1.6, and earlier, @a repos_name can be NULL
* in which case it is equivalent to a @a repos_name of "".
*
+ * @note Presently, @a repos_name must byte-for-byte match the repos_name
+ * specified in the authz file; it is treated as an opaque string, and not
+ * as a dirent.
+ *
* @since New in 1.3.
*/
svn_error_t *
Modified: subversion/branches/revprop-packing/subversion/include/svn_wc.h
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/include/svn_wc.h?rev=1296975&r1=1296974&r2=1296975&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/include/svn_wc.h (original)
+++ subversion/branches/revprop-packing/subversion/include/svn_wc.h Mon Mar 5 09:25:25 2012
@@ -3059,7 +3059,7 @@ svn_wc_entry_dup(const svn_wc_entry_t *e
*/
typedef struct svn_wc_info_t
{
- /** The schedule of this item
+ /** The schedule of this item
* ### Do we still need schedule? */
svn_wc_schedule_t schedule;
@@ -3657,7 +3657,7 @@ typedef struct svn_wc_status3_t
* This will be NULL for moved-here nodes that are just part of a subtree
* that was moved along (and are not themselves a root of a different move
* operation).
- *
+ *
* @since New in 1.8. */
const char *moved_from_abspath;
@@ -4049,6 +4049,10 @@ svn_wc_walk_status(svn_wc_context_t *wc_
apr_pool_t *scratch_pool);
/**
+ * DEPRECATED -- please use APIs from svn_client.h
+ *
+ * ---
+ *
* Set @a *editor and @a *edit_baton to an editor that generates
* #svn_wc_status3_t structures and sends them through @a status_func /
* @a status_baton. @a anchor_abspath is a working copy directory
@@ -4110,7 +4114,9 @@ svn_wc_walk_status(svn_wc_context_t *wc_
* in a subpool of @a result_pool.
*
* @since New in 1.7.
+ * @deprecated Provided for backward compatibility with the 1.7 API.
*/
+SVN_DEPRECATED
svn_error_t *
svn_wc_get_status_editor5(const svn_delta_editor_t **editor,
void **edit_baton,
@@ -5487,6 +5493,10 @@ typedef svn_error_t *(*svn_wc_dirents_fu
/**
+ * DEPRECATED -- please use APIs from svn_client.h
+ *
+ * ---
+ *
* Set @a *editor and @a *edit_baton to an editor and baton for updating a
* working copy.
*
@@ -5560,7 +5570,9 @@ typedef svn_error_t *(*svn_wc_dirents_fu
* before returning the editor to allow using the primary ra session for this.
*
* @since New in 1.7.
+ * @deprecated Provided for backward compatibility with the 1.7 API.
*/
+SVN_DEPRECATED
svn_error_t *
svn_wc_get_update_editor4(const svn_delta_editor_t **editor,
void **edit_baton,
@@ -5691,6 +5703,10 @@ svn_wc_get_update_editor(svn_revnum_t *t
apr_pool_t *pool);
/**
+ * DEPRECATED -- please use APIs from svn_client.h
+ *
+ * ---
+ *
* A variant of svn_wc_get_update_editor4().
*
* Set @a *editor and @a *edit_baton to an editor and baton for "switching"
@@ -5701,7 +5717,9 @@ svn_wc_get_update_editor(svn_revnum_t *t
* All other parameters behave as for svn_wc_get_update_editor4().
*
* @since New in 1.7.
+ * @deprecated Provided for backward compatibility with the 1.7 API.
*/
+SVN_DEPRECATED
svn_error_t *
svn_wc_get_switch_editor4(const svn_delta_editor_t **editor,
void **edit_baton,
@@ -6138,6 +6156,10 @@ svn_wc_canonicalize_svn_prop(const svn_s
*/
/**
+ * DEPRECATED -- please use APIs from svn_client.h
+ *
+ * ---
+ *
* Return an @a editor/@a edit_baton for diffing a working copy against the
* repository. The editor is allocated in @a result_pool; temporary
* calculations are performed in @a scratch_pool.
@@ -6191,7 +6213,9 @@ svn_wc_canonicalize_svn_prop(const svn_s
* editor.
*
* @since New in 1.7.
+ * @deprecated Provided for backward compatibility with the 1.7 API.
*/
+SVN_DEPRECATED
svn_error_t *
svn_wc_get_diff_editor6(const svn_delta_editor_t **editor,
void **edit_baton,
Modified: subversion/branches/revprop-packing/subversion/libsvn_auth_gnome_keyring/gnome_keyring.c
URL: http://svn.apache.org/viewvc/subversion/branches/revprop-packing/subversion/libsvn_auth_gnome_keyring/gnome_keyring.c?rev=1296975&r1=1296974&r2=1296975&view=diff
==============================================================================
--- subversion/branches/revprop-packing/subversion/libsvn_auth_gnome_keyring/gnome_keyring.c (original)
+++ subversion/branches/revprop-packing/subversion/libsvn_auth_gnome_keyring/gnome_keyring.c Mon Mar 5 09:25:25 2012
@@ -230,10 +230,60 @@ unlock_gnome_keyring(const char *keyring
return TRUE;
}
-/* Implementation of password_get_t that retrieves the password
+
+/* There is a race here: this ensures keyring is unlocked just now,
+ but will it still be unlocked when we use it? */
+static svn_error_t *
+ensure_gnome_keyring_is_unlocked(svn_boolean_t non_interactive,
+ apr_hash_t *parameters,
+ apr_pool_t *scratch_pool)
+{
+ const char *default_keyring = get_default_keyring_name(scratch_pool);
+
+ if (! non_interactive)
+ {
+ svn_auth_gnome_keyring_unlock_prompt_func_t unlock_prompt_func =
+ apr_hash_get(parameters,
+ SVN_AUTH_PARAM_GNOME_KEYRING_UNLOCK_PROMPT_FUNC,
+ APR_HASH_KEY_STRING);
+ void *unlock_prompt_baton =
+ apr_hash_get(parameters,
+ SVN_AUTH_PARAM_GNOME_KEYRING_UNLOCK_PROMPT_BATON,
+ APR_HASH_KEY_STRING);
+
+ char *keyring_password;
+
+ if (unlock_prompt_func && check_keyring_is_locked(default_keyring))
+ {
+ SVN_ERR((*unlock_prompt_func)(&keyring_password,
+ default_keyring,
+ unlock_prompt_baton,
+ scratch_pool));
+
+ /* If keyring is locked give up and try the next provider. */
+ if (! unlock_gnome_keyring(default_keyring, keyring_password,
+ scratch_pool))
+ return SVN_NO_ERROR;
+ }
+ }
+ else
+ {
+ if (check_keyring_is_locked(default_keyring))
+ {
+ return svn_error_create(SVN_ERR_AUTHN_CREDS_UNAVAILABLE, NULL,
+ _("GNOME Keyring is locked and "
+ "we are non-interactive"));
+ }
+ }
+
+ return SVN_NO_ERROR;
+}
+
+/* Implementation of svn_auth__password_get_t that retrieves the password
from GNOME Keyring. */
-static svn_boolean_t
-password_get_gnome_keyring(const char **password,
+static svn_error_t *
+password_get_gnome_keyring(svn_boolean_t *done,
+ const char **password,
apr_hash_t *creds,
const char *realmstring,
const char *username,
@@ -244,13 +294,10 @@ password_get_gnome_keyring(const char **
char *default_keyring = NULL;
GnomeKeyringResult result;
GList *items;
- svn_boolean_t ret = FALSE;
- if (! dbus_bus_get(DBUS_BUS_SESSION, NULL))
- return FALSE;
+ *done = FALSE;
- if (! gnome_keyring_is_available())
- return FALSE;
+ SVN_ERR(ensure_gnome_keyring_is_unlocked(non_interactive, parameters, pool));
default_keyring = get_default_keyring_name(pool);
@@ -278,7 +325,7 @@ password_get_gnome_keyring(const char **
if (len > 0)
{
*password = apr_pstrmemdup(pool, item->password, len);
- ret = TRUE;
+ *done = TRUE;
}
}
gnome_keyring_network_password_list_free(items);
@@ -294,13 +341,14 @@ password_get_gnome_keyring(const char **
free(default_keyring);
- return ret;
+ return SVN_NO_ERROR;
}
-/* Implementation of password_set_t that stores the password in
+/* Implementation of svn_auth__password_set_t that stores the password in
GNOME Keyring. */
-static svn_boolean_t
-password_set_gnome_keyring(apr_hash_t *creds,
+static svn_error_t *
+password_set_gnome_keyring(svn_boolean_t *done,
+ apr_hash_t *creds,
const char *realmstring,
const char *username,
const char *password,
@@ -312,11 +360,9 @@ password_set_gnome_keyring(apr_hash_t *c
GnomeKeyringResult result;
guint32 item_id;
- if (! dbus_bus_get(DBUS_BUS_SESSION, NULL))
- return FALSE;
+ *done = FALSE;
- if (! gnome_keyring_is_available())
- return FALSE;
+ SVN_ERR(ensure_gnome_keyring_is_unlocked(non_interactive, parameters, pool));
default_keyring = get_default_keyring_name(pool);
@@ -344,7 +390,8 @@ password_set_gnome_keyring(apr_hash_t *c
free(default_keyring);
- return result == GNOME_KEYRING_RESULT_OK;
+ *done = (result == GNOME_KEYRING_RESULT_OK);
+ return SVN_NO_ERROR;
}
/* Get cached encrypted credentials from the simple provider's cache. */
@@ -356,43 +403,6 @@ simple_gnome_keyring_first_creds(void **
const char *realmstring,
apr_pool_t *pool)
{
- svn_boolean_t non_interactive = apr_hash_get(parameters,
- SVN_AUTH_PARAM_NON_INTERACTIVE,
- APR_HASH_KEY_STRING) != NULL;
- const char *default_keyring = get_default_keyring_name(pool);
- if (! non_interactive)
- {
- svn_auth_gnome_keyring_unlock_prompt_func_t unlock_prompt_func =
- apr_hash_get(parameters,
- SVN_AUTH_PARAM_GNOME_KEYRING_UNLOCK_PROMPT_FUNC,
- APR_HASH_KEY_STRING);
- void *unlock_prompt_baton =
- apr_hash_get(parameters, SVN_AUTH_PARAM_GNOME_KEYRING_UNLOCK_PROMPT_BATON,
- APR_HASH_KEY_STRING);
-
- char *keyring_password;
-
- if (unlock_prompt_func && check_keyring_is_locked(default_keyring))
- {
- SVN_ERR((*unlock_prompt_func)(&keyring_password,
- default_keyring,
- unlock_prompt_baton,
- pool));
-
- /* If keyring is locked give up and try the next provider. */
- if (! unlock_gnome_keyring(default_keyring, keyring_password, pool))
- return SVN_NO_ERROR;
- }
- }
- else
- {
- if (check_keyring_is_locked(default_keyring))
- {
- return svn_error_create(SVN_ERR_AUTHN_CREDS_UNAVAILABLE, NULL,
- _("GNOME Keyring is locked and "
- "we are non-interactive"));
- }
- }
return svn_auth__simple_first_creds_helper
(credentials,
iter_baton, provider_baton,
@@ -411,43 +421,6 @@ simple_gnome_keyring_save_creds(svn_bool
const char *realmstring,
apr_pool_t *pool)
{
- svn_boolean_t non_interactive = apr_hash_get(parameters,
- SVN_AUTH_PARAM_NON_INTERACTIVE,
- APR_HASH_KEY_STRING) != NULL;
- const char *default_keyring = get_default_keyring_name(pool);
- if (! non_interactive)
- {
- svn_auth_gnome_keyring_unlock_prompt_func_t unlock_prompt_func =
- apr_hash_get(parameters,
- SVN_AUTH_PARAM_GNOME_KEYRING_UNLOCK_PROMPT_FUNC,
- APR_HASH_KEY_STRING);
- void *unlock_prompt_baton =
- apr_hash_get(parameters, SVN_AUTH_PARAM_GNOME_KEYRING_UNLOCK_PROMPT_BATON,
- APR_HASH_KEY_STRING);
-
- char *keyring_password;
-
- if (unlock_prompt_func && check_keyring_is_locked(default_keyring))
- {
- SVN_ERR((*unlock_prompt_func)(&keyring_password,
- default_keyring,
- unlock_prompt_baton,
- pool));
-
- /* If keyring is locked give up and try the next provider. */
- if (! unlock_gnome_keyring(default_keyring, keyring_password, pool))
- return SVN_NO_ERROR;
- }
- }
- else
- {
- if (check_keyring_is_locked(default_keyring))
- {
- return svn_error_create(SVN_ERR_AUTHN_CREDS_NOT_SAVED, NULL,
- _("GNOME Keyring is locked and "
- "we are non-interactive"));
- }
- }
return svn_auth__simple_save_creds_helper
(saved, credentials,
provider_baton, parameters,
@@ -518,43 +491,6 @@ ssl_client_cert_pw_gnome_keyring_first_c
const char *realmstring,
apr_pool_t *pool)
{
- svn_boolean_t non_interactive = apr_hash_get(parameters,
- SVN_AUTH_PARAM_NON_INTERACTIVE,
- APR_HASH_KEY_STRING) != NULL;
- const char *default_keyring = get_default_keyring_name(pool);
- if (! non_interactive)
- {
- svn_auth_gnome_keyring_unlock_prompt_func_t unlock_prompt_func =
- apr_hash_get(parameters,
- SVN_AUTH_PARAM_GNOME_KEYRING_UNLOCK_PROMPT_FUNC,
- APR_HASH_KEY_STRING);
- void *unlock_prompt_baton =
- apr_hash_get(parameters, SVN_AUTH_PARAM_GNOME_KEYRING_UNLOCK_PROMPT_BATON,
- APR_HASH_KEY_STRING);
-
- char *keyring_password;
-
- if (unlock_prompt_func && check_keyring_is_locked(default_keyring))
- {
- SVN_ERR((*unlock_prompt_func)(&keyring_password,
- default_keyring,
- unlock_prompt_baton,
- pool));
-
- /* If keyring is locked give up and try the next provider. */
- if (! unlock_gnome_keyring(default_keyring, keyring_password, pool))
- return SVN_NO_ERROR;
- }
- }
- else
- {
- if (check_keyring_is_locked(default_keyring))
- {
- return svn_error_create(SVN_ERR_AUTHN_CREDS_UNAVAILABLE, NULL,
- _("GNOME Keyring is locked and "
- "we are non-interactive"));
- }
- }
return svn_auth__ssl_client_cert_pw_file_first_creds_helper
(credentials,
iter_baton, provider_baton,
@@ -574,43 +510,6 @@ ssl_client_cert_pw_gnome_keyring_save_cr
const char *realmstring,
apr_pool_t *pool)
{
- svn_boolean_t non_interactive = apr_hash_get(parameters,
- SVN_AUTH_PARAM_NON_INTERACTIVE,
- APR_HASH_KEY_STRING) != NULL;
- const char *default_keyring = get_default_keyring_name(pool);
- if (! non_interactive)
- {
- svn_auth_gnome_keyring_unlock_prompt_func_t unlock_prompt_func =
- apr_hash_get(parameters,
- SVN_AUTH_PARAM_GNOME_KEYRING_UNLOCK_PROMPT_FUNC,
- APR_HASH_KEY_STRING);
- void *unlock_prompt_baton =
- apr_hash_get(parameters, SVN_AUTH_PARAM_GNOME_KEYRING_UNLOCK_PROMPT_BATON,
- APR_HASH_KEY_STRING);
-
- char *keyring_password;
-
- if (unlock_prompt_func && check_keyring_is_locked(default_keyring))
- {
- SVN_ERR((*unlock_prompt_func)(&keyring_password,
- default_keyring,
- unlock_prompt_baton,
- pool));
-
- /* If keyring is locked give up and try the next provider. */
- if (! unlock_gnome_keyring(default_keyring, keyring_password, pool))
- return SVN_NO_ERROR;
- }
- }
- else
- {
- if (check_keyring_is_locked(default_keyring))
- {
- return svn_error_create(SVN_ERR_AUTHN_CREDS_NOT_SAVED, NULL,
- _("GNOME Keyring is locked and "
- "we are non-interactive"));
- }
- }
return svn_auth__ssl_client_cert_pw_file_save_creds_helper
(saved, credentials,
provider_baton, parameters,