You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by vm...@apache.org on 2012/06/07 14:57:48 UTC
svn commit: r1347595 [1/5] - in /subversion/branches/javahl-ra: ./
build/generator/ notes/ notes/directory-index/
subversion/bindings/javahl/native/ subversion/include/
subversion/include/private/ subversion/libsvn_auth_kwallet/
subversion/libsvn_clien...
Author: vmpn
Date: Thu Jun 7 12:57:43 2012
New Revision: 1347595
URL: http://svn.apache.org/viewvc?rev=1347595&view=rev
Log:
On the javahl-ra branch:
Bring up-to-date with trunk@1347593
Added:
subversion/branches/javahl-ra/subversion/tests/cmdline/svnsync_authz_tests.py
- copied unchanged from r1347593, subversion/trunk/subversion/tests/cmdline/svnsync_authz_tests.py
subversion/branches/javahl-ra/tools/dev/mergegraph/save_as_sh.py
- copied unchanged from r1347593, subversion/trunk/tools/dev/mergegraph/save_as_sh.py
Modified:
subversion/branches/javahl-ra/ (props changed)
subversion/branches/javahl-ra/build/generator/gen_win.py
subversion/branches/javahl-ra/gen-make.py
subversion/branches/javahl-ra/notes/directory-index/dirindex.py (props changed)
subversion/branches/javahl-ra/notes/directory-index/logimport.py (props changed)
subversion/branches/javahl-ra/notes/ev2-callbacks-template.c (props changed)
subversion/branches/javahl-ra/subversion/bindings/javahl/native/JNIStackElement.cpp
subversion/branches/javahl-ra/subversion/bindings/javahl/native/JNIUtil.h
subversion/branches/javahl-ra/subversion/include/private/svn_delta_private.h (props changed)
subversion/branches/javahl-ra/subversion/include/private/svn_wc_private.h
subversion/branches/javahl-ra/subversion/include/svn_path.h
subversion/branches/javahl-ra/subversion/include/svn_sorts.h
subversion/branches/javahl-ra/subversion/libsvn_auth_kwallet/kwallet.cpp
subversion/branches/javahl-ra/subversion/libsvn_client/client.h
subversion/branches/javahl-ra/subversion/libsvn_client/diff.c
subversion/branches/javahl-ra/subversion/libsvn_client/export.c
subversion/branches/javahl-ra/subversion/libsvn_client/merge.c
subversion/branches/javahl-ra/subversion/libsvn_client/mergeinfo.c
subversion/branches/javahl-ra/subversion/libsvn_client/prop_commands.c
subversion/branches/javahl-ra/subversion/libsvn_client/ra.c
subversion/branches/javahl-ra/subversion/libsvn_client/switch.c
subversion/branches/javahl-ra/subversion/libsvn_client/util.c
subversion/branches/javahl-ra/subversion/libsvn_delta/compat.c
subversion/branches/javahl-ra/subversion/libsvn_delta/deprecated.c (props changed)
subversion/branches/javahl-ra/subversion/libsvn_fs/editor.c (contents, props changed)
subversion/branches/javahl-ra/subversion/libsvn_fs_fs/dag.c
subversion/branches/javahl-ra/subversion/libsvn_fs_fs/fs_fs.c
subversion/branches/javahl-ra/subversion/libsvn_fs_fs/lock.c
subversion/branches/javahl-ra/subversion/libsvn_ra/editor.c (props changed)
subversion/branches/javahl-ra/subversion/libsvn_ra_serf/blame.c
subversion/branches/javahl-ra/subversion/libsvn_ra_serf/get_deleted_rev.c
subversion/branches/javahl-ra/subversion/libsvn_ra_serf/getdate.c
subversion/branches/javahl-ra/subversion/libsvn_ra_serf/getlocations.c
subversion/branches/javahl-ra/subversion/libsvn_ra_serf/getlocationsegments.c
subversion/branches/javahl-ra/subversion/libsvn_ra_serf/getlocks.c
subversion/branches/javahl-ra/subversion/libsvn_ra_serf/locks.c
subversion/branches/javahl-ra/subversion/libsvn_ra_serf/log.c
subversion/branches/javahl-ra/subversion/libsvn_ra_serf/merge.c
subversion/branches/javahl-ra/subversion/libsvn_ra_serf/mergeinfo.c
subversion/branches/javahl-ra/subversion/libsvn_ra_serf/options.c
subversion/branches/javahl-ra/subversion/libsvn_ra_serf/ra_serf.h
subversion/branches/javahl-ra/subversion/libsvn_ra_serf/update.c
subversion/branches/javahl-ra/subversion/libsvn_ra_serf/util.c
subversion/branches/javahl-ra/subversion/libsvn_ra_serf/xml.c
subversion/branches/javahl-ra/subversion/libsvn_ra_svn/client.c
subversion/branches/javahl-ra/subversion/libsvn_ra_svn/editorp.c
subversion/branches/javahl-ra/subversion/libsvn_ra_svn/marshal.c
subversion/branches/javahl-ra/subversion/libsvn_repos/dump.c
subversion/branches/javahl-ra/subversion/libsvn_subr/cache-membuffer.c
subversion/branches/javahl-ra/subversion/libsvn_subr/config_file.c
subversion/branches/javahl-ra/subversion/libsvn_subr/io.c
subversion/branches/javahl-ra/subversion/libsvn_subr/opt.c
subversion/branches/javahl-ra/subversion/libsvn_subr/string.c
subversion/branches/javahl-ra/subversion/libsvn_wc/adm_crawler.c
subversion/branches/javahl-ra/subversion/libsvn_wc/adm_ops.c
subversion/branches/javahl-ra/subversion/libsvn_wc/conflicts.c
subversion/branches/javahl-ra/subversion/libsvn_wc/copy.c
subversion/branches/javahl-ra/subversion/libsvn_wc/deprecated.c
subversion/branches/javahl-ra/subversion/libsvn_wc/diff_local.c
subversion/branches/javahl-ra/subversion/libsvn_wc/lock.c
subversion/branches/javahl-ra/subversion/libsvn_wc/merge.c
subversion/branches/javahl-ra/subversion/libsvn_wc/node.c
subversion/branches/javahl-ra/subversion/libsvn_wc/props.c
subversion/branches/javahl-ra/subversion/libsvn_wc/status.c
subversion/branches/javahl-ra/subversion/libsvn_wc/tree_conflicts.c
subversion/branches/javahl-ra/subversion/libsvn_wc/update_editor.c
subversion/branches/javahl-ra/subversion/libsvn_wc/upgrade.c
subversion/branches/javahl-ra/subversion/libsvn_wc/util.c
subversion/branches/javahl-ra/subversion/libsvn_wc/wc-metadata.sql
subversion/branches/javahl-ra/subversion/libsvn_wc/wc-queries.sql
subversion/branches/javahl-ra/subversion/libsvn_wc/wc_db.c
subversion/branches/javahl-ra/subversion/libsvn_wc/wc_db.h
subversion/branches/javahl-ra/subversion/libsvn_wc/wc_db_pristine.c
subversion/branches/javahl-ra/subversion/libsvn_wc/workqueue.c
subversion/branches/javahl-ra/subversion/libsvn_wc/workqueue.h
subversion/branches/javahl-ra/subversion/svn/cl.h
subversion/branches/javahl-ra/subversion/svn/diff-cmd.c
subversion/branches/javahl-ra/subversion/svn/import-cmd.c
subversion/branches/javahl-ra/subversion/svn/log-cmd.c
subversion/branches/javahl-ra/subversion/svn/main.c
subversion/branches/javahl-ra/subversion/svnserve/serve.c
subversion/branches/javahl-ra/subversion/tests/cmdline/entries-dump.c
subversion/branches/javahl-ra/subversion/tests/cmdline/export_tests.py
subversion/branches/javahl-ra/subversion/tests/cmdline/merge_reintegrate_tests.py
subversion/branches/javahl-ra/subversion/tests/cmdline/merge_symmetric_tests.py
subversion/branches/javahl-ra/subversion/tests/cmdline/revert_tests.py
subversion/branches/javahl-ra/subversion/tests/cmdline/stat_tests.py
subversion/branches/javahl-ra/subversion/tests/cmdline/svnsync_tests.py
subversion/branches/javahl-ra/subversion/tests/cmdline/svnsync_tests_data/svnsync-trunk-A-changes.dump
subversion/branches/javahl-ra/subversion/tests/cmdline/svnsync_tests_data/svnsync-trunk-A-changes.expected.dump
subversion/branches/javahl-ra/subversion/tests/cmdline/svnsync_tests_data/svnsync-trunk-only.dump
subversion/branches/javahl-ra/subversion/tests/cmdline/svnsync_tests_data/svnsync-trunk-only.expected.dump
subversion/branches/javahl-ra/subversion/tests/cmdline/svntest/actions.py
subversion/branches/javahl-ra/subversion/tests/cmdline/svntest/main.py
subversion/branches/javahl-ra/subversion/tests/cmdline/update_tests.py
subversion/branches/javahl-ra/subversion/tests/libsvn_client/client-test.c
subversion/branches/javahl-ra/subversion/tests/libsvn_delta/random-test.c
subversion/branches/javahl-ra/subversion/tests/libsvn_subr/dirent_uri-test.c
subversion/branches/javahl-ra/subversion/tests/libsvn_wc/utils.c
subversion/branches/javahl-ra/subversion/tests/libsvn_wc/wc-queries-test.c
subversion/branches/javahl-ra/tools/buildbot/slaves/bb-openbsd/svnbuild.sh
subversion/branches/javahl-ra/tools/buildbot/slaves/centos/svnbuild.sh
subversion/branches/javahl-ra/tools/buildbot/slaves/win32-SharpSvn/svntest-test.cmd
subversion/branches/javahl-ra/tools/client-side/mergeinfo-sanitizer.py (props changed)
subversion/branches/javahl-ra/tools/dev/gdb-py/svndbg/__init__.py (props changed)
subversion/branches/javahl-ra/tools/dev/gdb-py/svndbg/printers.py (props changed)
subversion/branches/javahl-ra/tools/dev/histogram.py (props changed)
subversion/branches/javahl-ra/tools/dev/mergegraph/mergegraph.py
subversion/branches/javahl-ra/tools/dev/sbox-ospath.py (props changed)
subversion/branches/javahl-ra/tools/dev/unix-build/Makefile.svn
subversion/branches/javahl-ra/tools/server-side/svnauthz-validate.c
subversion/branches/javahl-ra/tools/server-side/svnpredumpfilter.py (props changed)
subversion/branches/javahl-ra/tools/server-side/svnpubsub/commit-hook.py (props changed)
subversion/branches/javahl-ra/tools/server-side/svnpubsub/daemonize.py (props changed)
subversion/branches/javahl-ra/tools/server-side/svnpubsub/svnpubsub/__init__.py (props changed)
subversion/branches/javahl-ra/tools/server-side/svnpubsub/svnpubsub/client.py (props changed)
subversion/branches/javahl-ra/tools/server-side/svnpubsub/svnpubsub/server.py (props changed)
subversion/branches/javahl-ra/tools/server-side/svnpubsub/svntweet.py (props changed)
subversion/branches/javahl-ra/tools/server-side/svnpubsub/svnwcsub.py (props changed)
subversion/branches/javahl-ra/tools/server-side/svnpubsub/testserver.py (props changed)
subversion/branches/javahl-ra/tools/server-side/svnpubsub/watcher.py (props changed)
subversion/branches/javahl-ra/win-tests.py
Propchange: subversion/branches/javahl-ra/
------------------------------------------------------------------------------
Merged /subversion/trunk:r1342811-1347593
Modified: subversion/branches/javahl-ra/build/generator/gen_win.py
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/build/generator/gen_win.py?rev=1347595&r1=1347594&r2=1347595&view=diff
==============================================================================
--- subversion/branches/javahl-ra/build/generator/gen_win.py (original)
+++ subversion/branches/javahl-ra/build/generator/gen_win.py Thu Jun 7 12:57:43 2012
@@ -188,8 +188,8 @@ class GeneratorBase(gen_base.GeneratorBa
self.sln_version = '11.00'
self.vcproj_version = '10.0'
self.vcproj_extension = '.vcxproj'
- elif val == '11':
- self.vs_version = '11'
+ elif val == '2012' or val == '11':
+ self.vs_version = '2012'
self.sln_version = '12.00'
self.vcproj_version = '11.0'
self.vcproj_extension = '.vcxproj'
Modified: subversion/branches/javahl-ra/gen-make.py
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/gen-make.py?rev=1347595&r1=1347594&r2=1347595&view=diff
==============================================================================
--- subversion/branches/javahl-ra/gen-make.py (original)
+++ subversion/branches/javahl-ra/gen-make.py Thu Jun 7 12:57:43 2012
@@ -211,7 +211,7 @@ def _usage_exit(err=None):
print(" Use static apr and apr-util")
print("")
print(" --vsnet-version=VER")
- print(" generate for VS.NET version VER (2002, 2003, 2005, 2008 or 2010)")
+ print(" generate for VS.NET version VER (2002, 2003, 2005, 2008, 2010 or 2012)")
print(" [only valid in combination with '-t vcproj']")
print("")
print(" --with-apr_memcache=DIR")
Propchange: subversion/branches/javahl-ra/notes/directory-index/dirindex.py
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: subversion/branches/javahl-ra/notes/directory-index/logimport.py
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: subversion/branches/javahl-ra/notes/ev2-callbacks-template.c
------------------------------------------------------------------------------
svn:eol-style = native
Modified: subversion/branches/javahl-ra/subversion/bindings/javahl/native/JNIStackElement.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/bindings/javahl/native/JNIStackElement.cpp?rev=1347595&r1=1347594&r2=1347595&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/bindings/javahl/native/JNIStackElement.cpp (original)
+++ subversion/branches/javahl-ra/subversion/bindings/javahl/native/JNIStackElement.cpp Thu Jun 7 12:57:43 2012
@@ -58,20 +58,28 @@ JNIStackElement::JNIStackElement(JNIEnv
return;
}
- // This will call java.lang.Object.toString, even when it is
- // overriden.
- jobject oStr = env->CallNonvirtualObjectMethod(jthis, jlo, mid);
- if (JNIUtil::isJavaExceptionThrown())
- return;
-
- // Copy the result to a buffer.
- JNIStringHolder name(reinterpret_cast<jstring>(oStr));
*m_objectID = 0;
- strncat(m_objectID, name, JNIUtil::formatBufferSize -1);
+
+ if(jthis == NULL)
+ {
+ strcpy(m_objectID, "<static>");
+ }
+ else
+ {
+ // This will call java.lang.Object.toString, even when it is
+ // overriden.
+ jobject oStr = env->CallNonvirtualObjectMethod(jthis, jlo, mid);
+ if (JNIUtil::isJavaExceptionThrown())
+ return;
+
+ // Copy the result to a buffer.
+ JNIStringHolder name(reinterpret_cast<jstring>(oStr));
+ strncat(m_objectID, name, JNIUtil::formatBufferSize -1);
+ env->DeleteLocalRef(oStr);
+ }
// Release the Java string.
env->DeleteLocalRef(jlo);
- env->DeleteLocalRef(oStr);
// Remember the parameter for the exit of the method.
m_clazz = clazz;
Modified: subversion/branches/javahl-ra/subversion/bindings/javahl/native/JNIUtil.h
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/bindings/javahl/native/JNIUtil.h?rev=1347595&r1=1347594&r2=1347595&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/bindings/javahl/native/JNIUtil.h (original)
+++ subversion/branches/javahl-ra/subversion/bindings/javahl/native/JNIUtil.h Thu Jun 7 12:57:43 2012
@@ -215,9 +215,9 @@ class JNIUtil
*/
#define SVN_JNI_NULL_PTR_EX(expr, str, ret_val) \
- if (expr == NULL) { \
+ if ((expr) == NULL) { \
JNIUtil::throwNullPointerException(str); \
- return ret_val ; \
+ return ret_val; \
}
/**
@@ -236,7 +236,7 @@ class JNIUtil
svn_error_t *svn_jni_err__temp = (expr); \
if (svn_jni_err__temp != SVN_NO_ERROR) { \
JNIUtil::handleSVNError(svn_jni_err__temp); \
- return ret_val ; \
+ return ret_val; \
} \
} while (0)
@@ -252,7 +252,7 @@ class JNIUtil
do \
{ \
env->PopLocalFrame(NULL); \
- return ret_val ; \
+ return ret_val; \
} \
while (0)
Propchange: subversion/branches/javahl-ra/subversion/include/private/svn_delta_private.h
------------------------------------------------------------------------------
svn:eol-style = native
Modified: subversion/branches/javahl-ra/subversion/include/private/svn_wc_private.h
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/include/private/svn_wc_private.h?rev=1347595&r1=1347594&r2=1347595&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/include/private/svn_wc_private.h (original)
+++ subversion/branches/javahl-ra/subversion/include/private/svn_wc_private.h Thu Jun 7 12:57:43 2012
@@ -916,6 +916,20 @@ svn_wc__prop_list_recursive(svn_wc_conte
void *cancel_baton,
apr_pool_t *scratch_pool);
+/** Obtain a mapping of const char * local_abspaths to const svn_string_t*
+ * property values in *VALUES, of all PROPNAME properties on LOCAL_ABSPATH
+ * and its descendants.
+ *
+ * Allocate the result in RESULT_POOL, and perform temporary allocations in
+ * SCRATCH_POOL.
+ */
+svn_error_t *
+svn_wc__prop_retrieve_recursive(apr_hash_t **values,
+ svn_wc_context_t *wc_ctx,
+ const char *local_abspath,
+ const char *propname,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
/**
* For use by entries.c and entries-dump.c to read old-format working copies.
Modified: subversion/branches/javahl-ra/subversion/include/svn_path.h
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/include/svn_path.h?rev=1347595&r1=1347594&r2=1347595&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/include/svn_path.h (original)
+++ subversion/branches/javahl-ra/subversion/include/svn_path.h Thu Jun 7 12:57:43 2012
@@ -296,6 +296,10 @@ svn_path_is_canonical(const char *path,
/** Return an integer greater than, equal to, or less than 0, according
* as @a path1 is greater than, equal to, or less than @a path2.
+ *
+ * This function works like strcmp() except that it orders children in
+ * subdirectories directly after their parents. This allows using the
+ * given ordering for a depth first walk.
*/
int
svn_path_compare_paths(const char *path1, const char *path2);
Modified: subversion/branches/javahl-ra/subversion/include/svn_sorts.h
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/include/svn_sorts.h?rev=1347595&r1=1347594&r2=1347595&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/include/svn_sorts.h (original)
+++ subversion/branches/javahl-ra/subversion/include/svn_sorts.h Thu Jun 7 12:57:43 2012
@@ -80,6 +80,13 @@ typedef struct svn_sort__item_t {
apr_array_header_t *array;
array = svn_sort__hash(hsh, svn_sort_compare_items_as_paths, pool);
@endcode
+ *
+ * This function works like svn_sort_compare_items_lexically() except that it
+ * orders children in subdirectories directly after their parents. This allows
+ * using the given ordering for a depth first walk, but at a performance
+ * penalty. Code that doesn't need this special behavior for children, e.g. when
+ * sorting files at a single directory level should use
+ * svn_sort_compare_items_lexically() instead.
*/
int
svn_sort_compare_items_as_paths(const svn_sort__item_t *a,
Modified: subversion/branches/javahl-ra/subversion/libsvn_auth_kwallet/kwallet.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_auth_kwallet/kwallet.cpp?rev=1347595&r1=1347594&r2=1347595&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_auth_kwallet/kwallet.cpp (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_auth_kwallet/kwallet.cpp Thu Jun 7 12:57:43 2012
@@ -60,6 +60,9 @@
/* KWallet simple provider, puts passwords in KWallet */
/*-----------------------------------------------------------------------*/
+static int q_argc = 1;
+static char q_argv0[] = "svn"; // Build non-const char * from string constant
+static char *q_argv[] = { q_argv0 };
static const char *
get_application_name(apr_hash_t *parameters,
@@ -212,12 +215,11 @@ kwallet_password_get(svn_boolean_t *done
QCoreApplication *app;
if (! qApp)
{
- int argc = 1;
- app = new QCoreApplication(argc, (char *[1]) {(char *) "svn"});
+ int argc = q_argc;
+ app = new QCoreApplication(argc, q_argv);
}
- KCmdLineArgs::init(1,
- (char *[1]) {(char *) "svn"},
+ KCmdLineArgs::init(q_argc, q_argv,
get_application_name(parameters, pool),
"subversion",
ki18n(get_application_name(parameters, pool)),
@@ -289,12 +291,11 @@ kwallet_password_set(svn_boolean_t *done
QCoreApplication *app;
if (! qApp)
{
- int argc = 1;
- app = new QCoreApplication(argc, (char *[1]) {(char *) "svn"});
+ int argc = q_argc;
+ app = new QCoreApplication(argc, q_argv);
}
- KCmdLineArgs::init(1,
- (char *[1]) {(char *) "svn"},
+ KCmdLineArgs::init(q_argc, q_argv,
get_application_name(parameters, pool),
"subversion",
ki18n(get_application_name(parameters, pool)),
Modified: subversion/branches/javahl-ra/subversion/libsvn_client/client.h
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_client/client.h?rev=1347595&r1=1347594&r2=1347595&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_client/client.h (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_client/client.h Thu Jun 7 12:57:43 2012
@@ -198,6 +198,9 @@ svn_client__repos_location_segments(apr_
LOC1 and LOC2. If the locations have no common ancestor (including if
they don't have the same repository root URL), set *ANCESTOR_P to NULL.
+ If SESSION is not NULL, use it for retrieving the common ancestor instead
+ of creating a new session.
+
Use the authentication baton cached in CTX to authenticate against
the repository. Use POOL for all allocations.
@@ -207,6 +210,7 @@ svn_error_t *
svn_client__get_youngest_common_ancestor(svn_client__pathrev_t **ancestor_p,
const svn_client__pathrev_t *loc1,
const svn_client__pathrev_t *loc2,
+ svn_ra_session_t *session,
svn_client_ctx_t *ctx,
apr_pool_t *result_pool,
apr_pool_t *scratch_pool);
@@ -272,40 +276,6 @@ svn_client__ensure_ra_session_url(const
const char *session_url,
apr_pool_t *pool);
-/* Return the path of ABSPATH_OR_URL relative to the repository root
- in REL_PATH (URI-decoded), allocated in RESULT_POOL.
- If INCLUDE_LEADING_SLASH is set, the returned result will have a leading
- slash; otherwise, it will not.
-
- REPOS_ROOT and RA_SESSION may be NULL if ABSPATH_OR_URL is a WC path,
- otherwise at least one of them must be non-null.
-
- CAUTION: While having a leading slash on a so-called relative path
- might work out well for functionality that interacts with
- mergeinfo, it results in a relative path that cannot be naively
- svn_path_join()'d with a repository root URL to provide a full URL.
-
- Use SCRATCH_POOL for temporary allocations.
-*/
-svn_error_t *
-svn_client__path_relative_to_root(const char **rel_path,
- svn_wc_context_t *wc_ctx,
- const char *abspath_or_url,
- const char *repos_root,
- svn_boolean_t include_leading_slash,
- svn_ra_session_t *ra_session,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool);
-
-/* A default error handler for use with svn_wc_walk_entries3(). Returns
- ERR in all cases. */
-svn_error_t *
-svn_client__default_walker_error_handler(const char *path,
- svn_error_t *err,
- void *walk_baton,
- apr_pool_t *pool);
-
-
/* ---------------------------------------------------------------- */
/*** RA callbacks ***/
Modified: subversion/branches/javahl-ra/subversion/libsvn_client/diff.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_client/diff.c?rev=1347595&r1=1347594&r2=1347595&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_client/diff.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_client/diff.c Thu Jun 7 12:57:43 2012
@@ -2729,9 +2729,7 @@ diff_repos_repos(const svn_wc_diff_callb
* target (either svn_node_file or svn_node_none). REV is the revision the
* working file is diffed against. RA_SESSION points at the URL of the file
* in the repository and is used to get the file's repository-version content,
- * if necessary. If DIFF_WITH_BASE is set, diff against the BASE version of
- * the local file instead of WORKING.
- * The other parameters are as in diff_repos_wc(). */
+ * if necessary. The other parameters are as in diff_repos_wc(). */
static svn_error_t *
diff_repos_wc_file_target(const char *target,
const char *file2_abspath,
@@ -2739,7 +2737,6 @@ diff_repos_wc_file_target(const char *ta
svn_revnum_t rev,
svn_boolean_t reverse,
svn_boolean_t show_copies_as_adds,
- svn_boolean_t diff_with_base,
const svn_wc_diff_callbacks4_t *callbacks,
void *callback_baton,
svn_ra_session_t *ra_session,
@@ -2752,6 +2749,10 @@ diff_repos_wc_file_target(const char *ta
apr_hash_t *file1_props = NULL;
apr_hash_t *file2_props;
svn_boolean_t is_copy = FALSE;
+ apr_hash_t *keywords = NULL;
+ svn_string_t *keywords_prop;
+ svn_subst_eol_style_t eol_style;
+ const char *eol_str;
/* Get content and props of file 1 (the remote file). */
SVN_ERR(svn_stream_open_unique(&file1_content, &file1_abspath, NULL,
@@ -2772,73 +2773,40 @@ diff_repos_wc_file_target(const char *ta
SVN_ERR(svn_stream_close(file1_content));
- /* Get content and props of file 2 (the local file). */
- if (diff_with_base)
+ SVN_ERR(svn_wc_prop_list2(&file2_props, ctx->wc_ctx, file2_abspath,
+ scratch_pool, scratch_pool));
+
+ /* We might have to create a normalised version of the working file. */
+ svn_subst_eol_style_from_value(&eol_style, &eol_str,
+ apr_hash_get(file2_props,
+ SVN_PROP_EOL_STYLE,
+ APR_HASH_KEY_STRING));
+ keywords_prop = apr_hash_get(file2_props, SVN_PROP_KEYWORDS,
+ APR_HASH_KEY_STRING);
+ if (keywords_prop)
+ SVN_ERR(svn_subst_build_keywords2(&keywords, keywords_prop->data,
+ NULL, NULL, 0, NULL,
+ scratch_pool));
+ if (svn_subst_translation_required(eol_style, SVN_SUBST_NATIVE_EOL_STR,
+ keywords, FALSE, TRUE))
{
- svn_stream_t *pristine_content;
+ svn_stream_t *working_content;
+ svn_stream_t *normalized_content;
- SVN_ERR(svn_wc_get_pristine_props(&file2_props, ctx->wc_ctx,
- file2_abspath, scratch_pool,
- scratch_pool));
-
- /* ### We need a filename, but this API returns an opaque stream.
- * ### This requires us to copy to a temporary file. Maybe libsvn_wc
- * ### should also provide an API that returns a path to a file that
- * ### contains pristine content, possibly temporary? */
- SVN_ERR(svn_wc_get_pristine_contents2(&pristine_content,
- ctx->wc_ctx,
- file2_abspath,
- scratch_pool, scratch_pool));
+ SVN_ERR(svn_stream_open_readonly(&working_content, file2_abspath,
+ scratch_pool, scratch_pool));
+ /* Create a temporary file and copy normalised data into it. */
SVN_ERR(svn_stream_open_unique(&file2_content, &file2_abspath, NULL,
svn_io_file_del_on_pool_cleanup,
scratch_pool, scratch_pool));
- SVN_ERR(svn_stream_copy3(pristine_content, file2_content,
+ normalized_content = svn_subst_stream_translated(
+ file2_content, SVN_SUBST_NATIVE_EOL_STR,
+ TRUE, keywords, FALSE, scratch_pool);
+ SVN_ERR(svn_stream_copy3(working_content, normalized_content,
ctx->cancel_func, ctx->cancel_baton,
scratch_pool));
}
- else
- {
- apr_hash_t *keywords = NULL;
- svn_string_t *keywords_prop;
- svn_subst_eol_style_t eol_style;
- const char *eol_str;
-
- SVN_ERR(svn_wc_prop_list2(&file2_props, ctx->wc_ctx, file2_abspath,
- scratch_pool, scratch_pool));
-
- /* We might have to create a normalised version of the working file. */
- svn_subst_eol_style_from_value(&eol_style, &eol_str,
- apr_hash_get(file2_props,
- SVN_PROP_EOL_STYLE,
- APR_HASH_KEY_STRING));
- keywords_prop = apr_hash_get(file2_props, SVN_PROP_KEYWORDS,
- APR_HASH_KEY_STRING);
- if (keywords_prop)
- SVN_ERR(svn_subst_build_keywords2(&keywords, keywords_prop->data,
- NULL, NULL, 0, NULL,
- scratch_pool));
- if (svn_subst_translation_required(eol_style, SVN_SUBST_NATIVE_EOL_STR,
- keywords, FALSE, TRUE))
- {
- svn_stream_t *working_content;
- svn_stream_t *normalized_content;
-
- SVN_ERR(svn_stream_open_readonly(&working_content, file2_abspath,
- scratch_pool, scratch_pool));
-
- /* Create a temporary file and copy normalised data into it. */
- SVN_ERR(svn_stream_open_unique(&file2_content, &file2_abspath, NULL,
- svn_io_file_del_on_pool_cleanup,
- scratch_pool, scratch_pool));
- normalized_content = svn_subst_stream_translated(
- file2_content, SVN_SUBST_NATIVE_EOL_STR,
- TRUE, keywords, FALSE, scratch_pool);
- SVN_ERR(svn_stream_copy3(working_content, normalized_content,
- ctx->cancel_func, ctx->cancel_baton,
- scratch_pool));
- }
- }
if (kind1 == svn_node_file && !(show_copies_as_adds && is_copy))
{
@@ -3038,21 +3006,36 @@ diff_repos_wc(const char *path_or_url1,
else
callback_baton->revnum2 = rev;
- /* If both diff targets can be diffed as files, fetch the file from the
- * repository and generate a diff against the local version of the file. */
- if ((kind1 == svn_node_file || kind1 == svn_node_none)
+ /* Check if our diff target is a copied node. */
+ SVN_ERR(svn_wc__node_get_origin(&is_copy,
+ ©from_rev,
+ ©_source_repos_relpath,
+ ©_source_repos_root_url,
+ NULL, NULL,
+ ctx->wc_ctx, abspath2,
+ FALSE, pool, pool));
+
+ /* If both diff targets can be diffed as files, fetch the appropriate
+ * file content from the repository and generate a diff against the
+ * local version of the file.
+ * However, if comparing the repository version of the file to the BASE
+ * tree version we can use the diff editor to transmit a delta instead
+ * of potentially huge file content. */
+ if ((!rev2_is_base || is_copy) &&
+ (kind1 == svn_node_file || kind1 == svn_node_none)
&& kind2 == svn_node_file)
{
SVN_ERR(diff_repos_wc_file_target(target, abspath2, kind1, rev,
reverse, show_copies_as_adds,
- rev2_is_base,
callbacks, callback_baton,
ra_session, ctx, pool));
return SVN_NO_ERROR;
}
- /* Else, use the diff editor to generate the diff. */
+ /* Use the diff editor to generate the diff. */
+ SVN_ERR(svn_ra_has_capability(ra_session, &server_supports_depth,
+ SVN_RA_CAPABILITY_DEPTH, pool));
SVN_ERR(svn_wc__get_diff_editor(&diff_editor, &diff_edit_baton,
ctx->wc_ctx,
anchor_abspath,
@@ -3069,22 +3052,12 @@ diff_repos_wc(const char *path_or_url1,
ctx->cancel_func, ctx->cancel_baton,
pool, pool));
SVN_ERR(svn_ra_reparent(ra_session, anchor_url, pool));
- SVN_ERR(svn_ra_has_capability(ra_session, &server_supports_depth,
- SVN_RA_CAPABILITY_DEPTH, pool));
if (depth != svn_depth_infinity)
diff_depth = depth;
else
diff_depth = svn_depth_unknown;
- /* Check if our diff target is a copied node. */
- SVN_ERR(svn_wc__node_get_origin(&is_copy,
- ©from_rev,
- ©_source_repos_relpath,
- ©_source_repos_root_url,
- NULL, NULL,
- ctx->wc_ctx, abspath2,
- FALSE, pool, pool));
if (is_copy)
{
const char *copyfrom_url;
Modified: subversion/branches/javahl-ra/subversion/libsvn_client/export.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_client/export.c?rev=1347595&r1=1347594&r2=1347595&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_client/export.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_client/export.c Thu Jun 7 12:57:43 2012
@@ -151,15 +151,31 @@ append_basename_if_dir(const char **appe
* Set the destination file's 'executable' flag according to the source
* file's 'svn:executable' property.
*/
+
+/* baton for export_node */
+struct export_info_baton
+{
+ const char *to_path;
+ const svn_opt_revision_t *revision;
+ svn_boolean_t ignore_keywords;
+ svn_boolean_t overwrite;
+ svn_wc_context_t *wc_ctx;
+ const char *native_eol;
+ svn_wc_notify_func2_t notify_func;
+ void *notify_baton;
+ const char *origin_abspath;
+ svn_boolean_t exported;
+};
+
+/* Export a file or directory. Implements svn_wc_status_func4_t */
static svn_error_t *
-copy_one_versioned_file(const char *from_abspath,
- const char *to_abspath,
- svn_client_ctx_t *ctx,
- const svn_opt_revision_t *revision,
- const char *native_eol,
- svn_boolean_t ignore_keywords,
- apr_pool_t *scratch_pool)
+export_node(void *baton,
+ const char *local_abspath,
+ const svn_wc_status3_t *status,
+ apr_pool_t *scratch_pool)
{
+ struct export_info_baton *eib = baton;
+ svn_wc_context_t *wc_ctx = eib->wc_ctx;
apr_hash_t *kw = NULL;
svn_subst_eol_style_t style;
apr_hash_t *props;
@@ -171,19 +187,106 @@ copy_one_versioned_file(const char *from
svn_stream_t *dst_stream;
const char *dst_tmp;
svn_error_t *err;
- svn_boolean_t is_deleted;
- svn_wc_context_t *wc_ctx = ctx->wc_ctx;
+
+ const char *to_abspath = svn_dirent_join(
+ eib->to_path,
+ svn_dirent_skip_ancestor(eib->origin_abspath,
+ local_abspath),
+ scratch_pool);
- SVN_ERR(svn_wc__node_is_status_deleted(&is_deleted, wc_ctx, from_abspath,
- scratch_pool));
+ eib->exported = TRUE;
/* Don't export 'deleted' files and directories unless it's a
revision other than WORKING. These files and directories
don't really exist in WORKING. */
- if (revision->kind == svn_opt_revision_working && is_deleted)
+ if (eib->revision->kind == svn_opt_revision_working
+ && status->node_status == svn_wc_status_deleted)
return SVN_NO_ERROR;
- if (revision->kind != svn_opt_revision_working)
+ if (status->kind == svn_node_dir)
+ {
+ apr_fileperms_t perm = APR_OS_DEFAULT;
+
+ /* Try to make the new directory. If this fails because the
+ directory already exists, check our FORCE flag to see if we
+ care. */
+
+ /* Keep the source directory's permissions if applicable.
+ Skip retrieving the umask on windows. Apr does not implement setting
+ filesystem privileges on Windows.
+ Retrieving the file permissions with APR_FINFO_PROT | APR_FINFO_OWNER
+ is documented to be 'incredibly expensive' */
+#ifndef WIN32
+ if (eib->revision->kind == svn_opt_revision_working)
+ {
+ apr_finfo_t finfo;
+ SVN_ERR(svn_io_stat(&finfo, local_abspath, APR_FINFO_PROT,
+ scratch_pool));
+ perm = finfo.protection;
+ }
+#endif
+ err = svn_io_dir_make(to_abspath, perm, scratch_pool);
+ if (err)
+ {
+ if (! APR_STATUS_IS_EEXIST(err->apr_err))
+ return svn_error_trace(err);
+ if (! eib->overwrite)
+ SVN_ERR_W(err, _("Destination directory exists, and will not be "
+ "overwritten unless forced"));
+ else
+ svn_error_clear(err);
+ }
+
+ if (eib->notify_func
+ && (strcmp(eib->origin_abspath, local_abspath) != 0))
+ {
+ svn_wc_notify_t *notify =
+ svn_wc_create_notify(to_abspath,
+ svn_wc_notify_update_add, scratch_pool);
+
+ notify->kind = svn_node_dir;
+ (eib->notify_func)(eib->notify_baton, notify, scratch_pool);
+ }
+
+ return SVN_NO_ERROR;
+ }
+ else if (status->kind != svn_node_file)
+ {
+ if (strcmp(eib->origin_abspath, local_abspath) != 0)
+ return SVN_NO_ERROR;
+
+ return svn_error_createf(SVN_ERR_WC_PATH_NOT_FOUND, NULL,
+ _("The node '%s' was not found."),
+ svn_dirent_local_style(local_abspath,
+ scratch_pool));
+ }
+
+ if (status->file_external)
+ return SVN_NO_ERROR;
+
+ /* Produce overwrite errors for the export root */
+ if (strcmp(local_abspath, eib->origin_abspath) == 0)
+ {
+ svn_node_kind_t to_kind;
+
+ SVN_ERR(svn_io_check_path(to_abspath, &to_kind, scratch_pool));
+
+ if ((to_kind == svn_node_file || to_kind == svn_node_unknown)
+ && !eib->overwrite)
+ return svn_error_createf(SVN_ERR_ILLEGAL_TARGET, NULL,
+ _("Destination file '%s' exists, and "
+ "will not be overwritten unless forced"),
+ svn_dirent_local_style(to_abspath,
+ scratch_pool));
+ else if (to_kind == svn_node_dir)
+ return svn_error_createf(SVN_ERR_ILLEGAL_TARGET, NULL,
+ _("Destination '%s' exists. Cannot "
+ "overwrite directory with non-directory"),
+ svn_dirent_local_style(to_abspath,
+ scratch_pool));
+ }
+
+ if (eib->revision->kind != svn_opt_revision_working)
{
/* Only export 'added' files when the revision is WORKING. This is not
WORKING, so skip the 'added' files, since they didn't exist
@@ -208,28 +311,24 @@ copy_one_versioned_file(const char *from
We get all this for free from evaluating SOURCE == NULL:
*/
- SVN_ERR(svn_wc_get_pristine_contents2(&source, wc_ctx, from_abspath,
+ SVN_ERR(svn_wc_get_pristine_contents2(&source, wc_ctx, local_abspath,
scratch_pool, scratch_pool));
if (source == NULL)
return SVN_NO_ERROR;
- SVN_ERR(svn_wc_get_pristine_props(&props, wc_ctx, from_abspath,
+ SVN_ERR(svn_wc_get_pristine_props(&props, wc_ctx, local_abspath,
scratch_pool, scratch_pool));
}
else
{
- svn_wc_status3_t *status;
-
/* ### hmm. this isn't always a specialfile. this will simply open
### the file readonly if it is a regular file. */
- SVN_ERR(svn_subst_read_specialfile(&source, from_abspath, scratch_pool,
+ SVN_ERR(svn_subst_read_specialfile(&source, local_abspath, scratch_pool,
scratch_pool));
- SVN_ERR(svn_wc_prop_list2(&props, wc_ctx, from_abspath, scratch_pool,
+ SVN_ERR(svn_wc_prop_list2(&props, wc_ctx, local_abspath, scratch_pool,
scratch_pool));
- SVN_ERR(svn_wc_status3(&status, wc_ctx, from_abspath, scratch_pool,
- scratch_pool));
- if (status->text_status != svn_wc_status_normal)
+ if (status->node_status != svn_wc_status_normal)
local_mod = TRUE;
}
@@ -240,6 +339,7 @@ copy_one_versioned_file(const char *from
{
/* Create the destination as a special file, and copy the source
details into the destination stream. */
+ /* ### And forget the notification */
SVN_ERR(svn_subst_create_specialfile(&dst_stream, to_abspath,
scratch_pool, scratch_pool));
return svn_error_trace(
@@ -255,32 +355,27 @@ copy_one_versioned_file(const char *from
APR_HASH_KEY_STRING);
if (eol_style)
- SVN_ERR(get_eol_style(&style, &eol, eol_style->data, native_eol));
+ SVN_ERR(get_eol_style(&style, &eol, eol_style->data, eib->native_eol));
if (local_mod)
{
/* Use the modified time from the working copy of
the file */
- SVN_ERR(svn_io_file_affected_time(&tm, from_abspath, scratch_pool));
+ SVN_ERR(svn_io_file_affected_time(&tm, local_abspath, scratch_pool));
}
else
{
- SVN_ERR(svn_wc__node_get_changed_info(NULL, &tm, NULL, wc_ctx,
- from_abspath, scratch_pool,
- scratch_pool));
+ tm = status->changed_date;
}
if (keywords)
{
- svn_revnum_t changed_rev;
+ svn_revnum_t changed_rev = status->changed_rev;
const char *suffix;
- const char *url;
- const char *author;
-
- SVN_ERR(svn_wc__node_get_changed_info(&changed_rev, NULL, &author,
- wc_ctx, from_abspath, scratch_pool,
- scratch_pool));
-
+ const char *url = svn_path_url_add_component2(status->repos_root_url,
+ status->repos_relpath,
+ scratch_pool);
+ const char *author = status->changed_author;
if (local_mod)
{
/* For locally modified files, we'll append an 'M'
@@ -295,9 +390,6 @@ copy_one_versioned_file(const char *from
suffix = "";
}
- SVN_ERR(svn_wc__node_get_url(&url, wc_ctx, from_abspath,
- scratch_pool, scratch_pool));
-
SVN_ERR(svn_subst_build_keywords2
(&kw, keywords->data,
apr_psprintf(scratch_pool, "%ld%s", changed_rev, suffix),
@@ -318,7 +410,7 @@ copy_one_versioned_file(const char *from
eol,
FALSE /* repair */,
kw,
- ! ignore_keywords /* expand */,
+ ! eib->ignore_keywords /* expand */,
scratch_pool);
/* ###: use cancel func/baton in place of NULL/NULL below. */
@@ -337,273 +429,17 @@ copy_one_versioned_file(const char *from
/* Now that dst_tmp contains the translated data, do the atomic rename. */
SVN_ERR(svn_io_file_rename(dst_tmp, to_abspath, scratch_pool));
- if (ctx->notify_func2)
+ if (eib->notify_func)
{
svn_wc_notify_t *notify = svn_wc_create_notify(to_abspath,
svn_wc_notify_update_add, scratch_pool);
notify->kind = svn_node_file;
- (*ctx->notify_func2)(ctx->notify_baton2, notify, scratch_pool);
+ (eib->notify_func)(eib->notify_baton, notify, scratch_pool);
}
return SVN_NO_ERROR;
}
-/* Make an unversioned copy of the versioned file or directory tree at the
- * source path FROM_ABSPATH. Copy it to the destination path TO_ABSPATH.
- *
- * If REVISION is svn_opt_revision_working, copy the working version,
- * otherwise copy the base version.
- *
- * See copy_one_versioned_file() for details of file copying behaviour,
- * including IGNORE_KEYWORDS and NATIVE_EOL.
- *
- * Include externals unless IGNORE_EXTERNALS is true.
- *
- * Recurse according to DEPTH.
- *
-
- */
-static svn_error_t *
-copy_versioned_files(const char *from_abspath,
- const char *to_abspath,
- const svn_opt_revision_t *revision,
- svn_boolean_t force,
- svn_boolean_t ignore_externals,
- svn_boolean_t ignore_keywords,
- svn_depth_t depth,
- const char *native_eol,
- svn_client_ctx_t *ctx,
- apr_pool_t *pool)
-{
- svn_error_t *err;
- apr_pool_t *iterpool;
- const apr_array_header_t *children;
- svn_node_kind_t from_kind;
- svn_depth_t node_depth;
-
- SVN_ERR_ASSERT(svn_dirent_is_absolute(from_abspath));
- SVN_ERR_ASSERT(svn_dirent_is_absolute(to_abspath));
-
- /* Only export 'added' and 'replaced' files when the revision is WORKING;
- when the revision is BASE (i.e. != WORKING), only export 'added' and
- 'replaced' files when they are part of a copy-/move-here. Otherwise, skip
- them, since they don't have an associated text-base. This condition for
- added/replaced simply is an optimization. Added and replaced files would
- be handled similarly by svn_wc_get_pristine_contents2(), which would
- return NULL if they have no base associated.
- TODO: We may prefer not to duplicate this condition and rather use
- svn_wc_get_pristine_contents2() or a dedicated new function instead.
-
- Don't export 'deleted' files and directories unless it's a
- revision other than WORKING. These files and directories
- don't really exist in WORKING. */
- if (revision->kind != svn_opt_revision_working)
- {
- svn_boolean_t is_added;
- const char *repos_relpath;
-
- SVN_ERR(svn_wc__node_get_origin(&is_added, NULL, &repos_relpath,
- NULL, NULL, NULL,
- ctx->wc_ctx, from_abspath, FALSE,
- pool, pool));
-
- if (is_added && !repos_relpath)
- return SVN_NO_ERROR; /* Local addition */
- }
- else
- {
- svn_boolean_t is_deleted;
-
- SVN_ERR(svn_wc__node_is_status_deleted(&is_deleted, ctx->wc_ctx,
- from_abspath, pool));
- if (is_deleted)
- return SVN_NO_ERROR;
- }
-
- SVN_ERR(svn_wc_read_kind(&from_kind, ctx->wc_ctx, from_abspath, FALSE,
- pool));
-
- if (from_kind == svn_node_dir)
- {
- apr_fileperms_t perm = APR_OS_DEFAULT;
- int j;
-
- /* Try to make the new directory. If this fails because the
- directory already exists, check our FORCE flag to see if we
- care. */
-
- /* Keep the source directory's permissions if applicable.
- Skip retrieving the umask on windows. Apr does not implement setting
- filesystem privileges on Windows.
- Retrieving the file permissions with APR_FINFO_PROT | APR_FINFO_OWNER
- is documented to be 'incredibly expensive' */
-#ifndef WIN32
- if (revision->kind == svn_opt_revision_working)
- {
- apr_finfo_t finfo;
- SVN_ERR(svn_io_stat(&finfo, from_abspath, APR_FINFO_PROT, pool));
- perm = finfo.protection;
- }
-#endif
- err = svn_io_dir_make(to_abspath, perm, pool);
- if (err)
- {
- if (! APR_STATUS_IS_EEXIST(err->apr_err))
- return svn_error_trace(err);
- if (! force)
- SVN_ERR_W(err, _("Destination directory exists, and will not be "
- "overwritten unless forced"));
- else
- svn_error_clear(err);
- }
-
- SVN_ERR(svn_wc__node_get_children(&children, ctx->wc_ctx, from_abspath,
- FALSE, pool, pool));
-
- iterpool = svn_pool_create(pool);
- for (j = 0; j < children->nelts; j++)
- {
- const char *child_abspath = APR_ARRAY_IDX(children, j, const char *);
- const char *child_name = svn_dirent_basename(child_abspath, NULL);
- const char *target_abspath;
- svn_node_kind_t child_kind;
-
- svn_pool_clear(iterpool);
-
- if (ctx->cancel_func)
- SVN_ERR(ctx->cancel_func(ctx->cancel_baton));
-
- target_abspath = svn_dirent_join(to_abspath, child_name, iterpool);
-
- SVN_ERR(svn_wc_read_kind(&child_kind, ctx->wc_ctx, child_abspath,
- FALSE, iterpool));
-
- if (child_kind == svn_node_dir)
- {
- if (depth == svn_depth_infinity
- || depth == svn_depth_immediates)
- {
- if (ctx->notify_func2)
- {
- svn_wc_notify_t *notify =
- svn_wc_create_notify(target_abspath,
- svn_wc_notify_update_add, pool);
- notify->kind = svn_node_dir;
- (*ctx->notify_func2)(ctx->notify_baton2, notify, pool);
- }
-
- if (depth == svn_depth_infinity)
- SVN_ERR(copy_versioned_files(child_abspath, target_abspath,
- revision, force,
- ignore_externals,
- ignore_keywords, depth,
- native_eol, ctx, iterpool));
- else
- SVN_ERR(svn_io_make_dir_recursively(target_abspath,
- iterpool));
- }
- }
- else if (child_kind == svn_node_file
- && depth >= svn_depth_files)
- {
- svn_node_kind_t external_kind;
-
- SVN_ERR(svn_wc__read_external_info(&external_kind,
- NULL, NULL, NULL,
- NULL, ctx->wc_ctx,
- child_abspath,
- child_abspath, TRUE,
- pool, pool));
-
- if (external_kind != svn_node_file)
- SVN_ERR(copy_one_versioned_file(child_abspath, target_abspath,
- ctx, revision,
- native_eol, ignore_keywords,
- iterpool));
- }
- }
-
- SVN_ERR(svn_wc__node_get_depth(&node_depth, ctx->wc_ctx,
- from_abspath, pool));
-
- /* Handle externals. */
- if (! ignore_externals && depth == svn_depth_infinity
- && node_depth == svn_depth_infinity)
- {
- apr_array_header_t *ext_items;
- const svn_string_t *prop_val;
-
- SVN_ERR(svn_wc_prop_get2(&prop_val, ctx->wc_ctx, from_abspath,
- SVN_PROP_EXTERNALS, pool, pool));
- if (prop_val != NULL)
- {
- int i;
-
- SVN_ERR(svn_wc_parse_externals_description3(&ext_items,
- from_abspath,
- prop_val->data,
- FALSE, pool));
- for (i = 0; i < ext_items->nelts; ++i)
- {
- svn_wc_external_item2_t *ext_item;
- const char *new_from, *new_to;
-
- svn_pool_clear(iterpool);
-
- ext_item = APR_ARRAY_IDX(ext_items, i,
- svn_wc_external_item2_t *);
- new_from = svn_dirent_join(from_abspath,
- ext_item->target_dir,
- iterpool);
- new_to = svn_dirent_join(to_abspath, ext_item->target_dir,
- iterpool);
-
- /* The target dir might have parents that don't exist.
- Guarantee the path upto the last component. */
- if (!svn_dirent_is_root(ext_item->target_dir,
- strlen(ext_item->target_dir)))
- {
- const char *parent = svn_dirent_dirname(new_to, iterpool);
- SVN_ERR(svn_io_make_dir_recursively(parent, iterpool));
- }
-
- SVN_ERR(copy_versioned_files(new_from, new_to,
- revision, force, FALSE,
- ignore_keywords,
- svn_depth_infinity, native_eol,
- ctx, iterpool));
- }
- }
- }
-
- svn_pool_destroy(iterpool);
- }
- else if (from_kind == svn_node_file)
- {
- svn_node_kind_t to_kind;
-
- SVN_ERR(svn_io_check_path(to_abspath, &to_kind, pool));
-
- if ((to_kind == svn_node_file || to_kind == svn_node_unknown) && ! force)
- return svn_error_createf(SVN_ERR_ILLEGAL_TARGET, NULL,
- _("Destination file '%s' exists, and "
- "will not be overwritten unless forced"),
- svn_dirent_local_style(to_abspath, pool));
- else if (to_kind == svn_node_dir)
- return svn_error_createf(SVN_ERR_ILLEGAL_TARGET, NULL,
- _("Destination '%s' exists. Cannot "
- "overwrite directory with non-directory"),
- svn_dirent_local_style(to_abspath, pool));
-
- SVN_ERR(copy_one_versioned_file(from_abspath, to_abspath, ctx,
- revision, native_eol, ignore_keywords,
- pool));
- }
-
- return SVN_NO_ERROR;
-}
-
-
/* Abstraction of open_root.
*
* Create PATH if it does not exist and is not obstructed, and invoke
@@ -1297,7 +1133,10 @@ svn_client_export5(svn_revnum_t *result_
}
else
{
+ struct export_info_baton eib;
svn_node_kind_t kind;
+ apr_hash_t *externals = NULL;
+
/* This is a working copy export. */
/* just copy the contents of the working copy into the target path. */
SVN_ERR(svn_dirent_get_absolute(&from_path_or_url, from_path_or_url,
@@ -1341,14 +1180,80 @@ svn_client_export5(svn_revnum_t *result_
* For a start, to detect the source kind, it looks at what is on disk
* rather than the versioned working or base node.
*/
-
if (kind == svn_node_file)
SVN_ERR(append_basename_if_dir(&to_path, from_path_or_url, FALSE,
pool));
- SVN_ERR(copy_versioned_files(from_path_or_url, to_path, revision,
- overwrite, ignore_externals, ignore_keywords,
- depth, native_eol, ctx, pool));
+ eib.to_path = to_path;
+ eib.revision = revision;
+ eib.overwrite = overwrite;
+ eib.ignore_keywords = ignore_keywords;
+ eib.wc_ctx = ctx->wc_ctx;
+ eib.native_eol = native_eol;
+ eib.notify_func = ctx->notify_func2;;
+ eib.notify_baton = ctx->notify_baton2;
+ eib.origin_abspath = from_path_or_url;
+ eib.exported = FALSE;
+
+ SVN_ERR(svn_wc_walk_status(ctx->wc_ctx, from_path_or_url, depth,
+ TRUE /* get_all */,
+ TRUE /* no_ignore */,
+ FALSE /* ignore_text_mods */,
+ NULL,
+ export_node, &eib,
+ ctx->cancel_func, ctx->cancel_baton,
+ pool));
+
+ if (!eib.exported)
+ return svn_error_createf(SVN_ERR_WC_PATH_NOT_FOUND, NULL,
+ _("The node '%s' was not found."),
+ svn_dirent_local_style(from_path_or_url,
+ pool));
+
+ if (!ignore_externals)
+ SVN_ERR(svn_wc__externals_defined_below(&externals, ctx->wc_ctx,
+ from_path_or_url,
+ pool, pool));
+
+ if (externals && apr_hash_count(externals))
+ {
+ apr_pool_t *iterpool = svn_pool_create(pool);
+ apr_hash_index_t *hi;
+
+ for (hi = apr_hash_first(pool, externals);
+ hi;
+ hi = apr_hash_next(hi))
+ {
+ const char *external_abspath = svn__apr_hash_index_key(hi);
+ const char *relpath;
+ const char *target_abspath;
+
+ svn_pool_clear(iterpool);
+
+ relpath = svn_dirent_skip_ancestor(from_path_or_url,
+ external_abspath);
+
+ target_abspath = svn_dirent_join(to_path, relpath,
+ iterpool);
+
+ /* Ensure that the parent directory exists */
+ SVN_ERR(svn_io_make_dir_recursively(
+ svn_dirent_dirname(target_abspath, iterpool),
+ iterpool));
+
+ SVN_ERR(svn_client_export5(NULL,
+ svn_dirent_join(from_path_or_url,
+ relpath,
+ iterpool),
+ target_abspath,
+ peg_revision, revision,
+ TRUE, ignore_externals,
+ ignore_keywords, depth, native_eol,
+ ctx, iterpool));
+ }
+
+ svn_pool_destroy(iterpool);
+ }
}
Modified: subversion/branches/javahl-ra/subversion/libsvn_client/merge.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_client/merge.c?rev=1347595&r1=1347594&r2=1347595&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_client/merge.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_client/merge.c Thu Jun 7 12:57:43 2012
@@ -841,8 +841,7 @@ split_mergeinfo_on_revision(svn_mergeinf
ranges from *MERGEINFO */
if (!(*younger_mergeinfo))
*younger_mergeinfo = apr_hash_make(pool);
- apr_hash_set(*younger_mergeinfo,
- (const char *)merge_source_path,
+ apr_hash_set(*younger_mergeinfo, merge_source_path,
APR_HASH_KEY_STRING, younger_rangelist);
SVN_ERR(svn_mergeinfo_remove2(mergeinfo, *younger_mergeinfo,
*mergeinfo, TRUE, pool, iterpool));
@@ -1777,6 +1776,7 @@ merge_file_added(svn_wc_notify_state_t *
merge_cmd_baton_t *merge_b = baton;
const char *mine_abspath = svn_dirent_join(merge_b->target->abspath,
mine_relpath, scratch_pool);
+ svn_node_kind_t wc_kind;
svn_node_kind_t kind;
int i;
apr_hash_t *file_props;
@@ -1835,7 +1835,7 @@ merge_file_added(svn_wc_notify_state_t *
svn_wc_notify_state_t obstr_state;
SVN_ERR(perform_obstruction_check(&obstr_state, NULL, NULL,
- &kind,
+ &wc_kind,
merge_b, mine_abspath, svn_node_unknown,
scratch_pool));
@@ -1968,10 +1968,6 @@ merge_file_added(svn_wc_notify_state_t *
if (content_state)
{
/* directory already exists, is it under version control? */
- svn_node_kind_t wc_kind;
- SVN_ERR(svn_wc_read_kind(&wc_kind, merge_b->ctx->wc_ctx,
- mine_abspath, FALSE, scratch_pool));
-
if ((wc_kind != svn_node_none)
&& dry_run_deleted_p(merge_b, mine_abspath))
*content_state = svn_wc_notify_state_changed;
@@ -8857,7 +8853,7 @@ do_directory_merge(svn_mergeinfo_catalog
* repository, or by allocating a new *RA_SESSION in POOL.
* (RA_SESSION itself cannot be null, of course.)
*
- * CTX is used as for svn_client__open_ra_session_internal().
+ * CTX is used as for svn_client_open_ra_session().
*/
static svn_error_t *
ensure_ra_session_url(svn_ra_session_t **ra_session,
@@ -8877,8 +8873,7 @@ ensure_ra_session_url(svn_ra_session_t *
if (! *ra_session || (err && err->apr_err == SVN_ERR_RA_ILLEGAL_URL))
{
svn_error_clear(err);
- err = svn_client__open_ra_session_internal(ra_session, NULL, url, NULL,
- NULL, FALSE, TRUE, ctx, pool);
+ err = svn_client_open_ra_session(ra_session, url, ctx, pool);
}
SVN_ERR(err);
@@ -8945,6 +8940,7 @@ do_merge(apr_hash_t **modified_subtrees,
svn_mergeinfo_catalog_t result_catalog,
const apr_array_header_t *merge_sources,
const merge_target_t *target,
+ svn_ra_session_t *src_session,
svn_boolean_t sources_related,
svn_boolean_t same_repos,
svn_boolean_t ignore_ancestry,
@@ -8968,6 +8964,7 @@ do_merge(apr_hash_t **modified_subtrees,
int i;
svn_boolean_t checked_mergeinfo_capability = FALSE;
svn_ra_session_t *ra_session1 = NULL, *ra_session2 = NULL;
+ const char *old_src_session_url = NULL;
apr_pool_t *iterpool;
SVN_ERR_ASSERT(svn_dirent_is_absolute(target->abspath));
@@ -9060,6 +9057,13 @@ do_merge(apr_hash_t **modified_subtrees,
notify_baton.merge_b = &merge_cmd_baton;
notify_baton.pool = result_pool;
+ if (src_session)
+ {
+ SVN_ERR(svn_ra_get_session_url(src_session, &old_src_session_url,
+ scratch_pool));
+ ra_session1 = src_session;
+ }
+
for (i = 0; i < merge_sources->nelts; i++)
{
merge_source_t *source =
@@ -9163,6 +9167,9 @@ do_merge(apr_hash_t **modified_subtrees,
/* Let everyone know we're finished here. */
notify_merge_completed(target->abspath, ctx, iterpool);
+ if (src_session)
+ SVN_ERR(svn_ra_reparent(src_session, old_src_session_url, iterpool));
+
svn_pool_destroy(iterpool);
return SVN_NO_ERROR;
}
@@ -9234,7 +9241,7 @@ merge_cousins_and_supplement_mergeinfo(c
modified_subtrees = apr_hash_make(scratch_pool);
APR_ARRAY_PUSH(faux_sources, const merge_source_t *) = source;
SVN_ERR(do_merge(&modified_subtrees, NULL, faux_sources, target,
- TRUE, same_repos,
+ URL1_ra_session, TRUE, same_repos,
ignore_ancestry, force, dry_run, FALSE, NULL, TRUE,
FALSE, depth, merge_options, use_sleep, ctx,
scratch_pool, subpool));
@@ -9266,14 +9273,14 @@ merge_cousins_and_supplement_mergeinfo(c
notify_mergeinfo_recording(target->abspath, NULL, ctx, scratch_pool);
svn_pool_clear(subpool);
SVN_ERR(do_merge(NULL, add_result_catalog, add_sources, target,
- TRUE, same_repos,
+ URL1_ra_session, TRUE, same_repos,
ignore_ancestry, force, dry_run, TRUE,
modified_subtrees, TRUE,
TRUE, depth, merge_options, use_sleep, ctx,
scratch_pool, subpool));
svn_pool_clear(subpool);
SVN_ERR(do_merge(NULL, remove_result_catalog, remove_sources, target,
- TRUE, same_repos,
+ URL1_ra_session, TRUE, same_repos,
ignore_ancestry, force, dry_run, TRUE,
modified_subtrees, TRUE,
TRUE, depth, merge_options, use_sleep, ctx,
@@ -9551,7 +9558,8 @@ merge_locked(const char *source1,
/* Unless we're ignoring ancestry, see if the two sources are related. */
if (! ignore_ancestry)
SVN_ERR(svn_client__get_youngest_common_ancestor(
- &yca, source1_loc, source2_loc, ctx, scratch_pool, scratch_pool));
+ &yca, source1_loc, source2_loc, ra_session1, ctx,
+ scratch_pool, scratch_pool));
/* Check for a youngest common ancestor. If we have one, we'll be
doing merge tracking.
@@ -9641,7 +9649,7 @@ merge_locked(const char *source1,
}
err = do_merge(NULL, NULL, merge_sources, target,
- related, same_repos,
+ ra_session1, related, same_repos,
ignore_ancestry, force, dry_run,
record_only, NULL, FALSE, FALSE, depth, merge_options,
&use_sleep, ctx, scratch_pool, scratch_pool);
@@ -10435,23 +10443,21 @@ calculate_left_hand_side(svn_client__pat
hi;
hi = apr_hash_next(hi))
{
- const char *absolute_path = svn__apr_hash_index_key(hi);
+ const char *local_abspath = svn__apr_hash_index_key(hi);
svn_client__pathrev_t *target_child;
- const char *path_rel_to_root;
+ const char *repos_relpath;
svn_mergeinfo_t target_history_as_mergeinfo;
svn_pool_clear(iterpool);
/* Convert the absolute path with mergeinfo on it to a path relative
to the session root. */
- SVN_ERR(svn_client__path_relative_to_root(&path_rel_to_root,
- ctx->wc_ctx, absolute_path,
- NULL, FALSE,
- NULL, scratch_pool,
- iterpool));
+ SVN_ERR(svn_wc__node_get_repos_relpath(&repos_relpath,
+ ctx->wc_ctx, local_abspath,
+ scratch_pool, iterpool));
target_child = svn_client__pathrev_create_with_relpath(
target->loc.repos_root_url, target->loc.repos_uuid,
- target->loc.rev, path_rel_to_root, iterpool);
+ target->loc.rev, repos_relpath, iterpool);
SVN_ERR(svn_client__get_history_as_mergeinfo(&target_history_as_mergeinfo,
NULL /* has_rev_zero_hist */,
target_child,
@@ -10460,8 +10466,7 @@ calculate_left_hand_side(svn_client__pat
target_ra_session,
ctx, scratch_pool));
- apr_hash_set(target_history_hash,
- apr_pstrdup(scratch_pool, path_rel_to_root),
+ apr_hash_set(target_history_hash, repos_relpath,
APR_HASH_KEY_STRING, target_history_as_mergeinfo);
}
@@ -10469,7 +10474,8 @@ calculate_left_hand_side(svn_client__pat
actually related, we can't reintegrate if they are not. Also
get an initial value for the YCA revision number. */
SVN_ERR(svn_client__get_youngest_common_ancestor(
- &yc_ancestor, source_loc, &target->loc, ctx, iterpool, iterpool));
+ &yc_ancestor, source_loc, &target->loc, target_ra_session, ctx,
+ iterpool, iterpool));
if (! yc_ancestor)
return svn_error_createf(SVN_ERR_CLIENT_NOT_READY_TO_MERGE, NULL,
_("'%s@%ld' must be ancestrally related to "
@@ -10634,7 +10640,7 @@ find_reintegrate_merge(merge_source_t **
SVN_ERR(svn_ra_reparent(target_ra_session, source.loc1->url, scratch_pool));
SVN_ERR(svn_client__get_youngest_common_ancestor(
- &yc_ancestor, source.loc2, source.loc1,
+ &yc_ancestor, source.loc2, source.loc1, target_ra_session,
ctx, scratch_pool, scratch_pool));
/* The source side of a reintegrate merge is not 'ancestral', except in
@@ -10729,10 +10735,9 @@ open_reintegrate_source_and_target(svn_r
SVN_ERR(open_target_wc(&target, target_abspath,
FALSE, FALSE, FALSE,
ctx, scratch_pool, scratch_pool));
- SVN_ERR(svn_client__open_ra_session_internal(target_ra_session_p, NULL,
- target->loc.url,
- NULL, NULL, FALSE, FALSE,
- ctx, scratch_pool));
+ SVN_ERR(svn_client_open_ra_session(target_ra_session_p,
+ target->loc.url,
+ ctx, scratch_pool));
if (! target->loc.url)
return svn_error_createf(SVN_ERR_CLIENT_UNRELATED_RESOURCES, NULL,
_("Can't reintegrate into '%s' because it is "
@@ -10925,42 +10930,41 @@ merge_peg_locked(const char *source_path
SVN_ERR_ASSERT(svn_dirent_is_absolute(target_abspath));
+ /* Create a short lived session pool */
+ sesspool = svn_pool_create(scratch_pool);
+
SVN_ERR(open_target_wc(&target, target_abspath,
allow_mixed_rev, TRUE, TRUE,
- ctx, scratch_pool, scratch_pool));
+ ctx, sesspool, sesspool));
/* Open an RA session to our source URL, and determine its root URL. */
- sesspool = svn_pool_create(scratch_pool);
SVN_ERR(open_source_session(&source_loc, &ra_session,
source_path_or_url, source_peg_revision,
- ctx, sesspool, scratch_pool));
+ ctx, sesspool, sesspool));
/* Normalize our merge sources. */
SVN_ERR(normalize_merge_sources(&merge_sources, source_path_or_url,
source_loc,
ranges_to_merge, ra_session, ctx,
- scratch_pool, scratch_pool));
+ sesspool, sesspool));
/* Check for same_repos. */
same_repos = is_same_repos(&target->loc, source_loc, TRUE /* strict_urls */);
- /* We're done with our little RA session. */
- svn_pool_destroy(sesspool);
-
/* Do the real merge! (We say with confidence that our merge
sources are both ancestral and related.) */
- err = do_merge(NULL, NULL, merge_sources, target,
+ err = do_merge(NULL, NULL, merge_sources, target, ra_session,
TRUE, same_repos, ignore_ancestry, force, dry_run,
record_only, NULL, FALSE, FALSE, depth, merge_options,
- &use_sleep, ctx, scratch_pool, scratch_pool);
+ &use_sleep, ctx, sesspool, sesspool);
if (use_sleep)
- svn_io_sleep_for_timestamps(target_abspath, scratch_pool);
+ svn_io_sleep_for_timestamps(target_abspath, sesspool);
- if (err)
- return svn_error_trace(err);
+ /* We're done with our RA session. */
+ svn_pool_destroy(sesspool);
- return SVN_NO_ERROR;
+ return svn_error_trace(err);
}
svn_error_t *
@@ -11444,7 +11448,7 @@ find_symmetric_merge(svn_client__pathrev
s_t->target_ra_session, ctx, scratch_pool));
SVN_ERR(svn_client__get_youngest_common_ancestor(
- &s_t->yca, s_t->source, &s_t->target->loc,
+ &s_t->yca, s_t->source, &s_t->target->loc, s_t->source_ra_session,
ctx, result_pool, result_pool));
/* Find the latest revision of A synced to B and the latest
@@ -11595,7 +11599,7 @@ do_symmetric_merge_locked(const svn_clie
merge_sources = apr_array_make(scratch_pool, 1, sizeof(merge_source_t *));
APR_ARRAY_PUSH(merge_sources, const merge_source_t *) = &source;
- err = do_merge(NULL, NULL, merge_sources, target,
+ err = do_merge(NULL, NULL, merge_sources, target, NULL,
TRUE /*related*/,
TRUE /*same_repos*/, ignore_ancestry, force, dry_run,
record_only, NULL, FALSE, FALSE, depth, merge_options,
Modified: subversion/branches/javahl-ra/subversion/libsvn_client/mergeinfo.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_client/mergeinfo.c?rev=1347595&r1=1347594&r2=1347595&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_client/mergeinfo.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_client/mergeinfo.c Thu Jun 7 12:57:43 2012
@@ -373,7 +373,6 @@ svn_client__get_wc_mergeinfo_catalog(svn
const char *target_repos_rel_path;
svn_mergeinfo_t mergeinfo;
const char *repos_root;
- svn_node_kind_t kind;
SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
*mergeinfo_cat = NULL;
@@ -389,12 +388,9 @@ svn_client__get_wc_mergeinfo_catalog(svn
return SVN_NO_ERROR;
}
- SVN_ERR(svn_client__path_relative_to_root(&target_repos_rel_path,
- ctx->wc_ctx,
- local_abspath,
- NULL, FALSE,
- NULL, scratch_pool,
- scratch_pool));
+ SVN_ERR(svn_wc__node_get_repos_relpath(&target_repos_rel_path,
+ ctx->wc_ctx, local_abspath,
+ scratch_pool, scratch_pool));
/* Get the mergeinfo for the LOCAL_ABSPATH target and set *INHERITED and
*WALKED_PATH. */
@@ -414,38 +410,37 @@ svn_client__get_wc_mergeinfo_catalog(svn
}
/* If LOCAL_ABSPATH is a directory and we want the subtree mergeinfo too,
- then get it. */
- SVN_ERR(svn_wc_read_kind(&kind, ctx->wc_ctx, local_abspath, FALSE,
- scratch_pool));
- if (kind == svn_node_dir && include_descendants)
+ then get it.
+
+ With WC-NG it is cheaper to do a single db transaction, than first
+ looking if we really have a directory. */
+ if (include_descendants)
{
apr_hash_t *mergeinfo_props;
apr_hash_index_t *hi;
- svn_opt_revision_t opt;
-
- opt.kind = svn_opt_revision_unspecified;
- SVN_ERR(svn_client_propget4(&mergeinfo_props,
- SVN_PROP_MERGEINFO,
- local_abspath,
- &opt, &opt,
- NULL, svn_depth_infinity, NULL,
- ctx, scratch_pool, scratch_pool));
+ SVN_ERR(svn_wc__prop_retrieve_recursive(&mergeinfo_props,
+ ctx->wc_ctx, local_abspath,
+ SVN_PROP_MERGEINFO,
+ scratch_pool, scratch_pool));
/* Convert *mergeinfo_props into a proper svn_mergeinfo_catalog_t */
for (hi = apr_hash_first(scratch_pool, mergeinfo_props);
hi;
hi = apr_hash_next(hi))
{
- const char *key_path = svn__apr_hash_index_key(hi);
+ const char *node_abspath = svn__apr_hash_index_key(hi);
svn_string_t *propval = svn__apr_hash_index_val(hi);
svn_mergeinfo_t subtree_mergeinfo;
+ const char *repos_relpath;
+
+ if (strcmp(node_abspath, local_abspath) == 0)
+ continue; /* Already parsed in svn_client__get_wc_mergeinfo */
+
+ SVN_ERR(svn_wc__node_get_repos_relpath(&repos_relpath,
+ ctx->wc_ctx, node_abspath,
+ result_pool, scratch_pool));
- SVN_ERR(svn_client__path_relative_to_root(&key_path, ctx->wc_ctx,
- key_path,
- NULL, FALSE,
- NULL, result_pool,
- scratch_pool));
SVN_ERR(svn_mergeinfo_parse(&subtree_mergeinfo, propval->data,
result_pool));
@@ -455,7 +450,7 @@ svn_client__get_wc_mergeinfo_catalog(svn
if (*mergeinfo_cat == NULL)
*mergeinfo_cat = apr_hash_make(result_pool);
- apr_hash_set(*mergeinfo_cat, key_path,
+ apr_hash_set(*mergeinfo_cat, repos_relpath,
APR_HASH_KEY_STRING, subtree_mergeinfo);
}
}
@@ -1596,17 +1591,23 @@ svn_client_mergeinfo_get_merged(apr_hash
peg_revision, FALSE, FALSE, ctx, pool, pool));
if (mergeinfo_cat)
{
- const char *path_or_url_repos_rel;
+ const char *repos_relpath;
+
+ if (! svn_path_is_url(path_or_url))
+ {
+ SVN_ERR(svn_dirent_get_absolute(&path_or_url, path_or_url, pool));
+ SVN_ERR(svn_wc__node_get_repos_relpath(&repos_relpath,
+ ctx->wc_ctx, path_or_url,
+ pool, pool));
+ }
+ else
+ {
+ repos_relpath = svn_uri_skip_ancestor(repos_root, path_or_url, pool);
- if (! svn_path_is_url(path_or_url)
- && ! svn_dirent_is_absolute(path_or_url))
- SVN_ERR(svn_dirent_get_absolute(&path_or_url, path_or_url, pool));
-
- SVN_ERR(svn_client__path_relative_to_root(&path_or_url_repos_rel,
- ctx->wc_ctx, path_or_url,
- repos_root, FALSE, NULL,
- pool, pool));
- mergeinfo = apr_hash_get(mergeinfo_cat, path_or_url_repos_rel,
+ SVN_ERR_ASSERT(repos_relpath != NULL); /* Or get_mergeinfo failed */
+ }
+
+ mergeinfo = apr_hash_get(mergeinfo_cat, repos_relpath,
APR_HASH_KEY_STRING);
}
else
@@ -1673,15 +1674,19 @@ svn_client_mergeinfo_log(svn_boolean_t f
ctx, scratch_pool, scratch_pool));
if (!svn_path_is_url(target_path_or_url))
- SVN_ERR(svn_dirent_get_absolute(&target_path_or_url, target_path_or_url, scratch_pool));
+ {
+ SVN_ERR(svn_dirent_get_absolute(&target_path_or_url, target_path_or_url, scratch_pool));
+ SVN_ERR(svn_wc__node_get_repos_relpath(&target_repos_rel,
+ ctx->wc_ctx, target_path_or_url,
+ scratch_pool, scratch_pool));
+ }
+ else
+ {
+ target_repos_rel = svn_uri_skip_ancestor(repos_root, target_path_or_url,
+ scratch_pool);
- SVN_ERR(svn_client__path_relative_to_root(&target_repos_rel,
- ctx->wc_ctx,
- target_path_or_url,
- repos_root,
- FALSE /* leading_slash */, NULL,
- scratch_pool,
- scratch_pool));
+ SVN_ERR_ASSERT(target_repos_rel != NULL); /* Or get_mergeinfo should have failed */
+ }
if (!target_mergeinfo_cat)
{
Modified: subversion/branches/javahl-ra/subversion/libsvn_client/prop_commands.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_client/prop_commands.c?rev=1347595&r1=1347594&r2=1347595&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_client/prop_commands.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_client/prop_commands.c Thu Jun 7 12:57:43 2012
@@ -743,7 +743,7 @@ recursive_propget_receiver(void *baton,
Treat DEPTH as in svn_client_propget3().
*/
static svn_error_t *
-get_prop_from_wc(apr_hash_t *props,
+get_prop_from_wc(apr_hash_t **props,
const char *propname,
const char *target_abspath,
svn_boolean_t pristine,
@@ -764,7 +764,19 @@ get_prop_from_wc(apr_hash_t *props,
if (depth == svn_depth_unknown)
depth = svn_depth_infinity;
- rb.props = props;
+ if (!pristine && depth == svn_depth_infinity
+ && (!changelists || changelists->nelts == 0))
+ {
+ /* Handle this common svn:mergeinfo case more efficient than the target
+ list handling in the recursive retrieval. */
+ SVN_ERR(svn_wc__prop_retrieve_recursive(
+ props, ctx->wc_ctx, target_abspath, propname,
+ result_pool, scratch_pool));
+ return SVN_NO_ERROR;
+ }
+
+ *props = apr_hash_make(result_pool);
+ rb.props = *props;
rb.pool = result_pool;
rb.wc_ctx = ctx->wc_ctx;
@@ -802,8 +814,6 @@ svn_client_propget4(apr_hash_t **props,
target);
revision = svn_cl__rev_default_to_peg(revision, peg_revision);
- *props = apr_hash_make(result_pool);
-
if (! svn_path_is_url(target)
&& SVN_CLIENT__REVKIND_IS_LOCAL_TO_WC(peg_revision->kind)
&& SVN_CLIENT__REVKIND_IS_LOCAL_TO_WC(revision->kind))
@@ -840,7 +850,7 @@ svn_client_propget4(apr_hash_t **props,
else if (err)
return svn_error_trace(err);
- SVN_ERR(get_prop_from_wc(*props, propname, target,
+ SVN_ERR(get_prop_from_wc(props, propname, target,
pristine, kind,
depth, changelists, ctx, scratch_pool,
result_pool));
@@ -859,6 +869,7 @@ svn_client_propget4(apr_hash_t **props,
SVN_ERR(svn_ra_check_path(ra_session, "", loc->rev, &kind, scratch_pool));
+ *props = apr_hash_make(result_pool);
SVN_ERR(remote_propget(*props, propname, loc->url, "",
kind, loc->rev, ra_session,
depth, result_pool, scratch_pool));
Modified: subversion/branches/javahl-ra/subversion/libsvn_client/ra.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_client/ra.c?rev=1347595&r1=1347594&r2=1347595&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_client/ra.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_client/ra.c Thu Jun 7 12:57:43 2012
@@ -492,7 +492,8 @@ svn_client__ra_session_from_path2(svn_ra
initial_url,
base_dir_abspath, NULL,
base_dir_abspath != NULL,
- FALSE, ctx, pool));
+ base_dir_abspath == NULL,
+ ctx, pool));
/* If we got a CORRECTED_URL, we'll want to refer to that as the
URL-ized form of PATH_OR_URL from now on. */
@@ -843,12 +844,12 @@ svn_error_t *
svn_client__get_youngest_common_ancestor(svn_client__pathrev_t **ancestor_p,
const svn_client__pathrev_t *loc1,
const svn_client__pathrev_t *loc2,
+ svn_ra_session_t *session,
svn_client_ctx_t *ctx,
apr_pool_t *result_pool,
apr_pool_t *scratch_pool)
{
- apr_pool_t *sesspool = svn_pool_create(scratch_pool);
- svn_ra_session_t *session;
+ apr_pool_t *sesspool = NULL;
apr_hash_t *history1, *history2;
apr_hash_index_t *hi;
svn_revnum_t yc_revision = SVN_INVALID_REVNUM;
@@ -863,7 +864,11 @@ svn_client__get_youngest_common_ancestor
}
/* Open an RA session for the two locations. */
- SVN_ERR(svn_client_open_ra_session(&session, loc1->url, ctx, sesspool));
+ if (session == NULL)
+ {
+ sesspool = svn_pool_create(scratch_pool);
+ SVN_ERR(svn_client_open_ra_session(&session, loc1->url, ctx, sesspool));
+ }
/* We're going to cheat and use history-as-mergeinfo because it
saves us a bunch of annoying custom data comparisons and such. */
@@ -879,8 +884,9 @@ svn_client__get_youngest_common_ancestor
SVN_INVALID_REVNUM,
SVN_INVALID_REVNUM,
session, ctx, scratch_pool));
- /* Close the source and target sessions. */
- svn_pool_destroy(sesspool);
+ /* Close the ra session if we opened one. */
+ if (sesspool)
+ svn_pool_destroy(sesspool);
/* Loop through the first location's history, check for overlapping
paths and ranges in the second location's history, and
@@ -959,7 +965,7 @@ svn_client__youngest_common_ancestor(con
ctx, scratch_pool));
SVN_ERR(svn_client__get_youngest_common_ancestor(
- &ancestor, loc1, loc2, ctx, result_pool, scratch_pool));
+ &ancestor, loc1, loc2, session, ctx, result_pool, scratch_pool));
if (ancestor)
{
Modified: subversion/branches/javahl-ra/subversion/libsvn_client/switch.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_client/switch.c?rev=1347595&r1=1347594&r2=1347595&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_client/switch.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_client/switch.c Thu Jun 7 12:57:43 2012
@@ -208,7 +208,8 @@ switch_internal(svn_revnum_t *result_rev
/* ### It would be nice if this function could reuse the existing
ra session instead of opening two for its own use. */
SVN_ERR(svn_client__get_youngest_common_ancestor(
- &yca, switch_loc, target_base_loc, ctx, pool, pool));
+ &yca, switch_loc, target_base_loc, ra_session, ctx,
+ pool, pool));
}
if (! yca)
return svn_error_createf(SVN_ERR_CLIENT_UNRELATED_RESOURCES, NULL,