subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From v...@apache.org
Subject svn commit: r1425415 [2/13] - in /subversion/branches/javahl-ra: ./ build/generator/templates/ notes/ notes/directory-index/ subversion/bindings/swig/python/svn/ subversion/bindings/swig/ruby/test/ subversion/include/ subversion/include/private/ subver...
Date Sun, 23 Dec 2012 06:03:17 GMT
Modified: subversion/branches/javahl-ra/subversion/bindings/swig/ruby/test/test_client.rb
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/bindings/swig/ruby/test/test_client.rb?rev=1425415&r1=1425414&r2=1425415&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/bindings/swig/ruby/test/test_client.rb (original)
+++ subversion/branches/javahl-ra/subversion/bindings/swig/ruby/test/test_client.rb Sun Dec 23 06:03:14 2012
@@ -1992,8 +1992,6 @@ class SvnClientTest < Test::Unit::TestCa
                      [path, Svn::Wc::NOTIFY_UPDATE_UPDATE],
                      [@wc_path, Svn::Wc::NOTIFY_UPDATE_UPDATE],
                      [@wc_path, Svn::Wc::NOTIFY_UPDATE_COMPLETED],
-                     [@wc_path, Svn::Wc::NOTIFY_CONFLICT_RESOLVER_STARTING],
-                     [@wc_path, Svn::Wc::NOTIFY_CONFLICT_RESOLVER_DONE],
                    ],
                    notify_info)
 
@@ -2004,8 +2002,6 @@ class SvnClientTest < Test::Unit::TestCa
                      [path, Svn::Wc::NOTIFY_UPDATE_UPDATE],
                      [@wc_path, Svn::Wc::NOTIFY_UPDATE_UPDATE],
                      [@wc_path, Svn::Wc::NOTIFY_UPDATE_COMPLETED],
-                     [@wc_path, Svn::Wc::NOTIFY_CONFLICT_RESOLVER_STARTING],
-                     [@wc_path, Svn::Wc::NOTIFY_CONFLICT_RESOLVER_DONE],
                    ],
                    notify_info)
     end

Modified: subversion/branches/javahl-ra/subversion/include/private/svn_delta_private.h
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/include/private/svn_delta_private.h?rev=1425415&r1=1425414&r2=1425415&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/include/private/svn_delta_private.h (original)
+++ subversion/branches/javahl-ra/subversion/include/private/svn_delta_private.h Sun Dec 23 06:03:14 2012
@@ -101,6 +101,25 @@ svn_delta__delta_from_editor(const svn_d
                              struct svn_delta__extra_baton *exb,
                              apr_pool_t *pool);
 
+/**
+ * Get the data from IN, compress it according to the specified
+ * COMPRESSION_LEVEL and write the result to OUT.
+ * SVN_DELTA_COMPRESSION_LEVEL_NONE is valid for COMPRESSION_LEVEL.
+ */
+svn_error_t *
+svn__compress(svn_string_t *in,
+              svn_stringbuf_t *out,
+              int compression_level);
+
+/**
+ * Get the compressed data from IN, decompress it and write the result to
+ * OUT.  Return an error if the decompressed size is larger than LIMIT.
+ */
+svn_error_t *
+svn__decompress(svn_string_t *in,
+                svn_stringbuf_t *out,
+                apr_size_t limit);
+
 
 #ifdef __cplusplus
 }

Modified: subversion/branches/javahl-ra/subversion/include/private/svn_skel.h
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/include/private/svn_skel.h?rev=1425415&r1=1425414&r2=1425415&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/include/private/svn_skel.h (original)
+++ subversion/branches/javahl-ra/subversion/include/private/svn_skel.h Sun Dec 23 06:03:14 2012
@@ -133,6 +133,11 @@ svn_skel_t *svn_skel__mem_atom(const voi
 /* Create an empty list skel, allocated from POOL.  */
 svn_skel_t *svn_skel__make_empty_list(apr_pool_t *pool);
 
+/* Duplicates the skel structure SRC_SKEL and if DUP_DATA is true also the
+   data it references in RESULT_POOL */
+svn_skel_t *svn_skel__dup(const svn_skel_t *src_skel, svn_boolean_t dup_data,
+                          apr_pool_t *result_pool);
+
 
 /* Prepend SKEL to LIST.  */
 void svn_skel__prepend(svn_skel_t *skel, svn_skel_t *list);

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=1425415&r1=1425414&r2=1425415&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 Sun Dec 23 06:03:14 2012
@@ -228,6 +228,9 @@ svn_wc__external_register(svn_wc_context
 /* Remove the external at LOCAL_ABSPATH from the working copy identified by
    WRI_ABSPATH using WC_CTX.
 
+   If DECLARATION_ONLY is TRUE, only remove the registration and leave the
+   on-disk structure untouched.
+
    If not NULL, call CANCEL_FUNC with CANCEL_BATON to allow canceling while
    removing the working copy files.
 
@@ -237,6 +240,7 @@ svn_error_t *
 svn_wc__external_remove(svn_wc_context_t *wc_ctx,
                         const char *wri_abspath,
                         const char *local_abspath,
+                        svn_boolean_t declaration_only,
                         svn_cancel_func_t cancel_func,
                         void *cancel_baton,
                         apr_pool_t *scratch_pool);
@@ -305,20 +309,6 @@ svn_wc__del_tree_conflict(svn_wc_context
                           const char *victim_abspath,
                           apr_pool_t *scratch_pool);
 
-
-/* Return a hash @a *tree_conflicts of all the children of @a
- * local_abspath that are in tree conflicts.  The hash maps local
- * abspaths to pointers to svn_wc_conflict_description2_t, all
- * allocated in result pool.
- */
-svn_error_t *
-svn_wc__get_all_tree_conflicts(apr_hash_t **tree_conflicts,
-                               svn_wc_context_t *wc_ctx,
-                               const char *local_abspath,
-                               apr_pool_t *result_pool,
-                               apr_pool_t *scratch_pool);
-
-
 /** Like svn_wc_is_wc_root(), but it doesn't consider switched subdirs or
  * deleted entries as working copy roots.
  */
@@ -742,27 +732,6 @@ svn_wc__node_get_lock_info(const char **
                            apr_pool_t *scratch_pool);
 
 /**
- * A hack to remove the last entry from libsvn_client.  This simply fetches an
- * some values from WC-NG, and puts the needed bits into the output parameters,
- * allocated in @a result_pool.
- *
- * All output arguments can be NULL to indicate that the
- * caller is not interested in the specific result.
- *
- * @a local_abspath and @a wc_ctx are what you think they are.
- */
-svn_error_t *
-svn_wc__node_get_conflict_info(const char **conflict_old,
-                               const char **conflict_new,
-                               const char **conflict_wrk,
-                               const char **prejfile,
-                               svn_wc_context_t *wc_ctx,
-                               const char *local_abspath,
-                               apr_pool_t *result_pool,
-                               apr_pool_t *scratch_pool);
-
-
-/**
  * Acquire a recursive write lock for @a local_abspath.  If @a lock_anchor
  * is true, determine if @a local_abspath has an anchor that should be locked
  * instead; otherwise, @a local_abspath must be a versioned directory.

Modified: subversion/branches/javahl-ra/subversion/include/svn_error_codes.h
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/include/svn_error_codes.h?rev=1425415&r1=1425414&r2=1425415&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/include/svn_error_codes.h (original)
+++ subversion/branches/javahl-ra/subversion/include/svn_error_codes.h Sun Dec 23 06:03:14 2012
@@ -772,6 +772,11 @@ SVN_ERROR_START
              SVN_ERR_FS_CATEGORY_START + 50,
              "The filesystem editor completion process was not followed")
 
+  /** @since New in 1.8. */
+  SVN_ERRDEF(SVN_ERR_FS_PACKED_REPPROP_READ_FAILURE,
+             SVN_ERR_FS_CATEGORY_START + 51,
+             "A packed revprop could not be read")
+
   /* repos errors */
 
   SVN_ERRDEF(SVN_ERR_REPOS_LOCKED,

Modified: subversion/branches/javahl-ra/subversion/include/svn_fs.h
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/include/svn_fs.h?rev=1425415&r1=1425414&r2=1425415&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/include/svn_fs.h (original)
+++ subversion/branches/javahl-ra/subversion/include/svn_fs.h Sun Dec 23 06:03:14 2012
@@ -120,6 +120,13 @@ typedef struct svn_fs_t svn_fs_t;
  * @since New in 1.6.
  */
 #define SVN_FS_CONFIG_PRE_1_6_COMPATIBLE        "pre-1.6-compatible"
+
+/** Create repository format compatible with Subversion versions
+ * earlier than 1.8.
+ *
+ * @since New in 1.8.
+ */
+#define SVN_FS_CONFIG_PRE_1_8_COMPATIBLE        "pre-1.8-compatible"
 /** @} */
 
 
@@ -2398,7 +2405,8 @@ svn_fs_get_locks(svn_fs_t *fs,
 
 /**
  * Append a textual list of all available FS modules to the stringbuf
- * @a output.
+ * @a output.  Third-party modules are only included if repository
+ * access has caused them to be loaded.
  *
  * @since New in 1.2.
  */

Modified: subversion/branches/javahl-ra/subversion/include/svn_io.h
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/include/svn_io.h?rev=1425415&r1=1425414&r2=1425415&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/include/svn_io.h (original)
+++ subversion/branches/javahl-ra/subversion/include/svn_io.h Sun Dec 23 06:03:14 2012
@@ -607,6 +607,25 @@ svn_io_filesizes_different_p(svn_boolean
                              const char *file2,
                              apr_pool_t *pool);
 
+/** Set @a *different_p12 to non-zero if @a file1 and @a file2 have different
+ * sizes, else set to zero.  Do the similar for @a *different_p23 with
+ * @a file2 and @a file3, and @a *different_p13 for @a file1 and @a file3.
+ * All three of @a file1, @a file2 and @a file3 are utf8-encoded.
+ *
+ * Setting @a *different_p12 to zero does not mean the files definitely
+ * have the same size, it merely means that the sizes are not
+ * definitely different.  That is, if the size of one or both files
+ * cannot be determined, then the sizes are not known to be different,
+ * so @a *different_p12 is set to 0.
+ */
+svn_error_t *
+svn_io_filesizes_three_different_p(svn_boolean_t *different_p12,
+                                   svn_boolean_t *different_p23,
+                                   svn_boolean_t *different_p13,
+                                   const char *file1,
+                                   const char *file2,
+                                   const char *file3,
+                                   apr_pool_t *scratch_pool);
 
 /** Return in @a *checksum the checksum of type @a kind of @a file
  * Use @a pool for temporary allocations and to allocate @a *checksum.
@@ -642,6 +661,20 @@ svn_io_files_contents_same_p(svn_boolean
                              const char *file2,
                              apr_pool_t *pool);
 
+/** Set @a *same12 to TRUE if @a file1 and @a file2 have the same
+ * contents, else set it to FALSE.  Do the similar for @a *same23 
+ * with @a file2 and @a file3, and @a *same13 for @a file1 and @a 
+ * file3.  Use @a pool for temporary allocations.
+ */
+svn_error_t *
+svn_io_files_contents_three_same_p(svn_boolean_t *same12,
+                                   svn_boolean_t *same23,
+                                   svn_boolean_t *same13,
+                                   const char *file1,
+                                   const char *file2,
+                                   const char *file3,
+                                   apr_pool_t *scratch_pool);
+
 /** Create file at utf8-encoded @a file with contents @a contents.
  * @a file must not already exist.
  * Use @a pool for memory allocations.
@@ -2167,6 +2200,36 @@ svn_io_write_version_file(const char *pa
                           int version,
                           apr_pool_t *pool);
 
+/* Read a line of text from a file, up to a specified length.
+ *
+ * Allocate @a *stringbuf in @a result_pool, and read into it one line 
+ * from @a file. Reading stops either after a line-terminator was found
+ * or after @a max_len bytes have been read.
+ *
+ * If end-of-file is reached or @a max_len bytes have been read, and @a eof
+ * is not NULL, then set @a *eof to @c TRUE.
+ *
+ * The line-terminator is not stored in @a *stringbuf.
+ * The line-terminator is detected automatically and stored in @a *eol
+ * if @a eol is not NULL. If EOF is reached and @a file does not end
+ * with a newline character, and @a eol is not NULL, @ *eol is set to NULL.
+ *
+ * @a scratch_pool is used for temporary allocations.
+ *
+ * Hint: To read all data until a line-terminator is hit, pass APR_SIZE_MAX
+ * for @a max_len.
+ *
+ * @since New in 1.8.
+ */
+svn_error_t *
+svn_io_file_readline(apr_file_t *file,
+                     svn_stringbuf_t **stringbuf,
+                     const char **eol,
+                     svn_boolean_t *eof,
+                     apr_size_t max_len,
+                     apr_pool_t *result_pool,
+                     apr_pool_t *scratch_pool);
+
 /** @} */
 
 #ifdef __cplusplus

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=1425415&r1=1425414&r2=1425415&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/include/svn_path.h (original)
+++ subversion/branches/javahl-ra/subversion/include/svn_path.h Sun Dec 23 06:03:14 2012
@@ -106,8 +106,8 @@ svn_path_local_style(const char *path, a
  * for the base.
  *
  * @deprecated Provided for backward compatibility with the 1.6 API.
- * New code should use svn_dirent_join(), svn_uri_join(),
- * svn_relpath_join() or svn_fspath__join().
+ * New code should use svn_dirent_join(), svn_relpath_join() or
+ * svn_fspath__join().
  */
 SVN_DEPRECATED
 char *

Modified: subversion/branches/javahl-ra/subversion/include/svn_ra.h
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/include/svn_ra.h?rev=1425415&r1=1425414&r2=1425415&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/include/svn_ra.h (original)
+++ subversion/branches/javahl-ra/subversion/include/svn_ra.h Sun Dec 23 06:03:14 2012
@@ -621,7 +621,10 @@ typedef struct svn_ra_session_t svn_ra_s
  *
  * @a config is a hash mapping <tt>const char *</tt> keys to
  * @c svn_config_t * values.  For example, the @c svn_config_t for the
- * "~/.subversion/config" file is under the key "config".
+ * "~/.subversion/config" file is under the key "config".  @a config may
+ * be NULL.  This function examines some config settings under the
+ * "servers" key (if present) before loading the required RA module, and
+ * the RA module may also examine any config settings.
  *
  * All RA requests require a session; they will continue to
  * use @a pool for memory allocation.

Modified: subversion/branches/javahl-ra/subversion/include/svn_utf.h
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/include/svn_utf.h?rev=1425415&r1=1425414&r2=1425415&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/include/svn_utf.h (original)
+++ subversion/branches/javahl-ra/subversion/include/svn_utf.h Sun Dec 23 06:03:14 2012
@@ -236,6 +236,12 @@ svn_utf_cstring_from_utf8_string(const c
                                  const svn_string_t *src,
                                  apr_pool_t *pool);
 
+/** Return the display width of UTF-8-encoded C string @a cstr.
+ * If the string is not printable or invalid UTF-8, return -1.
+ * @since New in 1.8. */
+int
+svn_utf_cstring_utf8_width(const char *cstr);
+
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */

Modified: subversion/branches/javahl-ra/subversion/libsvn_client/checkout.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_client/checkout.c?rev=1425415&r1=1425414&r2=1425415&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_client/checkout.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_client/checkout.c Sun Dec 23 06:03:14 2012
@@ -168,10 +168,7 @@ svn_client__checkout_internal(svn_revnum
                                         allow_unver_obstructions,
                                         TRUE /* adds_as_modification */,
                                         FALSE, FALSE,
-                                        use_sleep, ctx,
-                                        ctx->conflict_func2,
-                                        ctx->conflict_baton2,
-                                        pool);
+                                        use_sleep, ctx, pool);
     }
 
   if (err)

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=1425415&r1=1425414&r2=1425415&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_client/client.h (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_client/client.h Sun Dec 23 06:03:14 2012
@@ -87,16 +87,18 @@ svn_client__get_revision_number(svn_revn
                                 const svn_opt_revision_t *revision,
                                 apr_pool_t *scratch_pool);
 
-/* Set *COPYFROM_PATH and *COPYFROM_REV to the path (without initial '/')
-   and revision that served as the source of the copy from which PATH_OR_URL
-   at REVISION was created, or NULL and SVN_INVALID_REVNUM (respectively) if
-   PATH_OR_URL at REVISION was not the result of a copy operation. */
-svn_error_t *svn_client__get_copy_source(const char *path_or_url,
-                                         const svn_opt_revision_t *revision,
-                                         const char **copyfrom_path,
-                                         svn_revnum_t *copyfrom_rev,
-                                         svn_client_ctx_t *ctx,
-                                         apr_pool_t *pool);
+/* Set *ORIGINAL_REPOS_RELPATH and *ORIGINAL_REVISION to the original location
+   that served as the source of the copy from which PATH_OR_URL at REVISION was
+   created, or NULL and SVN_INVALID_REVNUM (respectively) if PATH_OR_URL at
+   REVISION was not the result of a copy operation. */
+svn_error_t *
+svn_client__get_copy_source(const char **original_repos_relpath,
+                            svn_revnum_t *original_revision,
+                            const char *path_or_url,
+                            const svn_opt_revision_t *revision,
+                            svn_client_ctx_t *ctx,
+                            apr_pool_t *result_pool,
+                            apr_pool_t *scratch_pool);
 
 /* Set *START_URL and *START_REVISION (and maybe *END_URL
    and *END_REVISION) to the revisions and repository URLs of one
@@ -461,10 +463,6 @@ svn_client__make_local_parents(const cha
    target which are missing from the working copy.
 
    NOTE:  You may not specify both INNERUPDATE and MAKE_PARENTS as true.
-
-   Use CONFLICT_FUNC2 and CONFLICT_BATON2 instead of CTX->CONFLICT_FUNC2
-   and CTX->CONFLICT_BATON2. If CONFLICT_FUNC2 is NULL, postpone all conflicts
-   allowing the caller to perform post-update conflict resolution.
 */
 svn_error_t *
 svn_client__update_internal(svn_revnum_t *result_rev,
@@ -479,8 +477,6 @@ svn_client__update_internal(svn_revnum_t
                             svn_boolean_t innerupdate,
                             svn_boolean_t *timestamp_sleep,
                             svn_client_ctx_t *ctx,
-                            svn_wc_conflict_resolver_func2_t conflict_func2,
-                            void *conflict_baton2,
                             apr_pool_t *pool);
 
 /* Checkout into LOCAL_ABSPATH a working copy of URL at REVISION, and (if not
@@ -967,32 +963,6 @@ svn_client__do_external_status(svn_clien
                                void *status_baton,
                                apr_pool_t *pool);
 
-/* Baton type for svn_wc__external_info_gatherer(). */
-typedef struct svn_client__external_func_baton_t
-{
-  apr_hash_t *externals_old;  /* Hash of old externals property values,
-                                 or NULL if the caller doesn't care. */
-  apr_hash_t *externals_new;  /* Hash of new externals property values,
-                                 or NULL if the caller doesn't care. */
-  apr_hash_t *ambient_depths; /* Hash of ambient depth values, or NULL
-                                 if the caller doesn't care. */
-  apr_pool_t *result_pool;    /* Pool to use for all stored values. */
-
-} svn_client__external_func_baton_t;
-
-
-/* This function gets invoked whenever external changes are encountered.
-   This implements the `svn_wc_external_update_t' interface, and can
-   be used with an svn_client__external_func_baton_t BATON to gather
-   information about changes to externals definitions. */
-svn_error_t *
-svn_client__external_info_gatherer(void *baton,
-                                   const char *local_abspath,
-                                   const svn_string_t *old_val,
-                                   const svn_string_t *new_val,
-                                   svn_depth_t depth,
-                                   apr_pool_t *scratch_pool);
-
 /* Baton for svn_client__dirent_fetcher */
 struct svn_client__dirent_fetcher_baton_t
 {

Modified: subversion/branches/javahl-ra/subversion/libsvn_client/externals.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_client/externals.c?rev=1425415&r1=1425414&r2=1425415&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_client/externals.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_client/externals.c Sun Dec 23 06:03:14 2012
@@ -63,7 +63,10 @@ relegate_dir_external(svn_wc_context_t *
 {
   svn_error_t *err = SVN_NO_ERROR;
 
-  err = svn_wc__external_remove(wc_ctx, wri_abspath, local_abspath,
+  SVN_ERR(svn_wc__acquire_write_lock(NULL, wc_ctx, local_abspath,
+                                     FALSE, scratch_pool, scratch_pool));
+
+  err = svn_wc__external_remove(wc_ctx, wri_abspath, local_abspath, FALSE,
                                 cancel_func, cancel_baton, scratch_pool);
   if (err && (err->apr_err == SVN_ERR_WC_LEFT_LOCAL_MOD))
     {
@@ -103,8 +106,21 @@ relegate_dir_external(svn_wc_context_t *
       /* Do our best, but no biggy if it fails. The rename will fail. */
       svn_error_clear(svn_io_remove_file2(new_path, TRUE, scratch_pool));
 
-      /* Rename. */
-      SVN_ERR(svn_io_file_rename(local_abspath, new_path, scratch_pool));
+      /* Rename. If this is still a working copy we should use the working
+         copy rename function (to release open handles) */
+      err = svn_wc__rename_wc(wc_ctx, local_abspath, new_path,
+                              scratch_pool);
+
+      if (err && err->apr_err == SVN_ERR_WC_PATH_UNEXPECTED_STATUS)
+        {
+          svn_error_clear(err);
+
+          /* And if it is no longer a working copy, we should just rename
+             it */
+          err = svn_io_file_rename(local_abspath, new_path, scratch_pool);
+        }
+
+      /* ### TODO: We should notify the user about the rename */
     }
 
   return svn_error_trace(err);
@@ -169,10 +185,7 @@ switch_dir_external(const char *local_ab
                                                   FALSE, FALSE, FALSE, TRUE,
                                                   FALSE, TRUE,
                                                   timestamp_sleep,
-                                                  ctx,
-                                                  ctx->conflict_func2,
-                                                  ctx->conflict_baton2,
-                                                  subpool));
+                                                  ctx, subpool));
               svn_pool_destroy(subpool);
               goto cleanup;
             }
@@ -250,9 +263,6 @@ switch_dir_external(const char *local_ab
   if (kind == svn_node_dir)
     {
       /* Buh-bye, old and busted ... */
-      SVN_ERR(svn_wc__acquire_write_lock(NULL, ctx->wc_ctx, local_abspath,
-                                         FALSE, pool, pool));
-
       SVN_ERR(relegate_dir_external(ctx->wc_ctx, defining_abspath,
                                     local_abspath,
                                     ctx->cancel_func, ctx->cancel_baton,
@@ -439,7 +449,8 @@ switch_file_external(const char *local_a
                                               peg_revision, revision,
                                               ctx, subpool));
 
-    SVN_ERR(svn_ra_reparent(ra_session, url, subpool));
+    SVN_ERR(svn_ra_reparent(ra_session, svn_uri_dirname(url, subpool),
+                            subpool));
 
     SVN_ERR(svn_wc__get_file_external_editor(&switch_editor, &switch_baton,
                                              &revnum, ctx->wc_ctx,
@@ -515,19 +526,18 @@ handle_external_item_removal(const svn_c
   SVN_ERR(svn_wc_read_kind(&kind, ctx->wc_ctx, local_abspath, FALSE,
                            scratch_pool));
 
-  if (kind == svn_node_none)
-    return SVN_NO_ERROR; /* It's neither... Nothing to remove */
-
-  SVN_ERR(svn_wc_locked2(&lock_existed, NULL, ctx->wc_ctx,
-                         local_abspath, scratch_pool));
-
-  if (! lock_existed)
+  if (kind != svn_node_none)
     {
-      SVN_ERR(svn_wc__acquire_write_lock(&lock_root_abspath,
-                                         ctx->wc_ctx, local_abspath,
-                                         FALSE,
-                                         scratch_pool,
-                                         scratch_pool));
+      SVN_ERR(svn_wc_locked2(&lock_existed, NULL, ctx->wc_ctx,
+                             local_abspath, scratch_pool));
+
+      if (! lock_existed)
+        {
+          SVN_ERR(svn_wc__acquire_write_lock(&lock_root_abspath,
+                                             ctx->wc_ctx, local_abspath,
+                                             FALSE,
+                                             scratch_pool, scratch_pool));
+        }
     }
 
   /* We don't use relegate_dir_external() here, because we know that
@@ -535,7 +545,7 @@ handle_external_item_removal(const svn_c
      going to need this directory, and therefore it's better to
      leave stuff where the user expects it. */
   err = svn_wc__external_remove(ctx->wc_ctx, defining_abspath,
-                                local_abspath,
+                                local_abspath, (kind == svn_node_none),
                                 ctx->cancel_func, ctx->cancel_baton,
                                 scratch_pool);
 
@@ -794,6 +804,7 @@ handle_externals_change(svn_client_ctx_t
       const char *old_defining_abspath;
       svn_wc_external_item2_t *new_item;
       const char *target_abspath;
+      svn_boolean_t under_root;
 
       new_item = APR_ARRAY_IDX(new_desc, i, svn_wc_external_item2_t *);
 
@@ -802,8 +813,20 @@ handle_externals_change(svn_client_ctx_t
       if (ctx->cancel_func)
         SVN_ERR(ctx->cancel_func(ctx->cancel_baton));
 
-      target_abspath = svn_dirent_join(local_abspath, new_item->target_dir,
-                                       iterpool);
+      SVN_ERR(svn_dirent_is_under_root(&under_root, &target_abspath,
+                                       local_abspath, new_item->target_dir,
+                                       iterpool));
+
+      if (! under_root)
+        {
+          return svn_error_createf(
+                    SVN_ERR_WC_OBSTRUCTED_UPDATE, NULL,
+                    _("Path '%s' is not in the working copy"),
+                    svn_dirent_local_style(
+                        svn_dirent_join(local_abspath, new_item->target_dir,
+                                        iterpool),
+                        iterpool));
+        }
 
       old_defining_abspath = apr_hash_get(old_externals, target_abspath,
                                           APR_HASH_KEY_STRING);
@@ -987,13 +1010,26 @@ svn_client__export_externals(apr_hash_t 
         {
           const char *item_abspath;
           const char *new_url;
+          svn_boolean_t under_root;
           svn_wc_external_item2_t *item = APR_ARRAY_IDX(items, i,
                                                 svn_wc_external_item2_t *);
 
           svn_pool_clear(sub_iterpool);
 
-          item_abspath = svn_dirent_join(local_abspath, item->target_dir,
-                                         sub_iterpool);
+          SVN_ERR(svn_dirent_is_under_root(&under_root, &item_abspath,
+                                           local_abspath, item->target_dir,
+                                           sub_iterpool));
+
+          if (! under_root)
+            {
+              return svn_error_createf(
+                        SVN_ERR_WC_OBSTRUCTED_UPDATE, NULL,
+                        _("Path '%s' is not in the working copy"),
+                        svn_dirent_local_style(
+                            svn_dirent_join(local_abspath, item->target_dir,
+                                            sub_iterpool),
+                            sub_iterpool));
+            }
 
           SVN_ERR(svn_wc__resolve_relative_external_url(&new_url, item,
                                                         repos_root_url,
@@ -1095,35 +1131,3 @@ svn_client__do_external_status(svn_clien
   return SVN_NO_ERROR;
 }
 
-
-/* Implements the `svn_wc_externals_update_t' interface. */
-svn_error_t *
-svn_client__external_info_gatherer(void *baton,
-                                   const char *local_abspath,
-                                   const svn_string_t *old_value,
-                                   const svn_string_t *new_value,
-                                   svn_depth_t depth,
-                                   apr_pool_t *scratch_pool)
-{
-  svn_client__external_func_baton_t *efb = baton;
-
-  local_abspath = apr_pstrdup(efb->result_pool, local_abspath);
-
-  if (efb->externals_old != NULL && old_value != NULL)
-    apr_hash_set(efb->externals_old, local_abspath, APR_HASH_KEY_STRING,
-                 apr_pstrndup(efb->result_pool,
-                              old_value->data, old_value->len));
-
-  if (efb->externals_new != NULL && new_value != NULL)
-    apr_hash_set(efb->externals_new, local_abspath, APR_HASH_KEY_STRING,
-                 apr_pstrndup(efb->result_pool,
-                              new_value->data, new_value->len));
-
-  if (efb->ambient_depths != NULL)
-    apr_hash_set(efb->ambient_depths, local_abspath, APR_HASH_KEY_STRING,
-                 svn_depth_to_word(depth));
-
-  return SVN_NO_ERROR;
-}
-
-

Modified: subversion/branches/javahl-ra/subversion/libsvn_client/log.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_client/log.c?rev=1425415&r1=1425414&r2=1425415&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_client/log.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_client/log.c Sun Dec 23 06:03:14 2012
@@ -90,23 +90,24 @@ copyfrom_info_receiver(svn_location_segm
 }
 
 svn_error_t *
-svn_client__get_copy_source(const char *path_or_url,
+svn_client__get_copy_source(const char **original_repos_relpath,
+                            svn_revnum_t *original_revision,
+                            const char *path_or_url,
                             const svn_opt_revision_t *revision,
-                            const char **copyfrom_path,
-                            svn_revnum_t *copyfrom_rev,
                             svn_client_ctx_t *ctx,
-                            apr_pool_t *pool)
+                            apr_pool_t *result_pool,
+                            apr_pool_t *scratch_pool)
 {
   svn_error_t *err;
   copyfrom_info_t copyfrom_info = { 0 };
-  apr_pool_t *sesspool = svn_pool_create(pool);
+  apr_pool_t *sesspool = svn_pool_create(scratch_pool);
   svn_ra_session_t *ra_session;
   svn_client__pathrev_t *at_loc;
 
   copyfrom_info.is_first = TRUE;
   copyfrom_info.path = NULL;
   copyfrom_info.rev = SVN_INVALID_REVNUM;
-  copyfrom_info.pool = pool;
+  copyfrom_info.pool = result_pool;
 
   SVN_ERR(svn_client__ra_session_from_path2(&ra_session, &at_loc,
                                             path_or_url, NULL,
@@ -119,7 +120,7 @@ svn_client__get_copy_source(const char *
   err = svn_ra_get_location_segments(ra_session, "", at_loc->rev, at_loc->rev,
                                      SVN_INVALID_REVNUM,
                                      copyfrom_info_receiver, &copyfrom_info,
-                                     pool);
+                                     scratch_pool);
 
   svn_pool_destroy(sesspool);
 
@@ -133,14 +134,14 @@ svn_client__get_copy_source(const char *
             svn_error_clear(err);
             err = SVN_NO_ERROR;
 
-            *copyfrom_path = NULL;
-            *copyfrom_rev = SVN_INVALID_REVNUM;
+            *original_repos_relpath = NULL;
+            *original_revision = SVN_INVALID_REVNUM;
         }
       return svn_error_trace(err);
     }
 
-  *copyfrom_path = copyfrom_info.path;
-  *copyfrom_rev = copyfrom_info.rev;
+  *original_repos_relpath = copyfrom_info.path;
+  *original_revision = copyfrom_info.rev;
   return SVN_NO_ERROR;
 }
 

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=1425415&r1=1425414&r2=1425415&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_client/merge.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_client/merge.c Sun Dec 23 06:03:14 2012
@@ -597,13 +597,15 @@ make_conflict_versions(const svn_wc_conf
   right_relpath = svn_client__pathrev_relpath(merge_source->loc2,
                                               pool);
 
-  *left = svn_wc_conflict_version_create(
+  *left = svn_wc_conflict_version_create2(
             merge_source->loc1->repos_root_url,
+            merge_source->loc1->repos_uuid,
             svn_relpath_join(left_relpath, child, pool),
             merge_source->loc1->rev, node_kind, pool);
 
-  *right = svn_wc_conflict_version_create(
+  *right = svn_wc_conflict_version_create2(
              merge_source->loc2->repos_root_url,
+             merge_source->loc2->repos_uuid,
              svn_relpath_join(right_relpath, child, pool),
              merge_source->loc2->rev, node_kind, pool);
 
@@ -661,13 +663,24 @@ tree_conflict(merge_cmd_baton_t *merge_b
               svn_wc_conflict_reason_t reason)
 {
   const svn_wc_conflict_description2_t *existing_conflict;
+  svn_error_t *err;
 
   if (merge_b->record_only || merge_b->dry_run)
     return SVN_NO_ERROR;
 
-  SVN_ERR(svn_wc__get_tree_conflict(&existing_conflict, merge_b->ctx->wc_ctx,
-                                    victim_abspath, merge_b->pool,
-                                    merge_b->pool));
+  err = svn_wc__get_tree_conflict(&existing_conflict, merge_b->ctx->wc_ctx,
+                                  victim_abspath, merge_b->pool,
+                                  merge_b->pool);
+
+  if (err)
+    {
+      if (err->apr_err != SVN_ERR_WC_PATH_NOT_FOUND)
+        return svn_error_trace(err);
+
+      svn_error_clear(err);
+      existing_conflict = FALSE;
+    }
+
   if (existing_conflict == NULL)
     {
       svn_wc_conflict_description2_t *conflict;
@@ -1363,12 +1376,19 @@ merge_dir_props_changed(svn_wc_notify_st
      definition, 'svn merge' shouldn't touch any pristine data  */
   if (props->nelts)
     {
+      const svn_wc_conflict_version_t *left;
+      const svn_wc_conflict_version_t *right;
       svn_client_ctx_t *ctx = merge_b->ctx;
 
+      SVN_ERR(make_conflict_versions(&left, &right, local_abspath,
+                                     svn_node_dir, &merge_b->merge_source,
+                                     merge_b->target, merge_b->pool));
+
       SVN_ERR(svn_wc_merge_props3(state, ctx->wc_ctx, local_abspath,
-                                  NULL, NULL, original_props, props,
+                                  left, right,
+                                  original_props, props,
                                   merge_b->dry_run,
-                                  NULL, NULL, /* postpone conflicts */
+                                  ctx->conflict_func2, ctx->conflict_baton2,
                                   ctx->cancel_func, ctx->cancel_baton,
                                   scratch_pool));
     }
@@ -1682,7 +1702,7 @@ merge_file_changed(svn_wc_notify_state_t
                                   left, right,
                                   original_props, prop_changes,
                                   merge_b->dry_run,
-                                  NULL, NULL, /* postpone conflicts */
+                                  ctx->conflict_func2, ctx->conflict_baton2,
                                   ctx->cancel_func, ctx->cancel_baton,
                                   scratch_pool));
     }
@@ -1716,8 +1736,8 @@ merge_file_changed(svn_wc_notify_state_t
                                       local_abspath, FALSE, scratch_pool));
 
       /* Postpone all conflicts. */
-      conflict_baton.wrapped_func = NULL;
-      conflict_baton.wrapped_baton = NULL;
+      conflict_baton.wrapped_func = ctx->conflict_func2;
+      conflict_baton.wrapped_baton = ctx->conflict_baton2;
 
       conflict_baton.conflicted_paths = &merge_b->conflicted_paths;
       conflict_baton.pool = merge_b->pool;
@@ -1869,6 +1889,7 @@ merge_file_added(svn_wc_notify_state_t *
             svn_stream_t *new_contents, *new_base_contents;
             apr_hash_t *new_base_props, *new_props;
             const svn_wc_conflict_description2_t *existing_conflict;
+            svn_error_t *err;
 
             /* If this is a merge from the same repository as our
                working copy, we handle adds as add-with-history.
@@ -1904,10 +1925,20 @@ merge_file_added(svn_wc_notify_state_t *
                                                  scratch_pool, scratch_pool));
               }
 
-            SVN_ERR(svn_wc__get_tree_conflict(&existing_conflict,
-                                              merge_b->ctx->wc_ctx,
-                                              mine_abspath, merge_b->pool,
-                                              merge_b->pool));
+            err = svn_wc__get_tree_conflict(&existing_conflict,
+                                            merge_b->ctx->wc_ctx,
+                                            mine_abspath, merge_b->pool,
+                                            merge_b->pool);
+
+            if (err)
+              {
+                if (err->apr_err != SVN_ERR_WC_PATH_NOT_FOUND)
+                  return svn_error_trace(err);
+
+                svn_error_clear(err);
+                existing_conflict = FALSE;
+              }
+
             if (existing_conflict)
               {
                 svn_boolean_t moved_here;
@@ -2396,6 +2427,10 @@ merge_dir_added(svn_wc_notify_state_t *s
                                            reason));
               if (tree_conflicted)
                 *tree_conflicted = TRUE;
+              if (skip)
+                *skip = TRUE;
+              if (skip_children)
+                *skip_children = TRUE;
               if (state)
                 *state = svn_wc_notify_state_obstructed;
             }
@@ -3299,7 +3334,7 @@ adjust_deleted_subtree_ranges(svn_client
       http://subversion.tigris.org/issues/show_bug.cgi?id=3137 fixed some of
       the cases where different RA layers returned different error codes to
       signal the "path not found"...but it looks like there is more to do.
-      
+
       ### Do we still need to special case for ra_neon (since it no longer
           exists)? */
   if (err)
@@ -6223,15 +6258,16 @@ merge_range_find_extremes(svn_revnum_t *
         *max_rev_p = range_max;
     }
 }
+
 /* Wrapper around svn_ra_get_log2(). Invoke RECEIVER with RECEIVER_BATON
- * on each commit from START to END on TARGET.
- * Important: Revision properties are not retrieved by this functions for
+ * on each commit from YOUNGEST_REV to OLDEST_REV in which TARGET_RELPATH
+ * changed.  TARGET_RELPATH is relative to RA_SESSION's URL.
+ * Important: Revision properties are not retrieved by this function for
  * performance reasons.
  */
-
 static svn_error_t *
 get_log(svn_ra_session_t *ra_session,
-        const char *target,
+        const char *target_relpath,
         svn_revnum_t youngest_rev,
         svn_revnum_t oldest_rev,
         svn_boolean_t discover_changed_paths,
@@ -6241,14 +6277,16 @@ get_log(svn_ra_session_t *ra_session,
 {
   apr_array_header_t *log_targets;
   apr_array_header_t *revprops;
-  
+
   log_targets = apr_array_make(pool, 1, sizeof(const char *));
-  APR_ARRAY_PUSH(log_targets, const char *) = target;
+  APR_ARRAY_PUSH(log_targets, const char *) = target_relpath;
 
   revprops = apr_array_make(pool, 0, sizeof(const char *));
 
   SVN_ERR(svn_ra_get_log2(ra_session, log_targets, youngest_rev,
-                          oldest_rev, 0, discover_changed_paths, FALSE, FALSE,
+                          oldest_rev, 0 /* limit */, discover_changed_paths,
+                          FALSE /* strict_node_history */,
+                          FALSE /* include_merged_revisions */,
                           revprops, receiver, receiver_baton, pool));
 
   return SVN_NO_ERROR;
@@ -6548,8 +6586,9 @@ normalize_merge_sources_internal(apr_arr
             {
               svn_location_segment_t *segment2 =
                 APR_ARRAY_IDX(segments, 1, svn_location_segment_t *);
-              const char *copyfrom_path, *segment_url;
-              svn_revnum_t copyfrom_rev;
+              const char *segment_url;
+              const char *original_repos_relpath;
+              svn_revnum_t original_revision;
               svn_opt_revision_t range_start_rev;
               range_start_rev.kind = svn_opt_revision_number;
               range_start_rev.value.number = segment2->range_start;
@@ -6557,24 +6596,23 @@ normalize_merge_sources_internal(apr_arr
               segment_url = svn_path_url_add_component2(
                               source_loc->repos_root_url, segment2->path,
                               scratch_pool);
-              SVN_ERR(svn_client__get_copy_source(segment_url,
-                                                  &range_start_rev,
-                                                  &copyfrom_path,
-                                                  &copyfrom_rev,
-                                                  ctx, result_pool));
+              SVN_ERR(svn_client__get_copy_source(&original_repos_relpath,
+                                                  &original_revision,
+                                                  segment_url,
+                                                  &range_start_rev, ctx,
+                                                  result_pool, scratch_pool));
               /* Got copyfrom data?  Fix up the first segment to cover
                  back to COPYFROM_REV + 1, and then prepend a new
                  segment covering just COPYFROM_REV. */
-              if (copyfrom_path && SVN_IS_VALID_REVNUM(copyfrom_rev))
+              if (original_repos_relpath)
                 {
                   svn_location_segment_t *new_segment =
                     apr_pcalloc(result_pool, sizeof(*new_segment));
-                  /* Skip the leading '/'. */
-                  new_segment->path = (*copyfrom_path == '/')
-                    ? copyfrom_path + 1 : copyfrom_path;
-                  new_segment->range_start = copyfrom_rev;
-                  new_segment->range_end = copyfrom_rev;
-                  segment->range_start = copyfrom_rev + 1;
+
+                  new_segment->path = original_repos_relpath;
+                  new_segment->range_start = original_revision;
+                  new_segment->range_end = original_revision;
+                  segment->range_start = original_revision + 1;
                   svn_sort__array_insert(&new_segment, segments, 0);
                 }
             }
@@ -7458,7 +7496,7 @@ log_find_operative_subtree_revs(void *ba
    Set *OPERATIVE_CHILDREN to a hash (mapping const char * absolute
    working copy paths to those path's const char * repos absolute paths)
    containing all the immediate subtrees of MERGE_TARGET_ABSPATH which would
-   have a different diff applied if MERGE_SOURCE_REPOS_PATH
+   have a different diff applied if MERGE_SOURCE_FSPATH
    -r(OLDEST_REV - 1):YOUNGEST_REV were merged to MERGE_TARGET_ABSPATH at
    svn_depth_infinity rather than DEPTH.
 
@@ -9692,22 +9730,6 @@ merge_locked(const char *source1,
   if (err)
     return svn_error_trace(err);
 
-  if (ctx->conflict_func2)
-    {
-      /* Resolve conflicts within the merge target. */
-      SVN_ERR(svn_wc__resolve_conflicts(ctx->wc_ctx, target_abspath,
-                                        depth,
-                                        TRUE /* resolve_text */,
-                                        "" /* resolve_prop (ALL props) */,
-                                        TRUE /* resolve_tree */,
-                                        svn_wc_conflict_choose_unspecified,
-                                        ctx->conflict_func2,
-                                        ctx->conflict_baton2,
-                                        ctx->cancel_func, ctx->cancel_baton,
-                                        ctx->notify_func2, ctx->notify_baton2,
-                                        scratch_pool));
-    }
-
   return SVN_NO_ERROR;
 }
 
@@ -9995,9 +10017,8 @@ log_find_operative_revs(void *baton,
    MERGEINFO_CATALOG may be empty if the source has no explicit or inherited
    mergeinfo.
 
-   Using RA_SESSION, which is pointed at TARGET_LOC, check that all
-   of the unmerged revisions in UNMERGED_CATALOG's mergeinfos are "phantoms",
-   that is, one of the following conditions holds:
+   Check that all of the unmerged revisions in UNMERGED_CATALOG's
+   mergeinfos are "phantoms", that is, one of the following conditions holds:
 
      1) The revision affects no corresponding paths in SOURCE_LOC.
 
@@ -10011,6 +10032,9 @@ log_find_operative_revs(void *baton,
    Note: The keys in all mergeinfo catalogs used here are relative to the
    root of the repository.
 
+   RA_SESSION is an RA session open to the repository of TARGET_LOC; it may
+   be temporarily reparented within this function.
+
    Use SCRATCH_POOL for all temporary allocations. */
 static svn_error_t *
 find_unsynced_ranges(const svn_client__pathrev_t *source_loc,
@@ -10057,6 +10081,10 @@ find_unsynced_ranges(const svn_client__p
                        potentially_unmerged_ranges->nelts - 1,
                        svn_merge_range_t *))->end;
       log_find_operative_baton_t log_baton;
+      const char *old_session_url;
+
+      SVN_ERR(svn_client__ensure_ra_session_url(
+                &old_session_url, ra_session, target_loc->url, scratch_pool));
 
       log_baton.merged_catalog = merged_catalog;
       log_baton.unmerged_catalog = true_unmerged_catalog;
@@ -10070,6 +10098,8 @@ find_unsynced_ranges(const svn_client__p
                       TRUE, /* discover_changed_paths */
                       log_find_operative_revs, &log_baton,
                       scratch_pool));
+
+      SVN_ERR(svn_ra_reparent(ra_session, old_session_url, scratch_pool));
     }
 
   return SVN_NO_ERROR;
@@ -10120,6 +10150,9 @@ find_youngest_merged_rev(svn_revnum_t *y
  * place, to include the natural history (implicit mergeinfo) of
  * SOURCE_PATHREV.  ### But make these additions in SCRATCH_POOL.
  *
+ * SOURCE_RA_SESSION is an RA session open to the repository containing
+ * SOURCE_PATHREV; it may be temporarily reparented within this function.
+ *
  * ### [JAF] This function is named '..._subroutine' simply because I
  *     factored it out based on code similarity, without knowing what it's
  *     purpose is.  We should clarify its purpose and choose a better name.
@@ -10279,8 +10312,6 @@ find_unmerged_mergeinfo(svn_mergeinfo_ca
              exist at all.  If simply doesn't exist we can ignore it
              altogether. */
           svn_node_kind_t kind;
-          svn_mergeinfo_catalog_t subtree_catalog;
-          apr_array_header_t *source_paths_rel_to_session;
 
           SVN_ERR(svn_ra_check_path(source_ra_session,
                                     path_rel_to_session,
@@ -10290,20 +10321,11 @@ find_unmerged_mergeinfo(svn_mergeinfo_ca
           /* Else source_path does exist though it has no explicit mergeinfo.
              Find its inherited mergeinfo.  If it doesn't have any then simply
              set source_mergeinfo to an empty hash. */
-          source_paths_rel_to_session =
-            apr_array_make(iterpool, 1, sizeof(const char *));
-          APR_ARRAY_PUSH(source_paths_rel_to_session, const char *)
-            = path_rel_to_session;
-          SVN_ERR(svn_ra_get_mergeinfo(source_ra_session, &subtree_catalog,
-                                       source_paths_rel_to_session,
-                                       source_loc->rev, svn_mergeinfo_inherited,
-                                       FALSE, iterpool));
-          if (subtree_catalog)
-            source_mergeinfo = apr_hash_get(subtree_catalog,
-                                            path_rel_to_session,
-                                            APR_HASH_KEY_STRING);
-
-          /* A path might not have any inherited mergeinfo either. */
+          SVN_ERR(svn_client__get_repos_mergeinfo(
+                    &source_mergeinfo, source_ra_session,
+                    source_pathrev->url, source_pathrev->rev,
+                    svn_mergeinfo_inherited, FALSE /*squelch_incapable*/,
+                    iterpool));
           if (!source_mergeinfo)
             source_mergeinfo = apr_hash_make(iterpool);
         }
@@ -10457,8 +10479,6 @@ calculate_left_hand_side(svn_client__pat
                          apr_pool_t *scratch_pool)
 {
   svn_mergeinfo_catalog_t mergeinfo_catalog, unmerged_catalog;
-  apr_array_header_t *source_repos_rel_path_as_array
-    = apr_array_make(scratch_pool, 1, sizeof(const char *));
   apr_pool_t *iterpool = svn_pool_create(scratch_pool);
   apr_hash_index_t *hi;
   /* hash of paths mapped to arrays of svn_mergeinfo_t. */
@@ -10534,18 +10554,11 @@ calculate_left_hand_side(svn_client__pat
 
   /* Get the mergeinfo from the source, including its descendants
      with differing explicit mergeinfo. */
-  APR_ARRAY_PUSH(source_repos_rel_path_as_array, const char *) = "";
-  SVN_ERR(svn_ra_get_mergeinfo(source_ra_session, &mergeinfo_catalog,
-                               source_repos_rel_path_as_array, source_loc->rev,
-                               svn_mergeinfo_inherited,
-                               TRUE, iterpool));
-
-  if (mergeinfo_catalog)
-    SVN_ERR(svn_mergeinfo__add_prefix_to_catalog(&mergeinfo_catalog,
-                                                 mergeinfo_catalog,
-                                                 svn_client__pathrev_relpath(
-                                                   source_loc, iterpool),
-                                                 iterpool, iterpool));
+  SVN_ERR(svn_client__get_repos_mergeinfo_catalog(
+            &mergeinfo_catalog, source_ra_session,
+            source_loc->url, source_loc->rev,
+            svn_mergeinfo_inherited, FALSE /* squelch_incapable */,
+            TRUE /* include_descendants */, iterpool, iterpool));
 
   if (!mergeinfo_catalog)
     mergeinfo_catalog = apr_hash_make(iterpool);
@@ -10594,8 +10607,7 @@ calculate_left_hand_side(svn_client__pat
 }
 
 /* Determine the URLs and revisions needed to perform a reintegrate merge
- * from SOURCE_PATH_OR_URL at SOURCE_PEG_REVISION into the working
- * copy at TARGET.
+ * from SOURCE_LOC into the working copy at TARGET.
  *
  * SOURCE_RA_SESSION and TARGET_RA_SESSION are RA sessions opened to the
  * source and target branches respectively.
@@ -11005,22 +11017,6 @@ merge_peg_locked(const char *source_path
   /* We're done with our RA session. */
   svn_pool_destroy(sesspool);
 
-  if (ctx->conflict_func2)
-    {
-      /* Resolve conflicts within the merge target. */
-      SVN_ERR(svn_wc__resolve_conflicts(ctx->wc_ctx, target_abspath,
-                                        depth,
-                                        TRUE /* resolve_text */,
-                                        "" /* resolve_prop (ALL props) */,
-                                        TRUE /* resolve_tree */,
-                                        svn_wc_conflict_choose_unspecified,
-                                        ctx->conflict_func2,
-                                        ctx->conflict_baton2,
-                                        ctx->cancel_func, ctx->cancel_baton,
-                                        ctx->notify_func2, ctx->notify_baton2,
-                                        scratch_pool));
-    }
-
   return svn_error_trace(err);
 }
 
@@ -11623,6 +11619,24 @@ do_symmetric_merge_locked(const svn_clie
       merge_source_t source;
       svn_ra_session_t *ra_session = NULL;
 
+      /* Check for and reject any abnormalities -- such as revisions that
+       * have not yet been merged in the opposite direction -- that a
+       * 'reintegrate' merge would have rejected. */
+      {
+        merge_source_t *source2;
+        svn_ra_session_t *source_ra_session = NULL;
+        svn_ra_session_t *target_ra_session = NULL;
+
+        SVN_ERR(ensure_ra_session_url(&source_ra_session, merge->right->url,
+                                      ctx, scratch_pool));
+        SVN_ERR(ensure_ra_session_url(&target_ra_session, target->loc.url,
+                                      ctx, scratch_pool));
+        SVN_ERR(find_reintegrate_merge(&source2, NULL,
+                                       source_ra_session, merge->right,
+                                       target_ra_session, target,
+                                       ctx, scratch_pool, scratch_pool));
+      }
+
       source.loc1 = merge->base;
       source.loc2 = merge->right;
       source.ancestral = (merge->mid == NULL);
@@ -11674,22 +11688,6 @@ do_symmetric_merge_locked(const svn_clie
 
   SVN_ERR(err);
 
-  if (ctx->conflict_func2)
-    {
-      /* Resolve conflicts within the merge target. */
-      SVN_ERR(svn_wc__resolve_conflicts(ctx->wc_ctx, target_abspath,
-                                        depth,
-                                        TRUE /* resolve_text */,
-                                        "" /* resolve_prop (ALL props) */,
-                                        TRUE /* resolve_tree */,
-                                        svn_wc_conflict_choose_unspecified,
-                                        ctx->conflict_func2,
-                                        ctx->conflict_baton2,
-                                        ctx->cancel_func, ctx->cancel_baton,
-                                        ctx->notify_func2, ctx->notify_baton2,
-                                        scratch_pool));
-    }
-
   return SVN_NO_ERROR;
 }
 

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=1425415&r1=1425414&r2=1425415&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_client/mergeinfo.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_client/mergeinfo.c Sun Dec 23 06:03:14 2012
@@ -1087,7 +1087,6 @@ get_mergeinfo(svn_mergeinfo_catalog_t *m
     }
   else /* ! svn_path_is_url() */
     {
-      /* Acquire return values. */
       SVN_ERR(svn_client__get_wc_or_repos_mergeinfo_catalog(
         mergeinfo_catalog, NULL, NULL, include_descendants, FALSE,
         ignore_invalid_mergeinfo, svn_mergeinfo_inherited,
@@ -2095,9 +2094,9 @@ svn_client_suggest_merge_sources(apr_arr
       mergeinfo = NULL;
     }
 
-  SVN_ERR(svn_client__get_copy_source(path_or_url, peg_revision,
-                                      &copyfrom_path, &copyfrom_rev,
-                                      ctx, pool));
+  SVN_ERR(svn_client__get_copy_source(&copyfrom_path, &copyfrom_rev,
+                                      path_or_url, peg_revision, ctx,
+                                      pool, pool));
   if (copyfrom_path)
     {
       APR_ARRAY_PUSH(list, const char *) =

Modified: subversion/branches/javahl-ra/subversion/libsvn_client/mergeinfo.h
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_client/mergeinfo.h?rev=1425415&r1=1425414&r2=1425415&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_client/mergeinfo.h (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_client/mergeinfo.h Sun Dec 23 06:03:14 2012
@@ -300,7 +300,7 @@ svn_client__get_wc_or_repos_mergeinfo_ca
    If HAS_REV_ZERO_HISTORY is not NULL, then set *HAS_REV_ZERO_HISTORY to
    TRUE if the natural history includes revision 0, else to FALSE.
 
-   RA_SESSION is an open RA session to the repository in which URL lives;
+   RA_SESSION is an open RA session to the repository of PATHREV;
    it may be temporarily reparented by this function.
 */
 svn_error_t *

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=1425415&r1=1425414&r2=1425415&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_client/switch.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_client/switch.c Sun Dec 23 06:03:14 2012
@@ -237,7 +237,7 @@ switch_internal(svn_revnum_t *result_rev
                                     server_supports_depth,
                                     diff3_cmd, preserved_exts,
                                     svn_client__dirent_fetcher, &dfb,
-                                    NULL, NULL, /* postpone conflicts */
+                                    ctx->conflict_func2, ctx->conflict_baton2,
                                     NULL, NULL,
                                     ctx->cancel_func, ctx->cancel_baton,
                                     ctx->notify_func2, ctx->notify_baton2,
@@ -323,22 +323,6 @@ switch_internal(svn_revnum_t *result_rev
   if (result_rev)
     *result_rev = revnum;
 
-  if (ctx->conflict_func2)
-    {
-      /* Resolve conflicts within the switched target. */
-      SVN_ERR(svn_wc__resolve_conflicts(ctx->wc_ctx, local_abspath,
-                                        depth,
-                                        TRUE /* resolve_text */,
-                                        "" /* resolve_prop (ALL props) */,
-                                        TRUE /* resolve_tree */,
-                                        svn_wc_conflict_choose_unspecified,
-                                        ctx->conflict_func2,
-                                        ctx->conflict_baton2,
-                                        ctx->cancel_func, ctx->cancel_baton,
-                                        ctx->notify_func2, ctx->notify_baton2,
-                                        pool));
-    }
-
   return SVN_NO_ERROR;
 }
 

Modified: subversion/branches/javahl-ra/subversion/libsvn_client/update.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_client/update.c?rev=1425415&r1=1425414&r2=1425415&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_client/update.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_client/update.c Sun Dec 23 06:03:14 2012
@@ -185,8 +185,6 @@ update_internal(svn_revnum_t *result_rev
                 svn_boolean_t *timestamp_sleep,
                 svn_boolean_t notify_summary,
                 svn_client_ctx_t *ctx,
-                svn_wc_conflict_resolver_func2_t conflict_func2,
-                void *conflict_baton2,
                 apr_pool_t *pool)
 {
   const svn_delta_editor_t *update_editor;
@@ -376,7 +374,7 @@ update_internal(svn_revnum_t *result_rev
                                     clean_checkout,
                                     diff3_cmd, preserved_exts,
                                     svn_client__dirent_fetcher, &dfb,
-                                    conflict_func2, conflict_baton2,
+                                    ctx->conflict_func2, ctx->conflict_baton2,
                                     NULL, NULL,
                                     ctx->cancel_func, ctx->cancel_baton,
                                     ctx->notify_func2, ctx->notify_baton2,
@@ -467,8 +465,6 @@ svn_client__update_internal(svn_revnum_t
                             svn_boolean_t innerupdate,
                             svn_boolean_t *timestamp_sleep,
                             svn_client_ctx_t *ctx,
-                            svn_wc_conflict_resolver_func2_t conflict_func2,
-                            void *conflict_baton2,
                             apr_pool_t *pool)
 {
   const char *anchor_abspath, *lockroot_abspath;
@@ -518,8 +514,7 @@ svn_client__update_internal(svn_revnum_t
                                 &peg_revision, svn_depth_empty, FALSE,
                                 ignore_externals, allow_unver_obstructions,
                                 adds_as_modification, timestamp_sleep,
-                                FALSE, ctx, conflict_func2, conflict_baton2,
-                                pool);
+                                FALSE, ctx, pool);
           if (err)
             goto cleanup;
           anchor_abspath = missing_parent;
@@ -543,7 +538,7 @@ svn_client__update_internal(svn_revnum_t
                         &peg_revision, depth, depth_is_sticky,
                         ignore_externals, allow_unver_obstructions,
                         adds_as_modification, timestamp_sleep,
-                        TRUE, ctx, conflict_func2, conflict_baton2, pool);
+                        TRUE, ctx, pool);
  cleanup:
   err = svn_error_compose_create(
             err,
@@ -604,7 +599,6 @@ svn_client_update4(apr_array_header_t **
                                         make_parents,
                                         FALSE, &sleep,
                                         ctx,
-                                        NULL, NULL, /* postpone conflicts */
                                         iterpool);
 
       if (err)
@@ -629,44 +623,10 @@ svn_client_update4(apr_array_header_t **
       if (result_revs)
         APR_ARRAY_PUSH(*result_revs, svn_revnum_t) = result_rev;
     }
+  svn_pool_destroy(iterpool);
 
   if (sleep)
     svn_io_sleep_for_timestamps((paths->nelts == 1) ? path : NULL, pool);
 
-  if (ctx->conflict_func2)
-    {
-      for (i = 0; i < paths->nelts; ++i)
-        {
-          svn_error_t *err = SVN_NO_ERROR;
-          const char *local_abspath;
-
-          svn_pool_clear(iterpool);
-          path = APR_ARRAY_IDX(paths, i, const char *);
-
-          /* Resolve conflicts within the updated subtree. */
-          SVN_ERR(svn_dirent_get_absolute(&local_abspath, path, iterpool));
-          err = svn_wc__resolve_conflicts(ctx->wc_ctx, local_abspath, depth,
-                                          TRUE /* resolve_text */,
-                                          "" /* resolve_prop (ALL props) */,
-                                          TRUE /* resolve_tree */,
-                                          svn_wc_conflict_choose_unspecified,
-                                          ctx->conflict_func2,
-                                          ctx->conflict_baton2,
-                                          ctx->cancel_func, ctx->cancel_baton,
-                                          ctx->notify_func2, ctx->notify_baton2,
-                                          iterpool);
-          if (err)
-            {
-              if ((err->apr_err != SVN_ERR_WC_NOT_WORKING_COPY)
-                  && (err->apr_err != SVN_ERR_WC_PATH_NOT_FOUND))
-                return svn_error_trace(err);
-
-              svn_error_clear(err);
-            }
-        }
-    }
-
-  svn_pool_destroy(iterpool);
-
   return SVN_NO_ERROR;
 }

Modified: subversion/branches/javahl-ra/subversion/libsvn_delta/svndiff.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_delta/svndiff.c?rev=1425415&r1=1425414&r2=1425415&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_delta/svndiff.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_delta/svndiff.c Sun Dec 23 06:03:14 2012
@@ -32,6 +32,7 @@
 #include <zlib.h>
 
 #include "private/svn_error_private.h"
+#include "private/svn_delta_private.h"
 
 /* The zlib compressBound function was not exported until 1.2.0. */
 #if ZLIB_VERNUM >= 0x1200
@@ -129,11 +130,12 @@ append_encoded_int(svn_stringbuf_t *head
   svn_stringbuf_appendbytes(header, (const char *)buf, p - buf);
 }
 
-/* If IN is a string that is >= MIN_COMPRESS_SIZE, zlib compress it and
-   place the result in OUT, with an integer prepended specifying the
-   original size.  If IN is < MIN_COMPRESS_SIZE, or if the compressed
-   version of IN was no smaller than the original IN, OUT will be a copy
-   of IN with the size prepended as an integer. */
+/* If IN is a string that is >= MIN_COMPRESS_SIZE and the COMPRESSION_LEVEL
+   is not SVN_DELTA_COMPRESSION_LEVEL_NONE, zlib compress it and places the
+   result in OUT, with an integer prepended specifying the original size.
+   If IN is < MIN_COMPRESS_SIZE, or if the compressed version of IN was no
+   smaller than the original IN, OUT will be a copy of IN with the size
+   prepended as an integer. */
 static svn_error_t *
 zlib_encode(const char *data,
             apr_size_t len,
@@ -143,6 +145,7 @@ zlib_encode(const char *data,
   unsigned long endlen;
   apr_size_t intlen;
 
+  svn_stringbuf_setempty(out);
   append_encoded_int(out, len);
   intlen = out->len;
 
@@ -441,12 +444,13 @@ decode_size(apr_size_t *val,
    the original size, and that if encoded size == original size, that the
    remaining data is not compressed.
    In that case, we will simply return pointer into IN as data pointer for
-   OUT.  The caller is expected not to modify the contents of OUT.
+   OUT, COPYLESS_ALLOWED has been set.  The, the caller is expected not to
+   modify the contents of OUT.
    An error is returned if the decoded length exceeds the given LIMIT.
  */
 static svn_error_t *
 zlib_decode(const unsigned char *in, apr_size_t inLen, svn_stringbuf_t *out,
-            apr_size_t limit)
+            apr_size_t limit, svn_boolean_t copyless_allowed)
 {
   apr_size_t len;
   const unsigned char *oldplace = in;
@@ -465,12 +469,22 @@ zlib_decode(const unsigned char *in, apr
   inLen -= (in - oldplace);
   if (inLen == len)
     {
-      /* "in" is no longer used but the memory remains allocated for
-       * at least as long as "out" will be used by the caller.
-       */
-      out->data = (char *)in;
-      out->len = len;
-      out->blocksize = len; /* sic! */
+      if (copyless_allowed)
+        {
+          /* "in" is no longer used but the memory remains allocated for
+           * at least as long as "out" will be used by the caller.
+           */
+          out->data = (char *)in;
+          out->len = len;
+          out->blocksize = len; /* sic! */
+        }
+      else
+        {
+          svn_stringbuf_ensure(out, len);
+          memcpy(out->data, in, len);
+          out->data[len] = 0;
+          out->len = len;
+        }
 
       return SVN_NO_ERROR;
     }
@@ -647,9 +661,9 @@ decode_window(svn_txdelta_window_t *wind
       /* these may in fact simply return references to insend */
 
       SVN_ERR(zlib_decode(insend, newlen, ndout,
-                          SVN_DELTA_WINDOW_SIZE));
+                          SVN_DELTA_WINDOW_SIZE, TRUE));
       SVN_ERR(zlib_decode(data, insend - data, instout,
-                          MAX_INSTRUCTION_SECTION_LEN));
+                          MAX_INSTRUCTION_SECTION_LEN, TRUE));
 
       newlen = ndout->len;
       data = (unsigned char *)instout->data;
@@ -987,3 +1001,22 @@ svn_txdelta_skip_svndiff_window(apr_file
   offset = inslen + newlen;
   return svn_io_file_seek(file, APR_CUR, &offset, pool);
 }
+
+
+svn_error_t *
+svn__compress(svn_string_t *in,
+              svn_stringbuf_t *out,
+              int compression_level)
+{
+  return zlib_encode(in->data, in->len, out,
+                     compression_level);
+}
+
+svn_error_t *
+svn__decompress(svn_string_t *in,
+                svn_stringbuf_t *out,
+                apr_size_t limit)
+{
+  return zlib_decode((const unsigned char*)in->data, in->len, out, limit,
+                     FALSE);
+}

Modified: subversion/branches/javahl-ra/subversion/libsvn_diff/parse-diff.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_diff/parse-diff.c?rev=1425415&r1=1425414&r2=1425415&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_diff/parse-diff.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_diff/parse-diff.c Sun Dec 23 06:03:14 2012
@@ -270,101 +270,6 @@ parse_hunk_header(const char *header, sv
   return TRUE;
 }
 
-/* A helper for reading a line of text from a range in the patch file.
- *
- * Allocate *STRINGBUF in RESULT_POOL, and read into it one line from FILE.
- * Reading stops either after a line-terminator was found or after MAX_LEN
- * bytes have been read. The line-terminator is not stored in *STRINGBUF.
- *
- * The line-terminator is detected automatically and stored in *EOL
- * if EOL is not NULL. If EOF is reached and FILE does not end
- * with a newline character, and EOL is not NULL, *EOL is set to NULL.
- *
- * SCRATCH_POOL is used for temporary allocations.
- */
-static svn_error_t *
-readline(apr_file_t *file,
-         svn_stringbuf_t **stringbuf,
-         const char **eol,
-         svn_boolean_t *eof,
-         apr_size_t max_len,
-         apr_pool_t *result_pool,
-         apr_pool_t *scratch_pool)
-{
-  svn_stringbuf_t *str;
-  const char *eol_str;
-  apr_size_t numbytes;
-  char c;
-  apr_size_t len;
-  svn_boolean_t found_eof;
-
-  str = svn_stringbuf_create_ensure(80, result_pool);
-
-  /* Read bytes into STR up to and including, but not storing,
-   * the next EOL sequence. */
-  eol_str = NULL;
-  numbytes = 1;
-  len = 0;
-  found_eof = FALSE;
-  while (!found_eof)
-    {
-      if (len < max_len)
-        SVN_ERR(svn_io_file_read_full2(file, &c, sizeof(c), &numbytes,
-                                       &found_eof, scratch_pool));
-      len++;
-      if (numbytes != 1 || len > max_len)
-        {
-          found_eof = TRUE;
-          break;
-        }
-
-      if (c == '\n')
-        {
-          eol_str = "\n";
-        }
-      else if (c == '\r')
-        {
-          eol_str = "\r";
-
-          if (!found_eof && len < max_len)
-            {
-              apr_off_t pos;
-
-              /* Check for "\r\n" by peeking at the next byte. */
-              pos = 0;
-              SVN_ERR(svn_io_file_seek(file, APR_CUR, &pos, scratch_pool));
-              SVN_ERR(svn_io_file_read_full2(file, &c, sizeof(c), &numbytes,
-                                             &found_eof, scratch_pool));
-              if (numbytes == 1 && c == '\n')
-                {
-                  eol_str = "\r\n";
-                  len++;
-                }
-              else
-                {
-                  /* Pretend we never peeked. */
-                  SVN_ERR(svn_io_file_seek(file, APR_SET, &pos, scratch_pool));
-                  found_eof = FALSE;
-                  numbytes = 1;
-                }
-            }
-        }
-      else
-        svn_stringbuf_appendbyte(str, c);
-
-      if (eol_str)
-        break;
-    }
-
-  if (eol)
-    *eol = eol_str;
-  if (eof)
-    *eof = found_eof;
-  *stringbuf = str;
-
-  return SVN_NO_ERROR;
-}
-
 /* Read a line of original or modified hunk text from the specified
  * RANGE within FILE. FILE is expected to contain unidiff text.
  * Leading unidiff symbols ('+', '-', and ' ') are removed from the line,
@@ -406,8 +311,8 @@ hunk_readline_original_or_modified(apr_f
   do
     {
       max_len = range->end - range->current;
-      SVN_ERR(readline(file, &str, eol, eof, max_len,
-                       result_pool, scratch_pool));
+      SVN_ERR(svn_io_file_readline(file, &str, eol, eof, max_len,
+                                   result_pool, scratch_pool));
       range->current = 0;
       SVN_ERR(svn_io_file_seek(file, APR_CUR, &range->current, scratch_pool));
       filtered = (str->data[0] == verboten || str->data[0] == '\\');
@@ -499,7 +404,8 @@ svn_diff_hunk_readline_diff_text(svn_dif
   SVN_ERR(svn_io_file_seek(hunk->apr_file, APR_SET,
                            &hunk->diff_text_range.current, scratch_pool));
   max_len = hunk->diff_text_range.end - hunk->diff_text_range.current;
-  SVN_ERR(readline(hunk->apr_file, &line, eol, eof, max_len, result_pool,
+  SVN_ERR(svn_io_file_readline(hunk->apr_file, &line, eol, eof, max_len,
+                               result_pool,
                    scratch_pool));
   hunk->diff_text_range.current = 0;
   SVN_ERR(svn_io_file_seek(hunk->apr_file, APR_CUR,
@@ -642,8 +548,8 @@ parse_next_hunk(svn_diff_hunk_t **hunk,
 
       /* Remember the current line's offset, and read the line. */
       last_line = pos;
-      SVN_ERR(readline(apr_file, &line, NULL, &eof, APR_SIZE_MAX,
-                       iterpool, iterpool));
+      SVN_ERR(svn_io_file_readline(apr_file, &line, NULL, &eof, APR_SIZE_MAX,
+                                   iterpool, iterpool));
 
       /* Update line offset for next iteration. */
       pos = 0;
@@ -1364,8 +1270,8 @@ svn_diff_parse_next_patch(svn_patch_t **
 
       /* Remember the current line's offset, and read the line. */
       last_line = pos;
-      SVN_ERR(readline(patch_file->apr_file, &line, NULL, &eof,
-                       APR_SIZE_MAX, iterpool, iterpool));
+      SVN_ERR(svn_io_file_readline(patch_file->apr_file, &line, NULL, &eof,
+                                   APR_SIZE_MAX, iterpool, iterpool));
 
       if (! eof)
         {

Modified: subversion/branches/javahl-ra/subversion/libsvn_fs/fs-loader.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_fs/fs-loader.c?rev=1425415&r1=1425414&r2=1425415&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_fs/fs-loader.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_fs/fs-loader.c Sun Dec 23 06:03:14 2012
@@ -28,6 +28,7 @@
 #include <apr_md5.h>
 #include <apr_thread_mutex.h>
 #include <apr_uuid.h>
+#include <apr_strings.h>
 
 #include "svn_ctype.h"
 #include "svn_types.h"
@@ -65,27 +66,37 @@ svn_mutex__t *common_pool_lock;
 
 /* --- Utility functions for the loader --- */
 
-static const struct fs_type_defn {
+struct fs_type_defn {
   const char *fs_type;
   const char *fsap_name;
   fs_init_func_t initfunc;
-} fs_modules[] = {
+  struct fs_type_defn *next;
+};
+
+static struct fs_type_defn base_defn =
   {
     SVN_FS_TYPE_BDB, "base",
 #ifdef SVN_LIBSVN_FS_LINKS_FS_BASE
-    svn_fs_base__init
+    svn_fs_base__init,
+#else
+    NULL,
 #endif
-  },
+    NULL
+  };
 
+static struct fs_type_defn fsfs_defn =
   {
     SVN_FS_TYPE_FSFS, "fs",
 #ifdef SVN_LIBSVN_FS_LINKS_FS_FS
-    svn_fs_fs__init
+    svn_fs_fs__init,
+#else
+    NULL,
 #endif
-  },
+    &base_defn
+  };
+
+static struct fs_type_defn *fs_modules = &fsfs_defn;
 
-  { NULL }
-};
 
 static svn_error_t *
 load_module(fs_init_func_t *initfunc, const char *name, apr_pool_t *pool)
@@ -99,6 +110,15 @@ load_module(fs_init_func_t *initfunc, co
     const char *libname;
     const char *funcname;
     apr_status_t status;
+    const char *p;
+
+    /* Demand a simple alphanumeric name so that the generated DSO
+       name is sensible. */
+    for (p = name; *p; ++p)
+      if (!svn_ctype_isalnum(*p))
+        return svn_error_createf(SVN_ERR_FS_UNKNOWN_FS_TYPE, NULL,
+                                 _("Invalid name for FS type '%s'"),
+                                 name);
 
     libname = apr_psprintf(pool, "libsvn_fs_%s-%d.so.0",
                            name, SVN_VER_MAJOR);
@@ -173,21 +193,66 @@ get_library_vtable_direct(fs_library_vta
   return SVN_NO_ERROR;
 }
 
+#if defined(SVN_USE_DSO) && APR_HAS_DSO
+/* Return *FST for the third party FS_TYPE */
+static svn_error_t *
+get_or_allocate_third(struct fs_type_defn **fst,
+                      const char *fs_type)
+{
+  fst = &fs_modules;
+
+  while (*fst)
+    fst = &(*fst)->next;
+
+  *fst = apr_palloc(common_pool, sizeof(struct fs_type_defn));
+  (*fst)->fs_type = apr_pstrdup(common_pool, fs_type);
+  (*fst)->fsap_name = (*fst)->fs_type;
+  (*fst)->initfunc = NULL;
+  (*fst)->next = NULL;
+
+  return SVN_NO_ERROR;
+}
+#endif
+
 /* Fetch a library vtable by FS type. */
 static svn_error_t *
 get_library_vtable(fs_library_vtable_t **vtable, const char *fs_type,
                    apr_pool_t *pool)
 {
-  const struct fs_type_defn *fst;
+  struct fs_type_defn **fst = &fs_modules;
 
-  for (fst = fs_modules; fst->fs_type; fst++)
+  while (*fst)
     {
-      if (strcmp(fs_type, fst->fs_type) == 0)
-        return get_library_vtable_direct(vtable, fst, pool);
+      if (strcmp(fs_type, (*fst)->fs_type) == 0)
+        break;
+      (*fst) = (*fst)->next;
     }
 
-  return svn_error_createf(SVN_ERR_FS_UNKNOWN_FS_TYPE, NULL,
-                           _("Unknown FS type '%s'"), fs_type);
+#if defined(SVN_USE_DSO) && APR_HAS_DSO
+  /* Third party FS modules that are unknown at compile time.
+     
+     A third party FS is identified by the file fs-type containing a
+     third party name, say "foo".  The loader will load the DSO with
+     the name "libsvn_fs_foo" and use the entry point with the name
+     "svn_fs_foo__init".
+
+     Note: the BDB and FSFS modules don't follow this naming scheme
+     and this allows them to be used to test the third party loader.
+     Change the content of fs-type to "base" in a BDB filesystem or to
+     "fs" in an FSFS filesystem and they will be loaded as third party
+     modules. */
+  if (! *fst)
+    {
+      if (!common_pool)  /* Best-effort init, see get_library_vtable_direct. */
+        SVN_ERR(svn_fs_initialize(NULL));
+      SVN_MUTEX__WITH_LOCK(common_pool_lock,
+                           get_or_allocate_third(fst, fs_type));
+    }
+#endif
+  if (!*fst)
+    return svn_error_createf(SVN_ERR_FS_UNKNOWN_FS_TYPE, NULL,
+                             _("Unknown FS type '%s'"), fs_type);
+  return get_library_vtable_direct(vtable, *fst, pool);
 }
 
 svn_error_t *
@@ -594,8 +659,8 @@ svn_error_t *
 svn_fs_hotcopy_berkeley(const char *src_path, const char *dest_path,
                         svn_boolean_t clean_logs, apr_pool_t *pool)
 {
-  return svn_error_trace(svn_fs_hotcopy(src_path, dest_path, clean_logs,
-                                        pool));
+  return svn_error_trace(svn_fs_hotcopy2(src_path, dest_path, clean_logs,
+                                         FALSE, NULL, NULL, pool));
 }
 
 svn_error_t *
@@ -1414,11 +1479,11 @@ svn_error_t *
 svn_fs_print_modules(svn_stringbuf_t *output,
                      apr_pool_t *pool)
 {
-  const struct fs_type_defn *defn;
+  const struct fs_type_defn *defn = fs_modules;
   fs_library_vtable_t *vtable;
   apr_pool_t *iterpool = svn_pool_create(pool);
 
-  for (defn = fs_modules; defn->fs_type != NULL; ++defn)
+  while (defn)
     {
       char *line;
       svn_error_t *err;
@@ -1431,6 +1496,7 @@ svn_fs_print_modules(svn_stringbuf_t *ou
           if (err->apr_err == SVN_ERR_FS_UNKNOWN_FS_TYPE)
             {
               svn_error_clear(err);
+              defn = defn->next;
               continue;
             }
           else
@@ -1440,6 +1506,7 @@ svn_fs_print_modules(svn_stringbuf_t *ou
       line = apr_psprintf(iterpool, "* fs_%s : %s\n",
                           defn->fsap_name, vtable->get_description());
       svn_stringbuf_appendcstr(output, line);
+      defn = defn->next;
     }
 
   svn_pool_destroy(iterpool);

Modified: subversion/branches/javahl-ra/subversion/libsvn_fs_base/bdb/bdb-err.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_fs_base/bdb/bdb-err.c?rev=1425415&r1=1425414&r2=1425415&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_fs_base/bdb/bdb-err.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_fs_base/bdb/bdb-err.c Sun Dec 23 06:03:14 2012
@@ -102,5 +102,5 @@ svn_fs_bdb__wrap_db(svn_fs_t *fs, const 
   return svn_fs_bdb__dberrf
     (bfd->bdb, db_err,
      _("Berkeley DB error for filesystem '%s' while %s:\n"),
-     fs->path ? fs->path : "(none)", operation);
+     fs->path ? fs->path : "(none)", _(operation));
 }

Modified: subversion/branches/javahl-ra/subversion/libsvn_fs_base/bdb/changes-table.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_fs_base/bdb/changes-table.c?rev=1425415&r1=1425414&r2=1425415&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_fs_base/bdb/changes-table.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_fs_base/bdb/changes-table.c Sun Dec 23 06:03:14 2012
@@ -90,7 +90,7 @@ svn_fs_bdb__changes_add(svn_fs_t *fs,
   svn_fs_base__str_to_dbt(&query, key);
   svn_fs_base__skel_to_dbt(&value, skel, pool);
   svn_fs_base__trail_debug(trail, "changes", "put");
-  return BDB_WRAP(fs, _("creating change"),
+  return BDB_WRAP(fs, N_("creating change"),
                   bfd->changes->put(bfd->changes, trail->db_txn,
                                     &query, &value, 0));
 }
@@ -114,7 +114,7 @@ svn_fs_bdb__changes_delete(svn_fs_t *fs,
      error should be propagated to the caller, though.  */
   if ((db_err) && (db_err != DB_NOTFOUND))
     {
-      SVN_ERR(BDB_WRAP(fs, _("deleting changes"), db_err));
+      SVN_ERR(BDB_WRAP(fs, N_("deleting changes"), db_err));
     }
 
   return SVN_NO_ERROR;
@@ -268,7 +268,7 @@ svn_fs_bdb__changes_fetch(apr_hash_t **c
   /* Get a cursor on the first record matching KEY, and then loop over
      the records, adding them to the return array. */
   svn_fs_base__trail_debug(trail, "changes", "cursor");
-  SVN_ERR(BDB_WRAP(fs, _("creating cursor for reading changes"),
+  SVN_ERR(BDB_WRAP(fs, N_("creating cursor for reading changes"),
                    bfd->changes->cursor(bfd->changes, trail->db_txn,
                                         &cursor, 0)));
 
@@ -352,7 +352,7 @@ svn_fs_bdb__changes_fetch(apr_hash_t **c
      finished.  Just return the (possibly empty) array.  Any other
      error, however, needs to get handled appropriately.  */
   if (db_err && (db_err != DB_NOTFOUND))
-    err = BDB_WRAP(fs, _("fetching changes"), db_err);
+    err = BDB_WRAP(fs, N_("fetching changes"), db_err);
 
  cleanup:
   /* Close the cursor. */
@@ -365,7 +365,7 @@ svn_fs_bdb__changes_fetch(apr_hash_t **c
   /* If our only error thus far was when we closed the cursor, return
      that error. */
   if (db_c_err)
-    SVN_ERR(BDB_WRAP(fs, _("closing changes cursor"), db_c_err));
+    SVN_ERR(BDB_WRAP(fs, N_("closing changes cursor"), db_c_err));
 
   /* Finally, set our return variable and get outta here. */
   *changes_p = changes;
@@ -391,7 +391,7 @@ svn_fs_bdb__changes_fetch_raw(apr_array_
   /* Get a cursor on the first record matching KEY, and then loop over
      the records, adding them to the return array. */
   svn_fs_base__trail_debug(trail, "changes", "cursor");
-  SVN_ERR(BDB_WRAP(fs, _("creating cursor for reading changes"),
+  SVN_ERR(BDB_WRAP(fs, N_("creating cursor for reading changes"),
                    bfd->changes->cursor(bfd->changes, trail->db_txn,
                                         &cursor, 0)));
 
@@ -435,7 +435,7 @@ svn_fs_bdb__changes_fetch_raw(apr_array_
      finished.  Just return the (possibly empty) array.  Any other
      error, however, needs to get handled appropriately.  */
   if (db_err && (db_err != DB_NOTFOUND))
-    err = BDB_WRAP(fs, _("fetching changes"), db_err);
+    err = BDB_WRAP(fs, N_("fetching changes"), db_err);
 
  cleanup:
   /* Close the cursor. */
@@ -448,7 +448,7 @@ svn_fs_bdb__changes_fetch_raw(apr_array_
   /* If our only error thus far was when we closed the cursor, return
      that error. */
   if (db_c_err)
-    SVN_ERR(BDB_WRAP(fs, _("closing changes cursor"), db_c_err));
+    SVN_ERR(BDB_WRAP(fs, N_("closing changes cursor"), db_c_err));
 
   /* Finally, set our return variable and get outta here. */
   *changes_p = changes;

Modified: subversion/branches/javahl-ra/subversion/libsvn_fs_base/bdb/checksum-reps-table.c
URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_fs_base/bdb/checksum-reps-table.c?rev=1425415&r1=1425414&r2=1425415&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_fs_base/bdb/checksum-reps-table.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_fs_base/bdb/checksum-reps-table.c Sun Dec 23 06:03:14 2012
@@ -139,7 +139,7 @@ svn_error_t *svn_fs_bdb__set_checksum_re
   /* Create a value from our REP_KEY, and add this record to the table. */
   svn_fs_base__str_to_dbt(&value, rep_key);
   svn_fs_base__trail_debug(trail, "checksum-reps", "put");
-  SVN_ERR(BDB_WRAP(fs, _("storing checksum-reps record"),
+  SVN_ERR(BDB_WRAP(fs, N_("storing checksum-reps record"),
                    bfd->checksum_reps->put(bfd->checksum_reps, trail->db_txn,
                                            &key, &value, 0)));
   return SVN_NO_ERROR;
@@ -161,7 +161,7 @@ svn_error_t *svn_fs_bdb__delete_checksum
 
   svn_fs_base__checksum_to_dbt(&key, checksum);
   svn_fs_base__trail_debug(trail, "checksum-reps", "del");
-  SVN_ERR(BDB_WRAP(fs, "deleting entry from 'checksum-reps' table",
+  SVN_ERR(BDB_WRAP(fs, N_("deleting entry from 'checksum-reps' table"),
                    bfd->checksum_reps->del(bfd->checksum_reps,
                                            trail->db_txn, &key, 0)));
   return SVN_NO_ERROR;
@@ -183,7 +183,7 @@ svn_error_t *svn_fs_bdb__reserve_rep_reu
   /* Get the current value associated with the `next-key' key in the
      `checksum-reps' table.  */
   svn_fs_base__trail_debug(trail, "checksum-reps", "get");
-  SVN_ERR(BDB_WRAP(fs, _("allocating new representation reuse ID "
+  SVN_ERR(BDB_WRAP(fs, N_("allocating new representation reuse ID "
                          "(getting 'next-key')"),
                    bfd->checksum_reps->get(bfd->checksum_reps, trail->db_txn,
                                            &query,
@@ -204,5 +204,5 @@ svn_error_t *svn_fs_bdb__reserve_rep_reu
                                    svn_fs_base__str_to_dbt(&result, next_key),
                                    0);
 
-  return BDB_WRAP(fs, _("bumping next representation reuse ID"), db_err);
+  return BDB_WRAP(fs, N_("bumping next representation reuse ID"), db_err);
 }



Mime
View raw message