subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bre...@apache.org
Subject svn commit: r1655189 [1/9] - in /subversion/branches/svn-auth-x509: ./ build/ build/generator/ subversion/bindings/javahl/native/ subversion/include/ subversion/include/private/ subversion/libsvn_client/ subversion/libsvn_fs_base/ subversion/libsvn_fs_...
Date Tue, 27 Jan 2015 23:27:46 GMT
Author: breser
Date: Tue Jan 27 23:27:44 2015
New Revision: 1655189

URL: http://svn.apache.org/r1655189
Log:
On the svn-auth-x509 branch: Sync with trunk up to r1655188.

Modified:
    subversion/branches/svn-auth-x509/   (props changed)
    subversion/branches/svn-auth-x509/COMMITTERS
    subversion/branches/svn-auth-x509/build/generator/gen_win_dependencies.py
    subversion/branches/svn-auth-x509/build/run_tests.py
    subversion/branches/svn-auth-x509/subversion/bindings/javahl/native/CreateJ.cpp
    subversion/branches/svn-auth-x509/subversion/bindings/javahl/native/RemoteSession.cpp
    subversion/branches/svn-auth-x509/subversion/include/private/svn_repos_private.h
    subversion/branches/svn-auth-x509/subversion/include/svn_ra.h
    subversion/branches/svn-auth-x509/subversion/include/svn_ra_svn.h
    subversion/branches/svn-auth-x509/subversion/include/svn_repos.h
    subversion/branches/svn-auth-x509/subversion/libsvn_client/deprecated.c
    subversion/branches/svn-auth-x509/subversion/libsvn_client/externals.c
    subversion/branches/svn-auth-x509/subversion/libsvn_client/mergeinfo.c
    subversion/branches/svn-auth-x509/subversion/libsvn_client/patch.c
    subversion/branches/svn-auth-x509/subversion/libsvn_fs_base/dag.c
    subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/fs_fs.c
    subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/index.c
    subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/revprops.c
    subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/structure
    subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/transaction.c
    subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/tree.c
    subversion/branches/svn-auth-x509/subversion/libsvn_fs_x/   (props changed)
    subversion/branches/svn-auth-x509/subversion/libsvn_fs_x/cached_data.c
    subversion/branches/svn-auth-x509/subversion/libsvn_fs_x/cached_data.h
    subversion/branches/svn-auth-x509/subversion/libsvn_fs_x/caching.c
    subversion/branches/svn-auth-x509/subversion/libsvn_fs_x/dag.c
    subversion/branches/svn-auth-x509/subversion/libsvn_fs_x/dag.h
    subversion/branches/svn-auth-x509/subversion/libsvn_fs_x/fs.c
    subversion/branches/svn-auth-x509/subversion/libsvn_fs_x/fs.h
    subversion/branches/svn-auth-x509/subversion/libsvn_fs_x/fs_x.c
    subversion/branches/svn-auth-x509/subversion/libsvn_fs_x/hotcopy.c
    subversion/branches/svn-auth-x509/subversion/libsvn_fs_x/lock.c
    subversion/branches/svn-auth-x509/subversion/libsvn_fs_x/pack.c
    subversion/branches/svn-auth-x509/subversion/libsvn_fs_x/recovery.c
    subversion/branches/svn-auth-x509/subversion/libsvn_fs_x/rep-cache.c
    subversion/branches/svn-auth-x509/subversion/libsvn_fs_x/rep-cache.h
    subversion/branches/svn-auth-x509/subversion/libsvn_fs_x/revprops.c
    subversion/branches/svn-auth-x509/subversion/libsvn_fs_x/temp_serializer.c
    subversion/branches/svn-auth-x509/subversion/libsvn_fs_x/temp_serializer.h
    subversion/branches/svn-auth-x509/subversion/libsvn_fs_x/transaction.c
    subversion/branches/svn-auth-x509/subversion/libsvn_fs_x/transaction.h
    subversion/branches/svn-auth-x509/subversion/libsvn_fs_x/tree.c
    subversion/branches/svn-auth-x509/subversion/libsvn_fs_x/tree.h
    subversion/branches/svn-auth-x509/subversion/libsvn_fs_x/util.c
    subversion/branches/svn-auth-x509/subversion/libsvn_fs_x/util.h
    subversion/branches/svn-auth-x509/subversion/libsvn_ra_serf/blame.c
    subversion/branches/svn-auth-x509/subversion/libsvn_ra_serf/blncache.c
    subversion/branches/svn-auth-x509/subversion/libsvn_ra_serf/blncache.h
    subversion/branches/svn-auth-x509/subversion/libsvn_ra_serf/commit.c
    subversion/branches/svn-auth-x509/subversion/libsvn_ra_serf/get_deleted_rev.c
    subversion/branches/svn-auth-x509/subversion/libsvn_ra_serf/get_file.c
    subversion/branches/svn-auth-x509/subversion/libsvn_ra_serf/get_lock.c
    subversion/branches/svn-auth-x509/subversion/libsvn_ra_serf/getdate.c
    subversion/branches/svn-auth-x509/subversion/libsvn_ra_serf/getlocations.c
    subversion/branches/svn-auth-x509/subversion/libsvn_ra_serf/getlocationsegments.c
    subversion/branches/svn-auth-x509/subversion/libsvn_ra_serf/getlocks.c
    subversion/branches/svn-auth-x509/subversion/libsvn_ra_serf/inherited_props.c
    subversion/branches/svn-auth-x509/subversion/libsvn_ra_serf/lock.c
    subversion/branches/svn-auth-x509/subversion/libsvn_ra_serf/log.c
    subversion/branches/svn-auth-x509/subversion/libsvn_ra_serf/merge.c
    subversion/branches/svn-auth-x509/subversion/libsvn_ra_serf/mergeinfo.c
    subversion/branches/svn-auth-x509/subversion/libsvn_ra_serf/multistatus.c
    subversion/branches/svn-auth-x509/subversion/libsvn_ra_serf/options.c
    subversion/branches/svn-auth-x509/subversion/libsvn_ra_serf/property.c
    subversion/branches/svn-auth-x509/subversion/libsvn_ra_serf/ra_serf.h
    subversion/branches/svn-auth-x509/subversion/libsvn_ra_serf/replay.c
    subversion/branches/svn-auth-x509/subversion/libsvn_ra_serf/serf.c
    subversion/branches/svn-auth-x509/subversion/libsvn_ra_serf/stat.c
    subversion/branches/svn-auth-x509/subversion/libsvn_ra_serf/update.c
    subversion/branches/svn-auth-x509/subversion/libsvn_ra_serf/util.c
    subversion/branches/svn-auth-x509/subversion/libsvn_ra_serf/xml.c
    subversion/branches/svn-auth-x509/subversion/libsvn_repos/commit.c
    subversion/branches/svn-auth-x509/subversion/libsvn_repos/dump.c
    subversion/branches/svn-auth-x509/subversion/libsvn_repos/load-fs-vtable.c
    subversion/branches/svn-auth-x509/subversion/libsvn_subr/checksum.c
    subversion/branches/svn-auth-x509/subversion/libsvn_subr/io.c
    subversion/branches/svn-auth-x509/subversion/libsvn_subr/prefix_string.c
    subversion/branches/svn-auth-x509/subversion/libsvn_subr/sqlite.c
    subversion/branches/svn-auth-x509/subversion/libsvn_subr/stream.c
    subversion/branches/svn-auth-x509/subversion/libsvn_wc/conflicts.c
    subversion/branches/svn-auth-x509/subversion/libsvn_wc/merge.c
    subversion/branches/svn-auth-x509/subversion/libsvn_wc/wc_db.c
    subversion/branches/svn-auth-x509/subversion/libsvn_wc/wc_db_update_move.c
    subversion/branches/svn-auth-x509/subversion/mod_authz_svn/mod_authz_svn.c
    subversion/branches/svn-auth-x509/subversion/mod_dav_svn/liveprops.c
    subversion/branches/svn-auth-x509/subversion/mod_dav_svn/merge.c
    subversion/branches/svn-auth-x509/subversion/svnadmin/svnadmin.c
    subversion/branches/svn-auth-x509/subversion/svndumpfilter/svndumpfilter.c
    subversion/branches/svn-auth-x509/subversion/svnmucc/svnmucc.c
    subversion/branches/svn-auth-x509/subversion/svnrdump/dump_editor.c
    subversion/branches/svn-auth-x509/subversion/svnrdump/load_editor.c
    subversion/branches/svn-auth-x509/subversion/svnrdump/svnrdump.c
    subversion/branches/svn-auth-x509/subversion/tests/cmdline/patch_tests.py
    subversion/branches/svn-auth-x509/subversion/tests/cmdline/prop_tests.py
    subversion/branches/svn-auth-x509/subversion/tests/cmdline/svnrdump_tests.py
    subversion/branches/svn-auth-x509/subversion/tests/cmdline/svntest/verify.py
    subversion/branches/svn-auth-x509/subversion/tests/libsvn_diff/parse-diff-test.c
    subversion/branches/svn-auth-x509/subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c
    subversion/branches/svn-auth-x509/subversion/tests/libsvn_subr/auth-test.c
    subversion/branches/svn-auth-x509/subversion/tests/libsvn_subr/dirent_uri-test.c
    subversion/branches/svn-auth-x509/subversion/tests/libsvn_subr/io-test.c
    subversion/branches/svn-auth-x509/subversion/tests/libsvn_subr/mergeinfo-test.c
    subversion/branches/svn-auth-x509/subversion/tests/libsvn_wc/conflict-data-test.c
    subversion/branches/svn-auth-x509/subversion/tests/libsvn_wc/op-depth-test.c
    subversion/branches/svn-auth-x509/tools/buildbot/slaves/svn-sparc-solaris/svnbuild.sh
    subversion/branches/svn-auth-x509/tools/buildbot/slaves/svn-sparc-solaris/svncheck.sh

Propchange: subversion/branches/svn-auth-x509/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jan 27 23:27:44 2015
@@ -85,4 +85,4 @@
 /subversion/branches/verify-at-commit:1462039-1462408
 /subversion/branches/verify-keep-going:1439280-1546110
 /subversion/branches/wc-collate-path:1402685-1480384
-/subversion/trunk:1603509-1652406
+/subversion/trunk:1603509-1655188

Modified: subversion/branches/svn-auth-x509/COMMITTERS
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/COMMITTERS?rev=1655189&r1=1655188&r2=1655189&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/COMMITTERS [UTF-8] (original)
+++ subversion/branches/svn-auth-x509/COMMITTERS [UTF-8] Tue Jan 27 23:27:44 2015
@@ -164,7 +164,7 @@ Commit access for specific areas:
      humbedooh   Daniel Gruno <humbedooh@apache.org>         (svnpubsub)
       prabhugs   Prabhu Gnana Sundar <pprabhugs@gmail.com>   (verify-keep-going)
         schabi   Markus Schaber <schabi@apache.org>          (testsuite)
-	gbg      Gabriela Gibson <gabriela.gibson@gmail.com> (gtest) 
+           gbg   Gabriela Gibson <gabriela.gibson@gmail.com> (gtest) 
 
   Translation of message files:
 

Modified: subversion/branches/svn-auth-x509/build/generator/gen_win_dependencies.py
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/build/generator/gen_win_dependencies.py?rev=1655189&r1=1655188&r2=1655189&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/build/generator/gen_win_dependencies.py (original)
+++ subversion/branches/svn-auth-x509/build/generator/gen_win_dependencies.py Tue Jan 27 23:27:44 2015
@@ -838,7 +838,7 @@ class GenDependenciesBase(gen_base.Gener
     txt = open(version_path).read()
 
     vermatch = re.search(
-      r'#define OPENSSL_VERSION_TEXT\s+"OpenSSL\s+((\d+)\.(\d+).(\d+)([^ -]*))',
+      r'#\s*define\s+OPENSSL_VERSION_TEXT\s+"OpenSSL\s+((\d+)\.(\d+).(\d+)([^ -]*))',
       txt)
   
     version = (int(vermatch.group(2)), 

Modified: subversion/branches/svn-auth-x509/build/run_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/build/run_tests.py?rev=1655189&r1=1655188&r2=1655189&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/build/run_tests.py (original)
+++ subversion/branches/svn-auth-x509/build/run_tests.py Tue Jan 27 23:27:44 2015
@@ -207,15 +207,12 @@ class TestHarness:
     self._open_log('w')
     failed = 0
 
-    # Only run the C tests when testing ra_local
+    # If asked to skip C tests, remove non-Python tests from the list
     if self.skip_c_tests:
-      filtered_list = []
-      for cnt, prog in enumerate(list):
+      def is_py_test(prog):
         progpath, nums = self._split_nums(prog)
-        if not progpath.endswith('.py'):
-          continue
-        filtered_list.append(prog)
-      list = filtered_list
+        return progpath.endswith('.py')
+      list = filter(is_py_test, list)
 
     for cnt, prog in enumerate(list):
       failed = self._run_test(prog, cnt, len(list)) or failed

Modified: subversion/branches/svn-auth-x509/subversion/bindings/javahl/native/CreateJ.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/bindings/javahl/native/CreateJ.cpp?rev=1655189&r1=1655188&r2=1655189&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/bindings/javahl/native/CreateJ.cpp (original)
+++ subversion/branches/svn-auth-x509/subversion/bindings/javahl/native/CreateJ.cpp Tue Jan 27 23:27:44 2015
@@ -1096,8 +1096,7 @@ void fill_property_map(jobject map,
                        apr_hash_t* prop_hash, apr_array_header_t* prop_diffs,
                        apr_pool_t* scratch_pool, jmethodID put_mid)
 {
-  SVN_ERR_ASSERT_NO_RETURN(!prop_hash != !prop_diffs
-                           || !prop_hash && !prop_diffs);
+  SVN_ERR_ASSERT_NO_RETURN(!(prop_hash && prop_diffs));
 
   if (!map || (prop_hash == NULL && prop_diffs == NULL))
     return;
@@ -1189,8 +1188,7 @@ void fill_property_map(jobject map,
 jobject property_map(apr_hash_t *prop_hash, apr_array_header_t* prop_diffs,
                      apr_pool_t* scratch_pool)
 {
-  SVN_ERR_ASSERT_NO_RETURN(!prop_hash != !prop_diffs
-                           || !prop_hash && !prop_diffs);
+  SVN_ERR_ASSERT_NO_RETURN(!(prop_hash && prop_diffs));
 
   if (prop_hash == NULL && prop_diffs == NULL)
     return NULL;

Modified: subversion/branches/svn-auth-x509/subversion/bindings/javahl/native/RemoteSession.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/bindings/javahl/native/RemoteSession.cpp?rev=1655189&r1=1655188&r2=1655189&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/bindings/javahl/native/RemoteSession.cpp (original)
+++ subversion/branches/svn-auth-x509/subversion/bindings/javahl/native/RemoteSession.cpp Tue Jan 27 23:27:44 2015
@@ -71,8 +71,7 @@ RemoteSession::open(jint jretryAttempts,
                     jobject jprompter, jobject jdeprecatedPrompter,
                     jobject jprogress, jobject jcfgcb, jobject jtunnelcb)
 {
-  SVN_ERR_ASSERT_NO_RETURN(!jprompter != !jdeprecatedPrompter
-                           || !jprompter && !jdeprecatedPrompter);
+  SVN_ERR_ASSERT_NO_RETURN(!(jprompter && jdeprecatedPrompter));
 
   SVN::Pool requestPool;
   URL url(jurl, requestPool);

Modified: subversion/branches/svn-auth-x509/subversion/include/private/svn_repos_private.h
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/include/private/svn_repos_private.h?rev=1655189&r1=1655188&r2=1655189&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/include/private/svn_repos_private.h (original)
+++ subversion/branches/svn-auth-x509/subversion/include/private/svn_repos_private.h Tue Jan 27 23:27:44 2015
@@ -260,6 +260,137 @@ svn_repos__authz_pool_get(svn_authz_t **
 
 /** @} */
 
+/* Adjust mergeinfo paths and revisions in ways that are useful when loading
+ * a dump stream.
+ *
+ * Set *NEW_VALUE_P to an adjusted version of the mergeinfo property value
+ * supplied in OLD_VALUE, with the following adjustments.
+ *
+ *   - Normalize line endings: if all CRLF, change to LF; but error if
+ *     mixed. If this normalization is performed, send a notification type
+ *     svn_repos_notify_load_normalized_mergeinfo to NOTIFY_FUNC/NOTIFY_BATON.
+ *
+ *   - Prefix all the merge source paths with PARENT_DIR, if not null.
+ *
+ *   - Adjust any mergeinfo revisions not older than OLDEST_DUMPSTREAM_REV
+ *     by using REV_MAP which maps (svn_revnum_t) old rev to (svn_revnum_t)
+ *     new rev.
+ *
+ *   - Adjust any mergeinfo revisions older than OLDEST_DUMPSTREAM_REV by
+ *     (-OLDER_REVS_OFFSET), dropping any revisions that become <= 0.
+ *
+ * Allocate *NEW_VALUE_P in RESULT_POOL.
+ */
+svn_error_t *
+svn_repos__adjust_mergeinfo_property(svn_string_t **new_value_p,
+                                     const svn_string_t *old_value,
+                                     const char *parent_dir,
+                                     apr_hash_t *rev_map,
+                                     svn_revnum_t oldest_dumpstream_rev,
+                                     apr_int32_t older_revs_offset,
+                                     svn_repos_notify_func_t notify_func,
+                                     void *notify_baton,
+                                     apr_pool_t *result_pool,
+                                     apr_pool_t *scratch_pool);
+
+/* A header entry.
+ *
+ * (The headers are currently declared here to be of type apr_array_header_t
+ * with svn_repos__dumpfile_header_entry_t entries, but the types could
+ * instead be made opaque.)
+ */
+typedef struct svn_repos__dumpfile_header_entry_t {
+  const char *key, *val;
+} svn_repos__dumpfile_header_entry_t;
+
+/* Create an empty set of headers.
+ */
+apr_array_header_t *
+svn_repos__dumpfile_headers_create(apr_pool_t *pool);
+
+/* Push the header (KEY, VAL) onto HEADERS.
+ *
+ * Duplicate the key and value into HEADERS's pool.
+ */
+void
+svn_repos__dumpfile_header_push(apr_array_header_t *headers,
+                                const char *key,
+                                const char *val);
+
+/* Push the header (KEY, val = VAL_FMT ...) onto HEADERS.
+ *
+ * Duplicate the key and value into HEADERS's pool.
+ */
+void
+svn_repos__dumpfile_header_pushf(apr_array_header_t *headers,
+                                 const char *key,
+                                 const char *val_fmt,
+                                 ...)
+        __attribute__((format(printf, 3, 4)));
+
+/* Write to STREAM the headers in HEADERS followed by a blank line.
+ *
+ * HEADERS is an array of struct {const char *key, *val;}.
+ */
+svn_error_t *
+svn_repos__dump_headers(svn_stream_t *stream,
+                        apr_array_header_t *headers,
+                        svn_boolean_t terminate,
+                        apr_pool_t *scratch_pool);
+
+/* Write a revision record to DUMP_STREAM for revision REVISION with revision
+ * properies REVPROPS, creating appropriate headers.
+ *
+ * Include all of the headers in EXTRA_HEADERS (if non-null), ignoring
+ * the revision number header and the three content length headers (which
+ * will be recreated as needed). EXTRA_HEADERS maps (char *) key to
+ * (char *) value.
+ *
+ * REVPROPS maps (char *) key to (svn_string_t *) value.
+ *
+ * Iff PROPS_SECTION_ALWAYS is true, include a prop content section (and
+ * corresponding header) even when REVPROPS is empty. This option exists
+ * to support a historical difference between svndumpfilter and svnadmin
+ * dump.
+ *
+ * Finally write another blank line.
+ */
+svn_error_t *
+svn_repos__dump_revision_record(svn_stream_t *dump_stream,
+                                svn_revnum_t revision,
+                                apr_hash_t *extra_headers,
+                                apr_hash_t *revprops,
+                                svn_boolean_t props_section_always,
+                                apr_pool_t *scratch_pool);
+
+/* Output node headers and props.
+ *
+ * Output HEADERS, content length headers, blank line, and
+ * then PROPS_STR (if non-null) to DUMP_STREAM.
+ *
+ * HEADERS is an array of headers as struct {const char *key, *val;}.
+ * Write them all in the given order.
+ *
+ * PROPS_STR is the property content block, including a terminating
+ * 'PROPS_END\n' line. Iff PROPS_STR is non-null, write a
+ * Prop-content-length header and the prop content block.
+ *
+ * Iff HAS_TEXT is true, write a Text-content length, using the value
+ * TEXT_CONTENT_LENGTH.
+ *
+ * Write a Content-length header, its value being the sum of the
+ * Prop- and Text- content length headers, if props and/or text are present
+ * or if CONTENT_LENGTH_ALWAYS is true.
+ */
+svn_error_t *
+svn_repos__dump_node_record(svn_stream_t *dump_stream,
+                            apr_array_header_t *headers,
+                            svn_stringbuf_t *props_str,
+                            svn_boolean_t has_text,
+                            svn_filesize_t text_content_length,
+                            svn_boolean_t content_length_always,
+                            apr_pool_t *scratch_pool);
+
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */

Modified: subversion/branches/svn-auth-x509/subversion/include/svn_ra.h
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/include/svn_ra.h?rev=1655189&r1=1655188&r2=1655189&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/include/svn_ra.h (original)
+++ subversion/branches/svn-auth-x509/subversion/include/svn_ra.h Tue Jan 27 23:27:44 2015
@@ -1011,6 +1011,10 @@ svn_ra_rev_prop(svn_ra_session_t *sessio
  * Use @a pool for memory allocation.
  *
  * @since New in 1.5.
+ *
+ * @note Like most commit editors, the returned editor requires that the
+ * @c copyfrom_path parameter passed to its @c add_file and @c add_directory
+ * methods is a URL, not a relative path.
  */
 svn_error_t *
 svn_ra_get_commit_editor3(svn_ra_session_t *session,

Modified: subversion/branches/svn-auth-x509/subversion/include/svn_ra_svn.h
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/include/svn_ra_svn.h?rev=1655189&r1=1655188&r2=1655189&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/include/svn_ra_svn.h (original)
+++ subversion/branches/svn-auth-x509/subversion/include/svn_ra_svn.h Tue Jan 27 23:27:44 2015
@@ -287,6 +287,12 @@ svn_ra_svn_conn_remote_host(svn_ra_svn_c
  *
  * Upon successful completion of the edit, the editor will invoke @a callback
  * with @a callback_baton as an argument.
+ *
+ * @note The @c copyfrom_path parameter passed to the @c add_file and
+ * @c add_directory methods of the returned editor may be either a URL or a
+ * relative path, and is transferred verbatim to the receiving end of the
+ * connection. See svn_ra_svn_drive_editor2() for information on the
+ * receiving end of the connection.
  */
 void
 svn_ra_svn_get_editor(const svn_delta_editor_t **editor,
@@ -302,6 +308,13 @@ svn_ra_svn_get_editor(const svn_delta_ed
  * if @a for_replay is TRUE.
  *
  * @since New in 1.4.
+ *
+ * @note The @c copyfrom_path parameter passed to the @c add_file and
+ * @c add_directory methods of the receiving editor will be canonicalized
+ * either as a URL or as a relative path (starting with a slash) according
+ * to which kind was sent by the driving end of the connection. See
+ * svn_ra_svn_get_editor() for information on the driving end of the
+ * connection.
  */
 svn_error_t *
 svn_ra_svn_drive_editor2(svn_ra_svn_conn_t *conn,

Modified: subversion/branches/svn-auth-x509/subversion/include/svn_repos.h
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/include/svn_repos.h?rev=1655189&r1=1655188&r2=1655189&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/include/svn_repos.h (original)
+++ subversion/branches/svn-auth-x509/subversion/include/svn_repos.h Tue Jan 27 23:27:44 2015
@@ -1498,10 +1498,9 @@ svn_repos_replay(svn_fs_root_t *root,
  * filesystem of @a repos, beginning at location 'rev:@a base_path',
  * where "rev" is the argument given to open_root().
  *
- * @a repos is a previously opened repository.  @a repos_url is the
+ * @a repos is a previously opened repository.  @a repos_url_decoded is the
  * decoded URL to the base of the repository, and is used to check
- * copyfrom paths.  copyfrom paths passed to the editor must be full,
- * URI-encoded, URLs.  @a txn is a filesystem transaction object to use
+ * copyfrom paths.  @a txn is a filesystem transaction object to use
  * during the commit, or @c NULL to indicate that this function should
  * create (and fully manage) a new transaction.
  *
@@ -1537,15 +1536,19 @@ svn_repos_replay(svn_fs_root_t *root,
  *
  * @since New in 1.5.
  *
- * @note Yes, @a repos_url is a <em>decoded</em> URL.  We realize
+ * @note Yes, @a repos_url_decoded is a <em>decoded</em> URL.  We realize
  * that's sorta wonky.  Sorry about that.
+ *
+ * @note Like most commit editors, the returned editor requires that the
+ * @c copyfrom_path parameter passed to its @c add_file and @c add_directory
+ * methods is a full, URI-encoded URL, not a relative path.
  */
 svn_error_t *
 svn_repos_get_commit_editor5(const svn_delta_editor_t **editor,
                              void **edit_baton,
                              svn_repos_t *repos,
                              svn_fs_txn_t *txn,
-                             const char *repos_url,
+                             const char *repos_url_decoded,
                              const char *base_path,
                              apr_hash_t *revprop_table,
                              svn_commit_callback2_t commit_callback,

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_client/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_client/deprecated.c?rev=1655189&r1=1655188&r2=1655189&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_client/deprecated.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_client/deprecated.c Tue Jan 27 23:27:44 2015
@@ -2862,7 +2862,7 @@ svn_client_uuid_from_url(const char **uu
   /* destroy the RA session */
   svn_pool_destroy(subpool);
 
-  return svn_error_trace(err);;
+  return svn_error_trace(err);
 }
 
 svn_error_t *

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_client/externals.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_client/externals.c?rev=1655189&r1=1655188&r2=1655189&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_client/externals.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_client/externals.c Tue Jan 27 23:27:44 2015
@@ -1186,6 +1186,17 @@ svn_client__export_externals(apr_hash_t
                                                                  sub_iterpool),
                                               sub_iterpool));
 
+          /* First notify that we're about to handle an external. */
+          if (ctx->notify_func2)
+            {
+              ctx->notify_func2(
+                       ctx->notify_baton2,
+                       svn_wc_create_notify(item_abspath,
+                                            svn_wc_notify_update_external,
+                                            sub_iterpool),
+                       sub_iterpool);
+            }
+
           SVN_ERR(wrap_external_error(
                           ctx, item_abspath,
                           svn_client_export5(NULL, new_url, item_abspath,

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_client/mergeinfo.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_client/mergeinfo.c?rev=1655189&r1=1655188&r2=1655189&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_client/mergeinfo.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_client/mergeinfo.c Tue Jan 27 23:27:44 2015
@@ -2130,7 +2130,7 @@ svn_client__mergeinfo_log(svn_boolean_t
         svn_rangelist__initialize(youngest_range->end - 1,
                                   youngest_range->end,
                                   youngest_range->inheritable,
-                                  scratch_pool);;
+                                  scratch_pool);
 
       for (hi = apr_hash_first(scratch_pool, source_history);
            hi;

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_client/patch.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_client/patch.c?rev=1655189&r1=1655188&r2=1655189&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_client/patch.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_client/patch.c Tue Jan 27 23:27:44 2015
@@ -1789,18 +1789,29 @@ get_hunk_info(hunk_info_t **hi, patch_ta
                           < original_start - matched_line)))
                   matched_line = matched_line2;
 
-              /* Search from start of file if there could be a better match. */
+              /* Search from before previous hunk if there could be a
+                 better match. */
               if (search_start > 1
                   && (!matched_line
                       || (matched_line > original_start
-                          && (matched_line - original_start > original_start)))) 
+                          && (matched_line - original_start
+                              > original_start - search_start)))) 
                 {
-                  SVN_ERR(seek_to_line(content, 1, scratch_pool));
-                  SVN_ERR(scan_for_match(&matched_line, content, hunk, FALSE,
+                  svn_linenum_t search_start2 = 1;
+
+                  if (matched_line
+                      && matched_line - original_start < original_start)
+                    search_start2
+                      = original_start - (matched_line - original_start) + 1;
+
+                  SVN_ERR(seek_to_line(content, search_start2, scratch_pool));
+                  SVN_ERR(scan_for_match(&matched_line2, content, hunk, FALSE,
                                          search_start - 1, fuzz,
                                          ignore_whitespace, FALSE,
                                          cancel_func, cancel_baton,
                                          scratch_pool));
+                  if (matched_line2)
+                    matched_line = matched_line2;
                 }
             }
         }
@@ -2202,27 +2213,37 @@ sort_matched_hunks(const void *a, const
   const hunk_info_t *item2 = *((const hunk_info_t * const *)b);
   svn_boolean_t matched1 = !item1->rejected && !item1->already_applied;
   svn_boolean_t matched2 = !item2->rejected && !item2->already_applied;
+  svn_linenum_t original1, original2;
 
   if (matched1 && matched2)
     {
       /* Both match so use order matched in file. */
       if (item1->matched_line > item2->matched_line)
         return 1;
+      else if (item1->matched_line == item2->matched_line)
+        return 0;
+      else
+        return -1;
     }
   else if (matched2)
     /* Only second matches, put it before first. */
     return 1;
+  else if (matched1)
+    /* Only first matches, put it before second. */
+    return -1;
+
+  /* Neither matches, sort by original_start. */
+  original1 = svn_diff_hunk_get_original_start(item1->hunk);
+  original2 = svn_diff_hunk_get_original_start(item2->hunk);
+  if (original1 > original2)
+    return 1;
+  else if (original1 == original2)
+    return 0;
   else
-    {
-      /* Neither matches, sort by original_start. */
-      if (svn_diff_hunk_get_original_start(item1->hunk)
-          > svn_diff_hunk_get_original_start(item2->hunk))
-        return 1;
-    }
-
-  return -1;
+    return -1;
 }
 
+
 /* Apply a PATCH to a working copy at ABS_WC_PATH and put the result
  * into temporary files, to be installed in the working copy later.
  * Return information about the patch target in *PATCH_TARGET, allocated

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_fs_base/dag.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_fs_base/dag.c?rev=1655189&r1=1655188&r2=1655189&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_fs_base/dag.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_fs_base/dag.c Tue Jan 27 23:27:44 2015
@@ -1028,12 +1028,14 @@ svn_fs_base__dag_delete_if_mutable(svn_f
               void *val;
               svn_fs_dirent_t *dirent;
 
+              svn_pool_clear(subpool);
               apr_hash_this(hi, NULL, NULL, &val);
               dirent = val;
               SVN_ERR(svn_fs_base__dag_delete_if_mutable(fs, dirent->id,
                                                          txn_id, trail,
                                                          subpool));
             }
+          svn_pool_destroy(subpool);
         }
     }
 

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/fs_fs.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/fs_fs.c?rev=1655189&r1=1655188&r2=1655189&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/fs_fs.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/fs_fs.c Tue Jan 27 23:27:44 2015
@@ -26,6 +26,7 @@
 
 #include "svn_private_config.h"
 
+#include "svn_checksum.h"
 #include "svn_hash.h"
 #include "svn_props.h"
 #include "svn_time.h"
@@ -1370,10 +1371,45 @@ svn_fs_fs__file_length(svn_filesize_t *l
                        node_revision_t *noderev,
                        apr_pool_t *pool)
 {
-  if (noderev->data_rep)
-    *length = noderev->data_rep->expanded_size;
+  representation_t *data_rep = noderev->data_rep;
+  if (!data_rep)
+    {
+      /* Treat "no representation" as "empty file". */
+      *length = 0;
+    }
+  else if (data_rep->expanded_size)
+    {
+      /* Standard case: a non-empty file. */
+      *length = data_rep->expanded_size;
+    }
   else
-    *length = 0;
+    {
+      /* Work around a FSFS format quirk (see issue #4554).
+
+         A plain representation may specify its EXPANDED LENGTH as "0"
+         in which case, the SIZE value is what we want.
+
+         Because EXPANDED_LENGTH will also be 0 for empty files, while
+         SIZE is non-null, we need to check wether the content is
+         actually empty.  We simply compare with the MD5 checksum of
+         empty content (sha-1 is not always available).
+       */
+      svn_checksum_t *empty_md5
+        = svn_checksum_empty_checksum(svn_checksum_md5, pool);
+
+      if (memcmp(empty_md5->digest, data_rep->md5_digest,
+                 sizeof(data_rep->md5_digest)))
+        {
+          /* Contents is not empty, i.e. EXPANDED_LENGTH cannot be the
+             actual file length. */
+          *length = data_rep->size;
+        }
+      else
+        {
+          /* Contents is empty. */
+          *length = 0;
+        }
+    }
 
   return SVN_NO_ERROR;
 }

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/index.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/index.c?rev=1655189&r1=1655188&r2=1655189&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/index.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/index.c Tue Jan 27 23:27:44 2015
@@ -836,8 +836,8 @@ svn_fs_fs__l2p_index_append(svn_checksum
               /* 1 page with up to L2P_PAGE_SIZE entries.
                * fsfs.conf settings validation guarantees this to fit into
                * our address space. */
-              apr_size_t last_buffer_size
-                = (apr_size_t)svn_spillbuf__get_size(buffer);
+              apr_uint64_t last_buffer_size
+                = (apr_uint64_t)svn_spillbuf__get_size(buffer);
 
               svn_pool_clear(iterpool);
 

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/revprops.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/revprops.c?rev=1655189&r1=1655188&r2=1655189&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/revprops.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/revprops.c Tue Jan 27 23:27:44 2015
@@ -208,7 +208,9 @@ parse_revprop(apr_hash_t **properties,
   svn_stream_t *stream = svn_stream_from_string(content, scratch_pool);
   *properties = apr_hash_make(pool);
 
-  SVN_ERR(svn_hash_read2(*properties, stream, SVN_HASH_TERMINATOR, pool));
+  SVN_ERR_W(svn_hash_read2(*properties, stream, SVN_HASH_TERMINATOR, pool),
+            apr_psprintf(scratch_pool, "Failed to parse revprops for r%ld.",
+                         revision));
 
   return SVN_NO_ERROR;
 }

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/structure
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/structure?rev=1655189&r1=1655188&r2=1655189&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/structure (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/structure Tue Jan 27 23:27:44 2015
@@ -560,8 +560,7 @@ defined:
   props     "<rev> <item_index> <length> <size> <digest>" for props rep
             <rev> and <item_index> give location of rep
             <length> gives length of rep, sans header and trailer
-            <size> gives size of expanded rep; for props only, it may be 0
-             if equal to the length
+            <size> gives size of expanded rep (*)
             <digest> gives hex MD5 digest of expanded rep
             ### in formats >=4, also present:
             <sha1-digest> gives hex SHA1 digest of expanded rep
@@ -573,6 +572,15 @@ defined:
              which have svn:mergeinfo.
   minfo-here Exists if this node itself has svn:mergeinfo.
 
+(*) Earlier versions of this document would state that <size> may be 0
+    if the actual value matches <length>.  This is only true for property
+    and directory representations and should be avoided in general.  File
+    representations may not be handled correctly by SVN before 1.7.20,
+    1.8.12 and 1.9.0, if they have 0 <size> fields for non-empty contents.
+    Releases 1.8.0 through 1.8.11 may have falsely created instances of
+    that (see issue #4554).  Finally, 0 <size> fields are NEVER legal for
+    DELTA representations.
+
 The predecessor of a node-rev crosses both soft and true copies;
 together with the count field, it allows efficient determination of
 the base for skip-deltas.  The first node-rev of a node contains no

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/transaction.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/transaction.c?rev=1655189&r1=1655188&r2=1655189&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/transaction.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/transaction.c Tue Jan 27 23:27:44 2015
@@ -2210,10 +2210,21 @@ get_shared_rep(representation_t **old_re
         }
     }
 
-  /* Add information that is missing in the cached data. */
-  if (*old_rep)
+  if (!*old_rep)
+    return SVN_NO_ERROR;
+
+  /* We don't want 0-length PLAIN representations to replace non-0-length
+     ones (see issue #4554).  Also, this doubles as a simple guard against
+     general rep-cache induced corruption. */
+  if (   ((*old_rep)->expanded_size != rep->expanded_size)
+      || ((*old_rep)->size != rep->size))
+    {
+      *old_rep = NULL;
+    }
+  else
     {
-      /* Use the old rep for this content. */
+      /* Add information that is missing in the cached data.
+         Use the old rep for this content. */
       memcpy((*old_rep)->md5_digest, rep->md5_digest, sizeof(rep->md5_digest));
       (*old_rep)->uniquifier = rep->uniquifier;
     }

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/tree.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/tree.c?rev=1655189&r1=1655188&r2=1655189&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/tree.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_fs_fs/tree.c Tue Jan 27 23:27:44 2015
@@ -1012,6 +1012,10 @@ open_path(parent_path_t **parent_path_p,
 
       svn_pool_clear(iterpool);
 
+      /* The NODE in PARENT_PATH always lives in POOL, i.e. it will
+       * survive the cleanup of ITERPOOL and the DAG cache.*/
+      here = parent_path->node;
+
       /* Parse out the next entry from the path.  */
       entry = svn_fs__next_entry_name(&next, rest, pool);
 
@@ -1105,10 +1109,6 @@ open_path(parent_path_t **parent_path_p,
                   apr_psprintf(iterpool, _("Failure opening '%s'"), path));
 
       rest = next;
-
-      /* The NODE in PARENT_PATH equals CHILD but lives in POOL, i.e.
-       * it will survive the cleanup of ITERPOOL.*/
-      here = parent_path->node;
     }
 
   svn_pool_destroy(iterpool);

Propchange: subversion/branches/svn-auth-x509/subversion/libsvn_fs_x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jan 27 23:27:44 2015
@@ -87,4 +87,4 @@
 /subversion/branches/verify-keep-going/subversion/libsvn_fs_x:1439280-1492639,1546002-1546110
 /subversion/branches/wc-collate-path/subversion/libsvn_fs_x:1402685-1480384
 /subversion/trunk/subversion/libsvn_fs_fs:1415133-1596500,1596567,1597414,1597989,1598273,1599140,1600872,1601633,1603485-1603487,1603499,1603605,1604128,1604188,1604413-1604414,1604416-1604417,1604421,1604442,1604700,1604717,1604720,1604726,1604755,1604794,1604802,1604824,1604836,1604844,1604902-1604903,1604911,1604925,1604933,1604947,1605059-1605060,1605064-1605065,1605068,1605071-1605073,1605075,1605123,1605188-1605189,1605191,1605197,1605444,1605633,1606132,1606142,1606144,1606514,1606526,1606528,1606551,1606554,1606564,1606598-1606599,1606656,1606658,1606662,1606744,1606840,1607085,1607572,1612407,1612810,1613339,1613872,1614611,1615348,1615351-1615352,1615356,1616338-1616339,1616613,1617586,1617688,1618138,1618151,1618153,1618226,1618641,1618653,1618662,1619068,1619358,1619413,1619769,1619774,1620602,1620909,1620912,1620928,1620930,1621275,1621635,1622931,1622937,1622942,1622946,1622959-1622960,1622963,1622987,1623007,1623368,1623373,1623377,1623379,1623381,1623398,1623402,162
 4011,1624265,1624512,1626246,1626871,1626873,1626886,1627497-1627498,1627502,1627947-1627949,1627966,1628083,1628093,1628158-1628159,1628161,1628392-1628393,1628415,1628427,1628676,1628738,1628762,1628764,1629854-1629855,1629857,1629865,1629873,1629875,1629879,1630067,1630070,1631049-1631051,1631075,1631115,1631171,1631180,1631185-1631186,1631196-1631197,1631239-1631240,1631548,1631550,1631563,1631567,1631588,1631598,1632646,1632776,1632849,1632851-1632853,1632856-1632857,1632868,1632908,1632926,1633232,1633617-1633618,1634872,1634875,1634879-1634880,1634920,1636478,1636483,1636629,1636644,1637184,1637186,1637330,1637358,1637363,1637393,1639319,1639322,1639335,1639348,1639352,1639355,1639358,1639414,1639419,1639426,1639430,1639436,1639440,1639549,1640061-1640062,1640197,1640915,1640966,1641013,1643139,1643233,1645567,1646021,1646712,1646716,1647537,1647540-1647541,1647820,1647905,1648230,1648238,1648241-1648243,1648253,1648272,1648532,1648537-1648539,1648542,1648591,1648612
-/subversion/trunk/subversion/libsvn_fs_x:1414756-1509914,1603509-1652406
+/subversion/trunk/subversion/libsvn_fs_x:1414756-1509914,1603509-1655188

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_fs_x/cached_data.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_fs_x/cached_data.c?rev=1655189&r1=1655188&r2=1655189&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_fs_x/cached_data.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_fs_x/cached_data.c Tue Jan 27 23:27:44 2015
@@ -299,6 +299,7 @@ get_node_revision_body(svn_fs_x__noderev
          different from that of rev / pack files. */
       err = svn_io_file_open(&file,
                              svn_fs_x__path_txn_node_rev(fs, id,
+                                                         scratch_pool,
                                                          scratch_pool),
                              APR_READ | APR_BUFFERED, APR_OS_DEFAULT,
                              scratch_pool);
@@ -456,19 +457,6 @@ svn_fs_x__get_mergeinfo_count(apr_int64_
   return SVN_NO_ERROR;
 }
 
-
-svn_error_t *
-svn_fs_x__rev_get_root(svn_fs_x__id_t *root_id,
-                       svn_fs_t *fs,
-                       svn_revnum_t rev,
-                       apr_pool_t *scratch_pool)
-{
-  SVN_ERR(svn_fs_x__ensure_revision_exists(rev, fs, scratch_pool));
-  svn_fs_x__init_rev_root(root_id, rev);
-
-  return SVN_NO_ERROR;
-}
-
 /* Describes a lazily opened rev / pack file.  Instances will be shared
    between multiple instances of rep_state_t. */
 typedef struct shared_file_t
@@ -634,7 +622,7 @@ create_rep_state_body(rep_state_t **rep_
       && (   ((*shared_file)->revision / ffd->max_files_per_dir)
           == (revision / ffd->max_files_per_dir));
 
-  svn_fs_x__representation_cache_key_t key;
+  svn_fs_x__representation_cache_key_t key = { 0 };
   key.revision = revision;
   key.is_packed = revision < ffd->min_unpacked_rev;
   key.item_index = rep->id.number;
@@ -947,7 +935,7 @@ svn_fs_x__rep_chain_length(int *chain_le
 }
 
 
-struct rep_read_baton
+typedef struct rep_read_baton_t
 {
   /* The FS from which we're reading. */
   svn_fs_t *fs;
@@ -1009,7 +997,7 @@ struct rep_read_baton
   /* Pool used to store file handles and other data that is persistant
      for the entire stream read. */
   apr_pool_t *filehandle_pool;
-};
+} rep_read_baton_t;
 
 /* Set window key in *KEY to address the window described by RS.
    For convenience, return the KEY. */
@@ -1328,13 +1316,13 @@ build_rep_list(apr_array_header_t **list
    Allocate the result in RESULT_POOL.  This includes the pools within *RB_P.
  */
 static svn_error_t *
-rep_read_get_baton(struct rep_read_baton **rb_p,
+rep_read_get_baton(rep_read_baton_t **rb_p,
                    svn_fs_t *fs,
                    svn_fs_x__representation_t *rep,
                    svn_fs_x__pair_cache_key_t fulltext_cache_key,
                    apr_pool_t *result_pool)
 {
-  struct rep_read_baton *b;
+  rep_read_baton_t *b;
 
   b = apr_pcalloc(result_pool, sizeof(*b));
   b->fs = fs;
@@ -1511,7 +1499,7 @@ read_container_window(svn_stringbuf_t **
    base representation.  Store the window in *RESULT. */
 static svn_error_t *
 get_combined_window(svn_stringbuf_t **result,
-                    struct rep_read_baton *rb)
+                    rep_read_baton_t *rb)
 {
   apr_pool_t *pool, *new_pool, *window_pool;
   int i;
@@ -1614,7 +1602,7 @@ fulltext_size_is_cachable(svn_fs_x__data
 static svn_error_t *
 rep_read_contents_close(void *baton)
 {
-  struct rep_read_baton *rb = baton;
+  rep_read_baton_t *rb = baton;
 
   svn_pool_destroy(rb->scratch_pool);
   svn_pool_destroy(rb->filehandle_pool);
@@ -1624,7 +1612,7 @@ rep_read_contents_close(void *baton)
 
 /* Inialize the representation read state RS for the given REP_HEADER and
  * p2l index ENTRY.  If not NULL, assign FILE and STREAM to RS.
- * Use POOL for allocations.
+ * Allocate all sub-structures of RS in RESULT_POOL.
  */
 static svn_error_t *
 init_rep_state(rep_state_t *rs,
@@ -1632,10 +1620,10 @@ init_rep_state(rep_state_t *rs,
                svn_fs_t *fs,
                svn_fs_x__revision_file_t *rev_file,
                svn_fs_x__p2l_entry_t* entry,
-               apr_pool_t *pool)
+               apr_pool_t *result_pool)
 {
   svn_fs_x__data_t *ffd = fs->fsap_data;
-  shared_file_t *shared_file = apr_pcalloc(pool, sizeof(*shared_file));
+  shared_file_t *shared_file = apr_pcalloc(result_pool, sizeof(*shared_file));
 
   /* this function does not apply to representation containers */
   SVN_ERR_ASSERT(entry->type >= SVN_FS_X__ITEM_TYPE_FILE_REP
@@ -1645,7 +1633,7 @@ init_rep_state(rep_state_t *rs,
   shared_file->rfile = rev_file;
   shared_file->fs = fs;
   shared_file->revision = svn_fs_x__get_revnum(entry->items[0].change_set);
-  shared_file->pool = pool;
+  shared_file->pool = result_pool;
 
   rs->sfile = shared_file;
   rs->rep_id = entry->items[0];
@@ -1666,16 +1654,16 @@ init_rep_state(rep_state_t *rs,
  * window caches.  If MAX_OFFSET is not -1, don't read windows that start
  * at or beyond that offset.  As a side effect, return the total sum of all
  * expanded window sizes in *FULLTEXT_LEN.
- * Use POOL for temporary allocations.
+ * Use SCRATCH_POOL for temporary allocations.
  */
 static svn_error_t *
 cache_windows(svn_filesize_t *fulltext_len,
               svn_fs_t *fs,
               rep_state_t *rs,
               apr_off_t max_offset,
-              apr_pool_t *pool)
+              apr_pool_t *scratch_pool)
 {
-  apr_pool_t *iterpool = svn_pool_create(pool);
+  apr_pool_t *iterpool = svn_pool_create(scratch_pool);
   *fulltext_len = 0;
 
   while (rs->current < rs->size)
@@ -1692,7 +1680,8 @@ cache_windows(svn_filesize_t *fulltext_l
 
       /* efficiently skip windows that are still being cached instead
        * of fully decoding them */
-      SVN_ERR(get_cached_window_sizes(&window_sizes, rs, &is_cached, pool));
+      SVN_ERR(get_cached_window_sizes(&window_sizes, rs, &is_cached,
+                                      iterpool));
       if (is_cached)
         {
           *fulltext_len += window_sizes->target_len;
@@ -1706,10 +1695,10 @@ cache_windows(svn_filesize_t *fulltext_l
           apr_off_t block_start;
 
           /* navigate to & read the current window */
-          SVN_ERR(rs_aligned_seek(rs, &block_start, start_offset, pool));
+          SVN_ERR(rs_aligned_seek(rs, &block_start, start_offset, iterpool));
           SVN_ERR(svn_txdelta_read_svndiff_window(&window,
                                                   rs->sfile->rfile->stream,
-                                                  rs->ver, pool));
+                                                  rs->ver, iterpool));
 
           /* aggregate expanded window size */
           *fulltext_len += window->tview_len;
@@ -1717,7 +1706,7 @@ cache_windows(svn_filesize_t *fulltext_l
           /* determine on-disk window size */
           SVN_ERR(svn_fs_x__get_file_offset(&end_offset,
                                             rs->sfile->rfile->file,
-                                            pool));
+                                            iterpool));
           rs->current = end_offset - rs->start;
           if (rs->current > rs->size)
             return svn_error_create(SVN_ERR_FS_CORRUPT, NULL,
@@ -1727,7 +1716,7 @@ cache_windows(svn_filesize_t *fulltext_l
           /* if the window has not been cached before, cache it now
            * (if caching is used for them at all) */
           if (!is_cached)
-            SVN_ERR(set_cached_window(window, rs, start_offset, pool));
+            SVN_ERR(set_cached_window(window, rs, start_offset, iterpool));
         }
 
       rs->chunk_index++;
@@ -1808,7 +1797,7 @@ svn_fs_x__get_representation_length(svn_
 /* Return the next *LEN bytes of the rep from our plain / delta windows
    and store them in *BUF. */
 static svn_error_t *
-get_contents_from_windows(struct rep_read_baton *rb,
+get_contents_from_windows(rep_read_baton_t *rb,
                           char *buf,
                           apr_size_t *len)
 {
@@ -1953,7 +1942,7 @@ get_fulltext_partial(void **out,
  */
 static svn_error_t *
 get_contents_from_fulltext(svn_boolean_t *cached,
-                           struct rep_read_baton *baton,
+                           rep_read_baton_t *baton,
                            char *buffer,
                            apr_size_t *len)
 {
@@ -2030,7 +2019,7 @@ optimimal_allocation_size(apr_size_t nee
  * want to cache it at the end.
  */
 static svn_error_t *
-skip_contents(struct rep_read_baton *baton,
+skip_contents(rep_read_baton_t *baton,
               svn_filesize_t len)
 {
   svn_error_t *err = SVN_NO_ERROR;
@@ -2067,7 +2056,7 @@ skip_contents(struct rep_read_baton *bat
   else if (len > 0)
     {
       /* Simply drain LEN bytes from the window stream. */
-      apr_pool_t *subpool = subpool = svn_pool_create(baton->scratch_pool);
+      apr_pool_t *subpool = svn_pool_create(baton->scratch_pool);
       char *buffer = apr_palloc(subpool, SVN__STREAM_CHUNK_SIZE);
 
       while (len > 0 && !err)
@@ -2086,7 +2075,7 @@ skip_contents(struct rep_read_baton *bat
   return svn_error_trace(err);
 }
 
-/* BATON is of type `rep_read_baton'; read the next *LEN bytes of the
+/* BATON is of type `rep_read_baton_t'; read the next *LEN bytes of the
    representation and store them in *BUF.  Sum as we read and verify
    the MD5 sum at the end. */
 static svn_error_t *
@@ -2094,7 +2083,7 @@ rep_read_contents(void *baton,
                   char *buf,
                   apr_size_t *len)
 {
-  struct rep_read_baton *rb = baton;
+  rep_read_baton_t *rb = baton;
 
   /* Get data from the fulltext cache for as long as we can. */
   if (rb->fulltext_cache)
@@ -2182,7 +2171,7 @@ svn_fs_x__get_contents(svn_stream_t **co
     {
       svn_fs_x__data_t *ffd = fs->fsap_data;
       svn_filesize_t len = rep->expanded_size;
-      struct rep_read_baton *rb;
+      rep_read_baton_t *rb;
       svn_revnum_t revision = svn_fs_x__get_revnum(rep->id.change_set);
 
       svn_fs_x__pair_cache_key_t fulltext_cache_key = { 0 };
@@ -2291,11 +2280,11 @@ svn_fs_x__try_process_file_contents(svn_
 }
 
 /* Baton used when reading delta windows. */
-struct delta_read_baton
+typedef struct delta_read_baton_t
 {
   struct rep_state_t *rs;
   unsigned char md5_digest[APR_MD5_DIGESTSIZE];
-};
+} delta_read_baton_t;
 
 /* This implements the svn_txdelta_next_window_fn_t interface. */
 static svn_error_t *
@@ -2303,7 +2292,7 @@ delta_read_next_window(svn_txdelta_windo
                        void *baton,
                        apr_pool_t *pool)
 {
-  struct delta_read_baton *drb = baton;
+  delta_read_baton_t *drb = baton;
   apr_pool_t *scratch_pool = svn_pool_create(pool);
 
   *window = NULL;
@@ -2323,25 +2312,25 @@ delta_read_next_window(svn_txdelta_windo
 static const unsigned char *
 delta_read_md5_digest(void *baton)
 {
-  struct delta_read_baton *drb = baton;
+  delta_read_baton_t *drb = baton;
   return drb->md5_digest;
 }
 
 /* Return a txdelta stream for on-disk representation REP_STATE
- * of TARGET.  Allocate the result in POOL.
+ * of TARGET.  Allocate the result in RESULT_POOL.
  */
 static svn_txdelta_stream_t *
 get_storaged_delta_stream(rep_state_t *rep_state,
                           svn_fs_x__noderev_t *target,
-                          apr_pool_t *pool)
+                          apr_pool_t *result_pool)
 {
   /* Create the delta read baton. */
-  struct delta_read_baton *drb = apr_pcalloc(pool, sizeof(*drb));
+  delta_read_baton_t *drb = apr_pcalloc(result_pool, sizeof(*drb));
   drb->rs = rep_state;
   memcpy(drb->md5_digest, target->data_rep->md5_digest,
          sizeof(drb->md5_digest));
   return svn_txdelta_stream_create(drb, delta_read_next_window,
-                                   delta_read_md5_digest, pool);
+                                   delta_read_md5_digest, result_pool);
 }
 
 svn_error_t *
@@ -2349,7 +2338,8 @@ svn_fs_x__get_file_delta_stream(svn_txde
                                 svn_fs_t *fs,
                                 svn_fs_x__noderev_t *source,
                                 svn_fs_x__noderev_t *target,
-                                apr_pool_t *pool)
+                                apr_pool_t *result_pool,
+                                apr_pool_t *scratch_pool)
 {
   svn_stream_t *source_stream, *target_stream;
   rep_state_t *rep_state;
@@ -2363,7 +2353,8 @@ svn_fs_x__get_file_delta_stream(svn_txde
     {
       /* Read target's base rep if any. */
       SVN_ERR(create_rep_state(&rep_state, &rep_header, NULL,
-                                target->data_rep, fs, pool, pool));
+                               target->data_rep, fs, result_pool,
+                               scratch_pool));
 
       /* Try a shortcut: if the target is stored as a delta against the source,
          then just use that delta. */
@@ -2377,7 +2368,8 @@ svn_fs_x__get_file_delta_stream(svn_txde
                  == svn_fs_x__get_revnum(source->data_rep->id.change_set)
               && rep_header->base_item_index == source->data_rep->id.number)
             {
-              *stream_p = get_storaged_delta_stream(rep_state, target, pool);
+              *stream_p = get_storaged_delta_stream(rep_state, target,
+                                                    result_pool);
               return SVN_NO_ERROR;
             }
         }
@@ -2388,7 +2380,8 @@ svn_fs_x__get_file_delta_stream(svn_txde
              format. */
           if (rep_header->type == svn_fs_x__rep_self_delta)
             {
-              *stream_p = get_storaged_delta_stream(rep_state, target, pool);
+              *stream_p = get_storaged_delta_stream(rep_state, target,
+                                                    result_pool);
               return SVN_NO_ERROR;
             }
         }
@@ -2404,16 +2397,17 @@ svn_fs_x__get_file_delta_stream(svn_txde
   /* Read both fulltexts and construct a delta. */
   if (source)
     SVN_ERR(svn_fs_x__get_contents(&source_stream, fs, source->data_rep,
-                                   TRUE, pool));
+                                   TRUE, result_pool));
   else
-    source_stream = svn_stream_empty(pool);
+    source_stream = svn_stream_empty(result_pool);
+
   SVN_ERR(svn_fs_x__get_contents(&target_stream, fs, target->data_rep,
-                                 TRUE, pool));
+                                 TRUE, result_pool));
 
   /* Because source and target stream will already verify their content,
    * there is no need to do this once more.  In particular if the stream
    * content is being fetched from cache. */
-  svn_txdelta2(stream_p, source_stream, target_stream, FALSE, pool);
+  svn_txdelta2(stream_p, source_stream, target_stream, FALSE, result_pool);
 
   return SVN_NO_ERROR;
 }
@@ -2579,7 +2573,8 @@ get_dir_contents(apr_array_header_t **en
       && ! svn_fs_x__is_revision(noderev->data_rep->id.change_set))
     {
       const char *filename
-        = svn_fs_x__path_txn_node_children(fs, id, scratch_pool);
+        = svn_fs_x__path_txn_node_children(fs, id, scratch_pool,
+                                           scratch_pool);
 
       /* The representation is mutable.  Read the old directory
          contents from the mutable children file, followed by the
@@ -2695,6 +2690,7 @@ svn_fs_x__rep_contents_dir_entry(svn_fs_
                                  svn_fs_t *fs,
                                  svn_fs_x__noderev_t *noderev,
                                  const char *name,
+                                 apr_size_t *hint,
                                  apr_pool_t *result_pool,
                                  apr_pool_t *scratch_pool)
 {
@@ -2705,14 +2701,22 @@ svn_fs_x__rep_contents_dir_entry(svn_fs_
   svn_cache__t *cache = locate_dir_cache(fs, &key, noderev);
   if (cache)
     {
+      svn_fs_x__ede_baton_t baton;
+      baton.hint = *hint;
+      baton.name = name;
+
       /* Cache lookup. */
       SVN_ERR(svn_cache__get_partial((void **)dirent,
                                      &found,
                                      cache,
                                      &key,
                                      svn_fs_x__extract_dir_entry,
-                                     (void*)name,
+                                     &baton,
                                      result_pool));
+
+      /* Remember the new clue only if we found something at that spot. */
+      if (found)
+        *hint = baton.hint;
     }
 
   /* fetch data from disk if we did not find it in the cache */
@@ -2745,7 +2749,8 @@ svn_error_t *
 svn_fs_x__get_proplist(apr_hash_t **proplist_p,
                        svn_fs_t *fs,
                        svn_fs_x__noderev_t *noderev,
-                       apr_pool_t *pool)
+                       apr_pool_t *result_pool,
+                       apr_pool_t *scratch_pool)
 {
   apr_hash_t *proplist;
   svn_stream_t *stream;
@@ -2754,12 +2759,15 @@ svn_fs_x__get_proplist(apr_hash_t **prop
   if (noderev->prop_rep
       && !svn_fs_x__is_revision(noderev->prop_rep->id.change_set))
     {
-      const char *filename
-        = svn_fs_x__path_txn_node_props(fs, noderev_id, pool);
-      proplist = apr_hash_make(pool);
+      const char *filename = svn_fs_x__path_txn_node_props(fs, noderev_id,
+                                                           scratch_pool,
+                                                           scratch_pool);
+      proplist = apr_hash_make(result_pool);
 
-      SVN_ERR(svn_stream_open_readonly(&stream, filename, pool, pool));
-      SVN_ERR(svn_hash_read2(proplist, stream, SVN_HASH_TERMINATOR, pool));
+      SVN_ERR(svn_stream_open_readonly(&stream, filename, scratch_pool,
+                                       scratch_pool));
+      SVN_ERR(svn_hash_read2(proplist, stream, SVN_HASH_TERMINATOR,
+                             result_pool));
       SVN_ERR(svn_stream_close(stream));
     }
   else if (noderev->prop_rep)
@@ -2774,24 +2782,26 @@ svn_fs_x__get_proplist(apr_hash_t **prop
         {
           svn_boolean_t is_cached;
           SVN_ERR(svn_cache__get((void **) proplist_p, &is_cached,
-                                 ffd->properties_cache, &key, pool));
+                                 ffd->properties_cache, &key, result_pool));
           if (is_cached)
             return SVN_NO_ERROR;
         }
 
-      proplist = apr_hash_make(pool);
+      proplist = apr_hash_make(result_pool);
       SVN_ERR(svn_fs_x__get_contents(&stream, fs, noderev->prop_rep, FALSE,
-                                     pool));
-      SVN_ERR(svn_hash_read2(proplist, stream, SVN_HASH_TERMINATOR, pool));
+                                     scratch_pool));
+      SVN_ERR(svn_hash_read2(proplist, stream, SVN_HASH_TERMINATOR,
+                             result_pool));
       SVN_ERR(svn_stream_close(stream));
 
       if (ffd->properties_cache && SVN_IS_VALID_REVNUM(rep->id.change_set))
-        SVN_ERR(svn_cache__set(ffd->properties_cache, &key, proplist, pool));
+        SVN_ERR(svn_cache__set(ffd->properties_cache, &key, proplist,
+                               scratch_pool));
     }
   else
     {
       /* return an empty prop list if the node doesn't have any props */
-      proplist = apr_hash_make(pool);
+      proplist = apr_hash_make(result_pool);
     }
 
   *proplist_p = proplist;

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_fs_x/cached_data.h
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_fs_x/cached_data.h?rev=1655189&r1=1655188&r2=1655189&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_fs_x/cached_data.h (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_fs_x/cached_data.h Tue Jan 27 23:27:44 2015
@@ -49,14 +49,6 @@ svn_fs_x__get_mergeinfo_count(apr_int64_
                               const svn_fs_x__id_t *id,
                               apr_pool_t *scratch_pool);
 
-/* Set *ROOT_ID to the noderev ID for the root of revision REV in
-   filesystem FS.  Do temporary allocations in SCRATCH_POOL. */
-svn_error_t *
-svn_fs_x__rev_get_root(svn_fs_x__id_t *root_id,
-                       svn_fs_t *fs,
-                       svn_revnum_t rev,
-                       apr_pool_t *scratch_pool);
-
 /* Verify that representation REP in FS can be accessed.
    Do any allocations in SCRATCH_POOL. */
 svn_error_t *
@@ -79,13 +71,13 @@ svn_fs_x__rep_chain_length(int *chain_le
    representation REP as seen in filesystem FS.  If CACHE_FULLTEXT is
    not set, bypass fulltext cache lookup for this rep and don't put the
    reconstructed fulltext into cache.
-   Use POOL for allocations. */
+   Allocate *CONTENT_P in RESULT_POOL. */
 svn_error_t *
 svn_fs_x__get_contents(svn_stream_t **contents_p,
                        svn_fs_t *fs,
                        svn_fs_x__representation_t *rep,
                        svn_boolean_t cache_fulltext,
-                       apr_pool_t *pool);
+                       apr_pool_t *result_pool);
 
 /* Determine on-disk and expanded sizes of the representation identified
  * by ENTRY in FS and return the result in PACKED_LEN and EXPANDED_LEN,
@@ -117,13 +109,16 @@ svn_fs_x__try_process_file_contents(svn_
 
 /* Set *STREAM_P to a delta stream turning the contents of the file SOURCE
    into the contents of the file TARGET, allocated in RESULT_POOL.
-   If SOURCE is NULL, an empty string will be used in its stead. */
+   If SOURCE is NULL, an empty string will be used in its stead.
+   Use SCRATCH_POOL for temporary allocations.
+ */
 svn_error_t *
 svn_fs_x__get_file_delta_stream(svn_txdelta_stream_t **stream_p,
                                 svn_fs_t *fs,
                                 svn_fs_x__noderev_t *source,
                                 svn_fs_x__noderev_t *target,
-                                apr_pool_t *result_pool);
+                                apr_pool_t *result_pool,
+                                apr_pool_t *scratch_pool);
 
 /* Set *ENTRIES to an apr_array_header_t of dirent structs that contain
    the directory entries of node-revision NODEREV in filesystem FS.  The
@@ -147,24 +142,31 @@ svn_fs_x__find_dir_entry(apr_array_heade
 
 /* Set *DIRENT to the entry identified by NAME in the directory given
    by NODEREV in filesystem FS.  If no such entry exits, *DIRENT will
-   be NULL. The returned object is allocated in RESULT_POOL; SCRATCH_POOL
+   be NULL.  The value referenced by HINT can be used to speed up
+   consecutive calls when travering the directory in name order.
+   Any value is allowed, however APR_SIZE_MAX gives best performance
+   when there has been no previous lookup for the same directory.
+
+   The returned object is allocated in RESULT_POOL; SCRATCH_POOL
    used for temporary allocations. */
 svn_error_t *
 svn_fs_x__rep_contents_dir_entry(svn_fs_x__dirent_t **dirent,
                                  svn_fs_t *fs,
                                  svn_fs_x__noderev_t *noderev,
                                  const char *name,
+                                 apr_size_t *hint,
                                  apr_pool_t *result_pool,
                                  apr_pool_t *scratch_pool);
 
 /* Set *PROPLIST to be an apr_hash_t containing the property list of
-   node-revision NODEREV as seen in filesystem FS.  Use POOL for
-   temporary allocations. */
+   node-revision NODEREV as seen in filesystem FS.  Allocate the result
+   in RESULT_POOL and use SCRATCH_POOL for temporary allocations. */
 svn_error_t *
 svn_fs_x__get_proplist(apr_hash_t **proplist,
                        svn_fs_t *fs,
                        svn_fs_x__noderev_t *noderev,
-                       apr_pool_t *pool);
+                       apr_pool_t *result_pool,
+                       apr_pool_t *scratch_pool);
 
 /* Fetch the list of change in revision REV in FS and return it in *CHANGES.
  * Allocate the result in POOL.

Modified: subversion/branches/svn-auth-x509/subversion/libsvn_fs_x/caching.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-auth-x509/subversion/libsvn_fs_x/caching.c?rev=1655189&r1=1655188&r2=1655189&view=diff
==============================================================================
--- subversion/branches/svn-auth-x509/subversion/libsvn_fs_x/caching.c (original)
+++ subversion/branches/svn-auth-x509/subversion/libsvn_fs_x/caching.c Tue Jan 27 23:27:44 2015
@@ -172,21 +172,21 @@ warn_and_fail_on_cache_errors(svn_error_
 
 #ifdef SVN_DEBUG_CACHE_DUMP_STATS
 /* Baton to be used for the dump_cache_statistics() pool cleanup function, */
-struct dump_cache_baton_t
+typedef struct dump_cache_baton_t
 {
   /* the pool about to be cleaned up. Will be used for temp. allocations. */
   apr_pool_t *pool;
 
   /* the cache to dump the statistics for */
   svn_cache__t *cache;
-};
+} dump_cache_baton_t;
 
 /* APR pool cleanup handler that will printf the statistics of the
    cache referenced by the baton in BATON_VOID. */
 static apr_status_t
 dump_cache_statistics(void *baton_void)
 {
-  struct dump_cache_baton_t *baton = baton_void;
+  dump_cache_baton_t *baton = baton_void;
 
   apr_status_t result = APR_SUCCESS;
   svn_cache__info_t info;
@@ -267,7 +267,7 @@ init_callbacks(svn_cache__t *cache,
       /* schedule printing the access statistics upon pool cleanup,
        * i.e. end of FSX session.
        */
-      struct dump_cache_baton_t *baton;
+      dump_cache_baton_t *baton;
 
       baton = apr_palloc(pool, sizeof(*baton));
       baton->pool = pool;



Mime
View raw message