aboutsummaryrefslogtreecommitdiff
path: root/subversion
diff options
context:
space:
mode:
authorPeter Wemm <peter@FreeBSD.org>2014-02-20 19:26:10 +0000
committerPeter Wemm <peter@FreeBSD.org>2014-02-20 19:26:10 +0000
commit219f5ebf8fca3572d8d4265d78d0e4670ca35a27 (patch)
treee6232088e2faabbf0f1a6e568df3285323f27c5c /subversion
parenteeb88685bfa4ef1c0639f1136d83ff19de1b4595 (diff)
downloadsrc-219f5ebf8fca3572d8d4265d78d0e4670ca35a27.tar.gz
src-219f5ebf8fca3572d8d4265d78d0e4670ca35a27.zip
Vendor import svn-1.8.8vendor/subversion/subversion-1.8.8
Notes
Notes: svn path=/vendor/subversion/dist/; revision=262248 svn path=/vendor/subversion/subversion-1.8.8/; revision=262249; tag=vendor/subversion/subversion-1.8.8
Diffstat (limited to 'subversion')
-rw-r--r--subversion/include/private/svn_auth_private.h37
-rw-r--r--subversion/include/private/svn_diff_tree.h8
-rw-r--r--subversion/include/private/svn_mutex.h10
-rw-r--r--subversion/include/svn_auth.h7
-rw-r--r--subversion/include/svn_client.h14
-rw-r--r--subversion/include/svn_config.h7
-rw-r--r--subversion/include/svn_diff.h11
-rw-r--r--subversion/include/svn_dirent_uri.h6
-rw-r--r--subversion/include/svn_io.h23
-rw-r--r--subversion/include/svn_repos.h3
-rw-r--r--subversion/include/svn_version.h6
-rw-r--r--subversion/include/svn_wc.h8
-rw-r--r--subversion/libsvn_client/copy.c20
-rw-r--r--subversion/libsvn_client/log.c10
-rw-r--r--subversion/libsvn_client/prop_commands.c41
-rw-r--r--subversion/libsvn_client/update.c2
-rw-r--r--subversion/libsvn_client/util.c7
-rw-r--r--subversion/libsvn_fs_fs/fs_fs.c10
-rw-r--r--subversion/libsvn_fs_fs/rep-cache-db.h2
-rw-r--r--subversion/libsvn_fs_fs/rep-cache.c27
-rw-r--r--subversion/libsvn_ra_serf/commit.c4
-rw-r--r--subversion/libsvn_ra_serf/util.c151
-rw-r--r--subversion/libsvn_repos/commit.c11
-rw-r--r--subversion/libsvn_repos/reporter.c55
-rw-r--r--subversion/libsvn_subr/auth.c6
-rw-r--r--subversion/libsvn_subr/cache-membuffer.c8
-rw-r--r--subversion/libsvn_subr/cmdline.c11
-rw-r--r--subversion/libsvn_subr/internal_statements.h2
-rw-r--r--subversion/libsvn_subr/io.c17
-rw-r--r--subversion/libsvn_subr/sqlite.c43
-rw-r--r--subversion/libsvn_subr/sqlite3wrapper.c1
-rw-r--r--subversion/libsvn_subr/subst.c16
-rw-r--r--subversion/libsvn_subr/sysinfo.c12
-rw-r--r--subversion/libsvn_subr/win32_crypto.c32
-rw-r--r--subversion/libsvn_wc/conflicts.h8
-rw-r--r--subversion/libsvn_wc/diff_local.c17
-rw-r--r--subversion/libsvn_wc/upgrade.c4
-rw-r--r--subversion/libsvn_wc/wc-checks.h2
-rw-r--r--subversion/libsvn_wc/wc-metadata.h149
-rw-r--r--subversion/libsvn_wc/wc-metadata.sql48
-rw-r--r--subversion/libsvn_wc/wc-queries.h162
-rw-r--r--subversion/libsvn_wc/wc-queries.sql7
-rw-r--r--subversion/libsvn_wc/wc.h2
-rw-r--r--subversion/libsvn_wc/wc_db.c26
-rw-r--r--subversion/libsvn_wc/wc_db.h10
-rw-r--r--subversion/libsvn_wc/wc_db_util.c16
-rw-r--r--subversion/svn/conflict-callbacks.c4
-rw-r--r--subversion/svn/status-cmd.c3
-rw-r--r--subversion/svn/svn.c4
-rw-r--r--subversion/svnserve/svnserve.c4
50 files changed, 789 insertions, 305 deletions
diff --git a/subversion/include/private/svn_auth_private.h b/subversion/include/private/svn_auth_private.h
index 7a1c7167b36a..6c32688a3971 100644
--- a/subversion/include/private/svn_auth_private.h
+++ b/subversion/include/private/svn_auth_private.h
@@ -37,6 +37,24 @@
extern "C" {
#endif /* __cplusplus */
+/** SSL server authority verification credential type.
+ *
+ * The followin auth parameters are available to the providers:
+ *
+ * - @c SVN_AUTH_PARAM_SSL_SERVER_FAILURES (@c apr_uint32_t*)
+ * - @c SVN_AUTH_PARAM_SSL_SERVER_CERT_INFO
+ * (@c svn_auth_ssl_server_cert_info_t*)
+ *
+ * The following optional auth parameters are relevant to the providers:
+ *
+ * - @c SVN_AUTH_PARAM_NO_AUTH_CACHE (@c void*)
+ *
+ * @since New in 1.9.
+ */
+#define SVN_AUTH_CRED_SSL_SERVER_AUTHORITY "svn.ssl.server.authority"
+
+
+
/* If you add a password type for a provider which stores
* passwords on disk in encrypted form, remember to update
* svn_auth__simple_save_creds_helper. Otherwise it will be
@@ -213,6 +231,25 @@ svn_auth__ssl_client_cert_pw_set(svn_boolean_t *done,
svn_boolean_t non_interactive,
apr_pool_t *pool);
+#if (defined(WIN32) && !defined(__MINGW32__)) || defined(DOXYGEN)
+/**
+ * Set @a *provider to an authentication provider that implements
+ * ssl authority verification via the Windows CryptoApi.
+ *
+ * This provider automatically validates authority certificates with
+ * the CryptoApi, like Internet Explorer and the Windows network API do.
+ * This allows the rollout of root certificates via Windows Domain
+ * policies, instead of Subversion specific configuration.
+ *
+ * @note This function is only available on Windows.
+ */
+void
+svn_auth__get_windows_ssl_server_authority_provider(
+ svn_auth_provider_object_t **provider,
+ apr_pool_t *pool);
+#endif
+
+
#ifdef __cplusplus
}
#endif /* __cplusplus */
diff --git a/subversion/include/private/svn_diff_tree.h b/subversion/include/private/svn_diff_tree.h
index 597a59be8394..8cd4c0e71018 100644
--- a/subversion/include/private/svn_diff_tree.h
+++ b/subversion/include/private/svn_diff_tree.h
@@ -20,13 +20,13 @@
* ====================================================================
* @endcopyright
*
- * @file svn_wc.h
+ * @file svn_diff_tree.h
* @brief Generic diff handler. Replacing the old svn_wc_diff_callbacks4_t
* infrastructure
*/
-#ifndef SVN_DIFF_PROCESSOR_H
-#define SVN_DIFF_PROCESSOR_H
+#ifndef SVN_DIFF_TREE_H
+#define SVN_DIFF_TREE_H
#include "svn_types.h"
@@ -353,5 +353,5 @@ svn_diff__source_create(svn_revnum_t revision,
}
#endif /* __cplusplus */
-#endif /* SVN_DIFF_PROCESSOR_H */
+#endif /* SVN_DIFF_TREE_H */
diff --git a/subversion/include/private/svn_mutex.h b/subversion/include/private/svn_mutex.h
index 85583d32fbb3..c64769717b40 100644
--- a/subversion/include/private/svn_mutex.h
+++ b/subversion/include/private/svn_mutex.h
@@ -21,7 +21,7 @@
* @endcopyright
*
* @file svn_mutex.h
- * @brief Strutures and functions for mutual exclusion
+ * @brief Structures and functions for mutual exclusion
*/
#ifndef SVN_MUTEX_H
@@ -72,7 +72,7 @@ svn_mutex__init(svn_mutex__t **mutex,
* thread to release the mutex again. Recursive locking are not supported.
*
* @note You should use #SVN_MUTEX__WITH_LOCK instead of explicit lock
- * aquisition and release.
+ * acquisition and release.
*/
svn_error_t *
svn_mutex__lock(svn_mutex__t *mutex);
@@ -88,19 +88,19 @@ svn_mutex__lock(svn_mutex__t *mutex);
* reported in the return value.
*
* @note You should use #SVN_MUTEX__WITH_LOCK instead of explicit lock
- * aquisition and release.
+ * acquisition and release.
*/
svn_error_t *
svn_mutex__unlock(svn_mutex__t *mutex,
svn_error_t *err);
-/** Aquires the @a mutex, executes the expression @a expr and finally
+/** Acquires the @a mutex, executes the expression @a expr and finally
* releases the @a mutex. If any of these steps fail, the function using
* this macro will return an #svn_error_t. This macro guarantees that
* the @a mutex will always be unlocked again if it got locked successfully
* by the first step.
*
- * @note Prefer using this macro instead of explicit lock aquisition and
+ * @note Prefer using this macro instead of explicit lock acquisition and
* release.
*/
#define SVN_MUTEX__WITH_LOCK(mutex, expr) \
diff --git a/subversion/include/svn_auth.h b/subversion/include/svn_auth.h
index dadc1cf6c6b5..3e9f45e5c201 100644
--- a/subversion/include/svn_auth.h
+++ b/subversion/include/svn_auth.h
@@ -966,7 +966,10 @@ svn_auth_get_keychain_ssl_client_cert_pw_provider(
apr_pool_t *pool);
#endif /* DARWIN || DOXYGEN */
-#if (!defined(DARWIN) && !defined(WIN32)) || defined(DOXYGEN)
+/* Note that the gnome keyring unlock prompt related items below must be
+ * declared for all platforms in order to allow SWIG interfaces to be
+ * used regardless of the platform. */
+
/** A type of callback function for obtaining the GNOME Keyring password.
*
* In this callback, the client should ask the user for default keyring
@@ -996,7 +999,7 @@ typedef svn_error_t *(*svn_auth_gnome_keyring_unlock_prompt_func_t)(
* @c *SVN_AUTH_PARAM_GNOME_KEYRING_UNLOCK_PROMPT_FUNC. */
#define SVN_AUTH_PARAM_GNOME_KEYRING_UNLOCK_PROMPT_BATON "gnome-keyring-unlock-prompt-baton"
-
+#if (!defined(DARWIN) && !defined(WIN32)) || defined(DOXYGEN)
/**
* Get libsvn_auth_gnome_keyring version information.
*
diff --git a/subversion/include/svn_client.h b/subversion/include/svn_client.h
index d8eacdf26786..5db3e1689589 100644
--- a/subversion/include/svn_client.h
+++ b/subversion/include/svn_client.h
@@ -439,9 +439,17 @@ typedef struct svn_client_commit_info_t
#define SVN_CLIENT_COMMIT_ITEM_TEXT_MODS 0x04
#define SVN_CLIENT_COMMIT_ITEM_PROP_MODS 0x08
#define SVN_CLIENT_COMMIT_ITEM_IS_COPY 0x10
-/** @since New in 1.2. */
+/** One of the flags for a commit item. The node has a lock token that
+ * should be released after a successful commit and, if the node is also
+ * modified, transferred to the server as part of the commit process.
+ *
+ * @since New in 1.2. */
#define SVN_CLIENT_COMMIT_ITEM_LOCK_TOKEN 0x20
-/** @since New in 1.8. */
+/** One of the flags for a commit item. The node is the 'moved here'
+ * side of a local move. This is used to check and enforce that the
+ * other side of the move is also included in the commit.
+ *
+ * @since New in 1.8. */
#define SVN_CLIENT_COMMIT_ITEM_MOVED_HERE 0x40
/** @} */
@@ -6449,7 +6457,7 @@ svn_client_open_ra_session2(svn_ra_session_t **session,
apr_pool_t *result_pool,
apr_pool_t *scratch_pool);
-/** Similar to svn_client_open_ra_session(), but with @ wri_abspath
+/** Similar to svn_client_open_ra_session2(), but with @ wri_abspath
* always passed as NULL, and with the same pool used as both @a
* result_pool and @a scratch_pool.
*
diff --git a/subversion/include/svn_config.h b/subversion/include/svn_config.h
index be8ec4cdb981..a3fa9df937eb 100644
--- a/subversion/include/svn_config.h
+++ b/subversion/include/svn_config.h
@@ -98,8 +98,11 @@ typedef struct svn_config_t svn_config_t;
#define SVN_CONFIG_CATEGORY_CONFIG "config"
#define SVN_CONFIG_SECTION_AUTH "auth"
+/** @since New in 1.6. */
#define SVN_CONFIG_OPTION_PASSWORD_STORES "password-stores"
+/** @since New in 1.6. */
#define SVN_CONFIG_OPTION_KWALLET_WALLET "kwallet-wallet"
+/** @since New in 1.6. */
#define SVN_CONFIG_OPTION_KWALLET_SVN_APPLICATION_NAME_WITH_PID "kwallet-svn-application-name-with-pid"
/** @since New in 1.8. */
#define SVN_CONFIG_OPTION_SSL_CLIENT_CERT_FILE_PROMPT "ssl-client-cert-file-prompt"
@@ -123,7 +126,9 @@ typedef struct svn_config_t svn_config_t;
#define SVN_CONFIG_OPTION_NO_UNLOCK "no-unlock"
#define SVN_CONFIG_OPTION_MIMETYPES_FILE "mime-types-file"
#define SVN_CONFIG_OPTION_PRESERVED_CF_EXTS "preserved-conflict-file-exts"
+/** @since New in 1.7. */
#define SVN_CONFIG_OPTION_INTERACTIVE_CONFLICTS "interactive-conflicts"
+/** @since New in 1.7. */
#define SVN_CONFIG_OPTION_MEMORY_CACHE_SIZE "memory-cache-size"
#define SVN_CONFIG_SECTION_TUNNELS "tunnels"
#define SVN_CONFIG_SECTION_AUTO_PROPS "auto-props"
@@ -168,10 +173,12 @@ typedef struct svn_config_t svn_config_t;
/* We want this to be printed on two lines in the generated config file,
* but we don't want the # character to end up in the variable.
*/
+#ifndef DOXYGEN_SHOULD_SKIP_THIS
#define SVN_CONFIG__DEFAULT_GLOBAL_IGNORES_LINE_1 \
"*.o *.lo *.la *.al .libs *.so *.so.[0-9]* *.a *.pyc *.pyo __pycache__"
#define SVN_CONFIG__DEFAULT_GLOBAL_IGNORES_LINE_2 \
"*.rej *~ #*# .#* .*.swp .DS_Store"
+#endif
#define SVN_CONFIG_DEFAULT_GLOBAL_IGNORES \
SVN_CONFIG__DEFAULT_GLOBAL_IGNORES_LINE_1 " " \
diff --git a/subversion/include/svn_diff.h b/subversion/include/svn_diff.h
index 23b8970fb1dd..ac9f8fcb4db4 100644
--- a/subversion/include/svn_diff.h
+++ b/subversion/include/svn_diff.h
@@ -911,8 +911,8 @@ typedef struct svn_diff_hunk_t svn_diff_hunk_t;
/**
* Allocate @a *stringbuf in @a result_pool, and read into it one line
- * of the diff text of @a hunk. The first line returned is the hunk header.
- * Any subsequent lines are unidiff data (starting with '+', '-', or ' ').
+ * of the diff text of @a hunk. The hunk header is not returned only the
+ * unidiff data lines (starting with '+', '-', or ' ') are returned.
* If the @a hunk is being interpreted in reverse (i.e. the reverse
* parameter of svn_diff_parse_next_patch() was @c TRUE), the diff
* text will be returned in reversed form.
@@ -922,6 +922,13 @@ typedef struct svn_diff_hunk_t svn_diff_hunk_t;
* hunk does not end with a newline character and @a eol is not NULL.
* Temporary allocations will be performed in @a scratch_pool.
*
+ * @note The hunk header information can be retrievied with the following
+ * functions:
+ * @see svn_diff_hunk_get_original_start()
+ * @see svn_diff_hunk_get_original_length()
+ * @see svn_diff_hunk_get_modified_start()
+ * @see svn_diff_hunk_get_modified_length()
+ *
* @since New in 1.7.
*/
svn_error_t *
diff --git a/subversion/include/svn_dirent_uri.h b/subversion/include/svn_dirent_uri.h
index 8fb449ded4c3..c4374d7a32aa 100644
--- a/subversion/include/svn_dirent_uri.h
+++ b/subversion/include/svn_dirent_uri.h
@@ -646,8 +646,8 @@ svn_dirent_skip_ancestor(const char *parent_dirent,
/** Return the relative path part of @a child_relpath that is below
* @a parent_relpath, or just "" if @a parent_relpath is equal to
- * @a child_relpath. If @a child_relpath is not below or equal to
- * @a parent_relpath, return NULL.
+ * @a child_relpath. If @a child_relpath is not below @a parent_relpath,
+ * return NULL.
*
* @since New in 1.7.
*/
@@ -657,7 +657,7 @@ svn_relpath_skip_ancestor(const char *parent_relpath,
/** Return the URI-decoded relative path of @a child_uri that is below
* @a parent_uri, or just "" if @a parent_uri is equal to @a child_uri. If
- * @a child_uri is not below or equal to @a parent_uri, return NULL.
+ * @a child_uri is not below @a parent_uri, return NULL.
*
* Allocate the result in @a result_pool.
*
diff --git a/subversion/include/svn_io.h b/subversion/include/svn_io.h
index 92874e1c1ed7..76274dd37bc1 100644
--- a/subversion/include/svn_io.h
+++ b/subversion/include/svn_io.h
@@ -182,9 +182,10 @@ svn_io_check_resolved_path(const char *path,
* may be @c NULL. If @a file is @c NULL, the file will be created but not
* open.
*
- * If @a delete_when is #svn_io_file_del_on_close, then the @c APR_DELONCLOSE
- * flag will be used when opening the file. The @c APR_BUFFERED flag will
- * always be used.
+ * The file will be deleted according to @a delete_when. If that is
+ * #svn_io_file_del_on_pool_cleanup, it refers to @a result_pool.
+ *
+ * The @c APR_BUFFERED flag will always be used when opening the file.
*
* The first attempt will just append @a suffix. If the result is not
* a unique name, then subsequent attempts will append a dot,
@@ -248,8 +249,9 @@ svn_io_open_uniquely_named(apr_file_t **file,
* be possible to atomically rename the resulting file due to cross-device
* issues.)
*
- * The file will be deleted according to @a delete_when. If @a delete_when
- * is @c svn_io_file_del_on_close and @a file is @c NULL, the file will be
+ * The file will be deleted according to @a delete_when. If that is
+ * #svn_io_file_del_on_pool_cleanup, it refers to @a result_pool. If it
+ * is #svn_io_file_del_on_close and @a file is @c NULL, the file will be
* deleted before this function returns.
*
* When passing @c svn_io_file_del_none please don't forget to eventually
@@ -917,7 +919,7 @@ svn_stream_empty(apr_pool_t *pool);
/** Return a stream allocated in @a pool which forwards all requests
* to @a stream. Destruction is explicitly excluded from forwarding.
*
- * @see notes/destruction-of-stacked-resources
+ * @see http://subversion.apache.org/docs/community-guide/conventions.html#destruction-of-stacked-resources
*
* @since New in 1.4.
*/
@@ -972,7 +974,8 @@ svn_stream_open_writable(svn_stream_t **stream,
* be possible to atomically rename the resulting file due to cross-device
* issues.)
*
- * The file will be deleted according to @a delete_when.
+ * The file will be deleted according to @a delete_when. If that is
+ * #svn_io_file_del_on_pool_cleanup, it refers to @a result_pool.
*
* Temporary allocations will be performed in @a scratch_pool.
*
@@ -1589,8 +1592,8 @@ svn_io_stat_dirent2(const svn_io_dirent2_t **dirent_p,
apr_pool_t *scratch_pool);
-/** Similar to svn_io_stat_dirent2, but always passes FALSE for
- * verify_truename.
+/** Similar to svn_io_stat_dirent2(), but always passes FALSE for
+ * @a verify_truename.
*
* @since New in 1.7.
* @deprecated Provided for backwards compatibility with the 1.7 API.
@@ -1681,7 +1684,7 @@ svn_io_dir_walk(const char *dirname,
*
* @note An APR bug affects Windows: passing a NULL @a env does not
* guarantee the invoked program to run with an empty environment when
- * @a inherits is FALSE, the program may inherit its parent's environment.
+ * @a inherit is FALSE, the program may inherit its parent's environment.
* Explicitly pass an empty @a env to get an empty environment.
*
* @since New in 1.8.
diff --git a/subversion/include/svn_repos.h b/subversion/include/svn_repos.h
index 2cec6dd02ad9..6ffa84257ba0 100644
--- a/subversion/include/svn_repos.h
+++ b/subversion/include/svn_repos.h
@@ -298,8 +298,7 @@ typedef struct svn_repos_notify_t
* the revision which just completed. */
svn_revnum_t revision;
- /** For #svn_repos_notify_warning, the warning object. Must be cleared
- by the consumer of the notification. */
+ /** For #svn_repos_notify_warning, the warning object. */
const char *warning_str;
svn_repos_notify_warning_t warning;
diff --git a/subversion/include/svn_version.h b/subversion/include/svn_version.h
index d516a18ad91f..646c0286abc9 100644
--- a/subversion/include/svn_version.h
+++ b/subversion/include/svn_version.h
@@ -72,7 +72,7 @@ extern "C" {
*
* @since New in 1.1.
*/
-#define SVN_VER_PATCH 5
+#define SVN_VER_PATCH 8
/** @deprecated Provided for backward compatibility with the 1.0 API. */
@@ -95,7 +95,7 @@ extern "C" {
*
* Always change this at the same time as SVN_VER_NUMTAG.
*/
-#define SVN_VER_TAG " (r1542147)"
+#define SVN_VER_TAG " (r1568071)"
/** Number tag: a string describing the version.
@@ -121,7 +121,7 @@ extern "C" {
* When rolling a tarball, we automatically replace it with what we
* guess to be the correct revision number.
*/
-#define SVN_VER_REVISION 1542147
+#define SVN_VER_REVISION 1568071
/* Version strings composed from the above definitions. */
diff --git a/subversion/include/svn_wc.h b/subversion/include/svn_wc.h
index 2a9741d3398a..37210ff055e6 100644
--- a/subversion/include/svn_wc.h
+++ b/subversion/include/svn_wc.h
@@ -2109,9 +2109,8 @@ typedef struct svn_wc_conflict_result_t
* Allocate an #svn_wc_conflict_result_t structure in @a pool,
* initialize and return it.
*
- * Set the @c choice field of the structure to @a choice, and @c
- * merged_file to @a merged_file. Set all other fields to their @c
- * _unknown, @c NULL or invalid value, respectively. Make only a shallow
+ * Set the @c choice field of the structure to @a choice, @c merged_file
+ * to @a merged_file, and @c save_merged to false. Make only a shallow
* copy of the pointer argument @a merged_file.
*
* @since New in 1.5.
@@ -4078,6 +4077,9 @@ typedef void (*svn_wc_status_func_t)(void *baton,
* @a ignore_patterns is an array of file patterns matching
* unversioned files to ignore for the purposes of status reporting,
* or @c NULL if the default set of ignorable file patterns should be used.
+ * Patterns from #SVN_PROP_IGNORE (and, as of 1.8,
+ * #SVN_PROP_INHERITABLE_IGNORES) properties are always used, even if not
+ * specified in @a ignore_patterns.
*
* If @a cancel_func is non-NULL, call it with @a cancel_baton while walking
* to determine if the client has canceled the operation.
diff --git a/subversion/libsvn_client/copy.c b/subversion/libsvn_client/copy.c
index 000ae0c2ff1c..f204bbcf2c4e 100644
--- a/subversion/libsvn_client/copy.c
+++ b/subversion/libsvn_client/copy.c
@@ -314,6 +314,8 @@ do_wc_to_wc_moves(svn_boolean_t *timestamp_sleep,
{
const char *src_parent_abspath;
svn_boolean_t lock_src, lock_dst;
+ const char *src_wcroot_abspath;
+ const char *dst_wcroot_abspath;
svn_client__copy_pair_t *pair = APR_ARRAY_IDX(copy_pairs, i,
svn_client__copy_pair_t *);
@@ -326,6 +328,13 @@ do_wc_to_wc_moves(svn_boolean_t *timestamp_sleep,
src_parent_abspath = svn_dirent_dirname(pair->src_abspath_or_url,
iterpool);
+ SVN_ERR(svn_wc__get_wcroot(&src_wcroot_abspath,
+ ctx->wc_ctx, src_parent_abspath,
+ iterpool, iterpool));
+ SVN_ERR(svn_wc__get_wcroot(&dst_wcroot_abspath,
+ ctx->wc_ctx, pair->dst_parent_abspath,
+ iterpool, iterpool));
+
/* We now need to lock the right combination of batons.
Four cases:
1) src_parent == dst_parent
@@ -334,15 +343,18 @@ do_wc_to_wc_moves(svn_boolean_t *timestamp_sleep,
4) src_parent and dst_parent are disjoint
We can handle 1) as either 2) or 3) */
if (strcmp(src_parent_abspath, pair->dst_parent_abspath) == 0
- || svn_dirent_is_child(src_parent_abspath, pair->dst_parent_abspath,
- iterpool))
+ || (svn_dirent_is_child(src_parent_abspath, pair->dst_parent_abspath,
+ NULL)
+ && !svn_dirent_is_child(src_parent_abspath, dst_wcroot_abspath,
+ NULL)))
{
lock_src = TRUE;
lock_dst = FALSE;
}
else if (svn_dirent_is_child(pair->dst_parent_abspath,
- src_parent_abspath,
- iterpool))
+ src_parent_abspath, NULL)
+ && !svn_dirent_is_child(pair->dst_parent_abspath,
+ src_wcroot_abspath, NULL))
{
lock_src = FALSE;
lock_dst = TRUE;
diff --git a/subversion/libsvn_client/log.c b/subversion/libsvn_client/log.c
index 73bd61211eb4..5bf7e415b725 100644
--- a/subversion/libsvn_client/log.c
+++ b/subversion/libsvn_client/log.c
@@ -861,17 +861,19 @@ svn_client_log5(const apr_array_header_t *targets,
actual_loc->url, pool));
/* Save us an RA layer round trip if we are on the repository root and
- know the result in advance. All the revision data has already been
- validated.
+ know the result in advance, or if we don't need multiple ranges.
+ All the revision data has already been validated.
*/
- if (strcmp(actual_loc->url, actual_loc->repos_root_url) == 0)
+ if (strcmp(actual_loc->url, actual_loc->repos_root_url) == 0
+ || opt_rev_ranges->nelts <= 1)
{
svn_location_segment_t *segment = apr_pcalloc(pool, sizeof(*segment));
log_segments = apr_array_make(pool, 1, sizeof(segment));
segment->range_start = oldest_rev;
segment->range_end = actual_loc->rev;
- segment->path = "";
+ segment->path = svn_uri_skip_ancestor(actual_loc->repos_root_url,
+ actual_loc->url, pool);
APR_ARRAY_PUSH(log_segments, svn_location_segment_t *) = segment;
}
else
diff --git a/subversion/libsvn_client/prop_commands.c b/subversion/libsvn_client/prop_commands.c
index c3c1cfaa6aca..a3e59c866813 100644
--- a/subversion/libsvn_client/prop_commands.c
+++ b/subversion/libsvn_client/prop_commands.c
@@ -1201,6 +1201,7 @@ struct recursive_proplist_receiver_baton
svn_wc_context_t *wc_ctx; /* Working copy context. */
svn_proplist_receiver2_t wrapped_receiver; /* Proplist receiver to call. */
void *wrapped_receiver_baton; /* Baton for the proplist receiver. */
+ apr_array_header_t *iprops;
/* Anchor, anchor_abspath pair for converting to relative paths */
const char *anchor;
@@ -1216,6 +1217,27 @@ recursive_proplist_receiver(void *baton,
{
struct recursive_proplist_receiver_baton *b = baton;
const char *path;
+ apr_array_header_t *iprops = NULL;
+
+ if (b->iprops
+ && ! strcmp(local_abspath, b->anchor_abspath))
+ {
+ /* Report iprops with the properties for the anchor */
+ iprops = b->iprops;
+ b->iprops = NULL;
+ }
+ else if (b->iprops)
+ {
+ /* No report for the root?
+ Report iprops anyway */
+
+ SVN_ERR(b->wrapped_receiver(b->wrapped_receiver_baton,
+ b->anchor ? b->anchor : local_abspath,
+ NULL /* prop_hash */,
+ b->iprops,
+ scratch_pool));
+ b->iprops = NULL;
+ }
/* Attempt to convert absolute paths to relative paths for
* presentation purposes, if needed. */
@@ -1230,7 +1252,7 @@ recursive_proplist_receiver(void *baton,
path = local_abspath;
return svn_error_trace(b->wrapped_receiver(b->wrapped_receiver_baton,
- path, props, NULL,
+ path, props, iprops,
scratch_pool));
}
@@ -1370,6 +1392,7 @@ get_local_props(const char *path_or_url,
svn_node_kind_t kind;
apr_hash_t *changelist_hash = NULL;
const char *local_abspath;
+ apr_array_header_t *iprops = NULL;
SVN_ERR(svn_dirent_get_absolute(&local_abspath, path_or_url,
scratch_pool));
@@ -1392,7 +1415,6 @@ get_local_props(const char *path_or_url,
if (get_target_inherited_props)
{
- apr_array_header_t *iprops;
const char *repos_root_url;
SVN_ERR(svn_wc__get_iprops(&iprops, ctx->wc_ctx, local_abspath,
@@ -1402,8 +1424,6 @@ get_local_props(const char *path_or_url,
SVN_ERR(svn_client__iprop_relpaths_to_urls(iprops, repos_root_url,
scratch_pool,
scratch_pool));
- SVN_ERR(call_receiver(path_or_url, NULL, iprops, receiver,
- receiver_baton, scratch_pool));
}
if (changelists && changelists->nelts)
@@ -1418,16 +1438,16 @@ get_local_props(const char *path_or_url,
rb.wc_ctx = ctx->wc_ctx;
rb.wrapped_receiver = receiver;
rb.wrapped_receiver_baton = receiver_baton;
+ rb.iprops = iprops;
+ rb.anchor_abspath = local_abspath;
if (strcmp(path_or_url, local_abspath) != 0)
{
rb.anchor = path_or_url;
- rb.anchor_abspath = local_abspath;
}
else
{
rb.anchor = NULL;
- rb.anchor_abspath = NULL;
}
SVN_ERR(svn_wc__prop_list_recursive(ctx->wc_ctx, local_abspath, NULL,
@@ -1435,6 +1455,13 @@ get_local_props(const char *path_or_url,
recursive_proplist_receiver, &rb,
ctx->cancel_func, ctx->cancel_baton,
scratch_pool));
+
+ if (rb.iprops)
+ {
+ /* We didn't report for the root. Report iprops anyway */
+ SVN_ERR(call_receiver(path_or_url, NULL /* props */, rb.iprops,
+ receiver, receiver_baton, scratch_pool));
+ }
}
else if (svn_wc__changelist_match(ctx->wc_ctx, local_abspath,
changelist_hash, scratch_pool))
@@ -1464,7 +1491,7 @@ get_local_props(const char *path_or_url,
}
}
- SVN_ERR(call_receiver(path_or_url, props, NULL,
+ SVN_ERR(call_receiver(path_or_url, props, iprops,
receiver, receiver_baton, scratch_pool));
}
diff --git a/subversion/libsvn_client/update.c b/subversion/libsvn_client/update.c
index fe3f86d10638..0b006cc33fbe 100644
--- a/subversion/libsvn_client/update.c
+++ b/subversion/libsvn_client/update.c
@@ -383,7 +383,7 @@ update_internal(svn_revnum_t *result_rev,
SVN_ERR(svn_ra_get_repos_root2(ra_session, &new_repos_root_url, pool));
/* svn_client_relocate2() will check the uuid */
- SVN_ERR(svn_client_relocate2(anchor_abspath, anchor_url,
+ SVN_ERR(svn_client_relocate2(anchor_abspath, repos_root_url,
new_repos_root_url, ignore_externals,
ctx, pool));
diff --git a/subversion/libsvn_client/util.c b/subversion/libsvn_client/util.c
index 5ac0b8ffa11e..06855e7e70e0 100644
--- a/subversion/libsvn_client/util.c
+++ b/subversion/libsvn_client/util.c
@@ -166,6 +166,13 @@ svn_client_commit_item3_dup(const svn_client_commit_item3_t *item,
new_item->outgoing_prop_changes =
svn_prop_array_dup(new_item->outgoing_prop_changes, pool);
+ if (new_item->session_relpath)
+ new_item->session_relpath = apr_pstrdup(pool, new_item->session_relpath);
+
+ if (new_item->moved_from_abspath)
+ new_item->moved_from_abspath = apr_pstrdup(pool,
+ new_item->moved_from_abspath);
+
return new_item;
}
diff --git a/subversion/libsvn_fs_fs/fs_fs.c b/subversion/libsvn_fs_fs/fs_fs.c
index 101e417eb28f..372455d2d735 100644
--- a/subversion/libsvn_fs_fs/fs_fs.c
+++ b/subversion/libsvn_fs_fs/fs_fs.c
@@ -5380,11 +5380,13 @@ svn_fs_fs__get_file_delta_stream(svn_txdelta_stream_t **stream_p,
/* Read target's base rep if any. */
SVN_ERR(create_rep_state(&rep_state, &rep_args, NULL, NULL,
target->data_rep, fs, pool));
- /* If that matches source, then use this delta as is. */
+
+ /* If that matches source, then use this delta as is.
+ Note that we want an actual delta here. E.g. a self-delta would
+ not be good enough. */
if (rep_args->is_delta
- && (rep_args->is_delta_vs_empty
- || (rep_args->base_revision == source->data_rep->revision
- && rep_args->base_offset == source->data_rep->offset)))
+ && rep_args->base_revision == source->data_rep->revision
+ && rep_args->base_offset == source->data_rep->offset)
{
/* Create the delta read baton. */
struct delta_read_baton *drb = apr_pcalloc(pool, sizeof(*drb));
diff --git a/subversion/libsvn_fs_fs/rep-cache-db.h b/subversion/libsvn_fs_fs/rep-cache-db.h
index f74138f8032b..b02b052c5624 100644
--- a/subversion/libsvn_fs_fs/rep-cache-db.h
+++ b/subversion/libsvn_fs_fs/rep-cache-db.h
@@ -1,4 +1,4 @@
-/* This file is automatically generated from rep-cache-db.sql and .dist_sandbox/subversion-1.8.5/subversion/libsvn_fs_fs/token-map.h.
+/* This file is automatically generated from rep-cache-db.sql and .dist_sandbox/subversion-1.8.8/subversion/libsvn_fs_fs/token-map.h.
* Do not edit this file -- edit the source and rerun gen-make.py */
#define STMT_CREATE_SCHEMA 0
diff --git a/subversion/libsvn_fs_fs/rep-cache.c b/subversion/libsvn_fs_fs/rep-cache.c
index 3a9469036187..008226688f27 100644
--- a/subversion/libsvn_fs_fs/rep-cache.c
+++ b/subversion/libsvn_fs_fs/rep-cache.c
@@ -81,8 +81,33 @@ open_rep_cache(void *baton,
int version;
/* Open (or create) the sqlite database. It will be automatically
- closed when fs->pool is destoyed. */
+ closed when fs->pool is destoyed. */
db_path = path_rep_cache_db(fs->path, pool);
+#ifndef WIN32
+ {
+ /* We want to extend the permissions that apply to the repository
+ as a whole when creating a new rep cache and not simply default
+ to umask. */
+ svn_boolean_t exists;
+
+ SVN_ERR(svn_fs_fs__exists_rep_cache(&exists, fs, pool));
+ if (!exists)
+ {
+ const char *current = svn_fs_fs__path_current(fs, pool);
+ svn_error_t *err = svn_io_file_create(db_path, "", pool);
+
+ if (err && !APR_STATUS_IS_EEXIST(err->apr_err))
+ /* A real error. */
+ return svn_error_trace(err);
+ else if (err)
+ /* Some other thread/process created the file. */
+ svn_error_clear(err);
+ else
+ /* We created the file. */
+ SVN_ERR(svn_io_copy_perms(current, db_path, pool));
+ }
+ }
+#endif
SVN_ERR(svn_sqlite__open(&sdb, db_path,
svn_sqlite__mode_rwcreate, statements,
0, NULL,
diff --git a/subversion/libsvn_ra_serf/commit.c b/subversion/libsvn_ra_serf/commit.c
index 9682a65f2021..4950ac48911a 100644
--- a/subversion/libsvn_ra_serf/commit.c
+++ b/subversion/libsvn_ra_serf/commit.c
@@ -1638,7 +1638,7 @@ add_directory(const char *path,
dir->added = TRUE;
dir->base_revision = SVN_INVALID_REVNUM;
dir->copy_revision = copyfrom_revision;
- dir->copy_path = copyfrom_path;
+ dir->copy_path = apr_pstrdup(dir->pool, copyfrom_path);
dir->relpath = apr_pstrdup(dir->pool, path);
dir->name = svn_relpath_basename(dir->relpath, NULL);
dir->changed_props = apr_hash_make(dir->pool);
@@ -1880,7 +1880,7 @@ add_file(const char *path,
new_file->name = svn_relpath_basename(new_file->relpath, NULL);
new_file->added = TRUE;
new_file->base_revision = SVN_INVALID_REVNUM;
- new_file->copy_path = copy_path;
+ new_file->copy_path = apr_pstrdup(new_file->pool, copy_path);
new_file->copy_revision = copy_revision;
new_file->changed_props = apr_hash_make(new_file->pool);
new_file->removed_props = apr_hash_make(new_file->pool);
diff --git a/subversion/libsvn_ra_serf/util.c b/subversion/libsvn_ra_serf/util.c
index 55efca4b2f8a..60fa3c44af17 100644
--- a/subversion/libsvn_ra_serf/util.c
+++ b/subversion/libsvn_ra_serf/util.c
@@ -48,6 +48,7 @@
#include "private/svn_dep_compat.h"
#include "private/svn_fspath.h"
#include "private/svn_subr_private.h"
+#include "private/svn_auth_private.h"
#include "ra_serf.h"
@@ -269,26 +270,70 @@ ssl_server_cert(void *baton, int failures,
svn_auth_iterstate_t *state;
const char *realmstring;
apr_uint32_t svn_failures;
- apr_hash_t *issuer, *subject, *serf_cert;
- apr_array_header_t *san;
+ apr_hash_t *issuer;
+ apr_hash_t *subject = NULL;
+ apr_hash_t *serf_cert = NULL;
void *creds;
int found_matching_hostname = 0;
- /* Implicitly approve any non-server certs. */
- if (serf_ssl_cert_depth(cert) > 0)
- {
- if (failures)
- conn->server_cert_failures |= ssl_convert_serf_failures(failures);
- return APR_SUCCESS;
+ svn_failures = (ssl_convert_serf_failures(failures)
+ | conn->server_cert_failures);
+
+ if (serf_ssl_cert_depth(cert) == 0)
+ {
+ /* If the depth is 0, the hostname must match the certificate.
+
+ ### This should really be handled by serf, which should pass an error
+ for this case, but that has backwards compatibility issues. */
+ apr_array_header_t *san;
+
+ serf_cert = serf_ssl_cert_certificate(cert, scratch_pool);
+
+ san = svn_hash_gets(serf_cert, "subjectAltName");
+ /* Try to find matching server name via subjectAltName first... */
+ if (san) {
+ int i;
+ for (i = 0; i < san->nelts; i++) {
+ const char *s = APR_ARRAY_IDX(san, i, const char*);
+ if (apr_fnmatch(s, conn->session->session_url.hostname,
+ APR_FNM_PERIOD | APR_FNM_CASE_BLIND) == APR_SUCCESS)
+ {
+ found_matching_hostname = 1;
+ break;
+ }
+ }
+ }
+
+ /* Match server certificate CN with the hostname of the server */
+ if (!found_matching_hostname)
+ {
+ const char *hostname = NULL;
+
+ subject = serf_ssl_cert_subject(cert, scratch_pool);
+
+ if (subject)
+ hostname = svn_hash_gets(subject, "CN");
+
+ if (!hostname
+ || apr_fnmatch(hostname, conn->session->session_url.hostname,
+ APR_FNM_PERIOD | APR_FNM_CASE_BLIND) != APR_SUCCESS)
+ {
+ svn_failures |= SVN_AUTH_SSL_CNMISMATCH;
+ }
+ }
}
+ if (!svn_failures)
+ return SVN_NO_ERROR;
+
/* Extract the info from the certificate */
- subject = serf_ssl_cert_subject(cert, scratch_pool);
+ if (! subject)
+ subject = serf_ssl_cert_subject(cert, scratch_pool);
issuer = serf_ssl_cert_issuer(cert, scratch_pool);
- serf_cert = serf_ssl_cert_certificate(cert, scratch_pool);
+ if (! serf_cert)
+ serf_cert = serf_ssl_cert_certificate(cert, scratch_pool);
cert_info.hostname = svn_hash_gets(subject, "CN");
- san = svn_hash_gets(serf_cert, "subjectAltName");
cert_info.fingerprint = svn_hash_gets(serf_cert, "sha1");
if (! cert_info.fingerprint)
cert_info.fingerprint = apr_pstrdup(scratch_pool, "<unknown>");
@@ -301,32 +346,56 @@ ssl_server_cert(void *baton, int failures,
cert_info.issuer_dname = convert_organisation_to_str(issuer, scratch_pool);
cert_info.ascii_cert = serf_ssl_cert_export(cert, scratch_pool);
- svn_failures = (ssl_convert_serf_failures(failures)
- | conn->server_cert_failures);
+ /* Handle any non-server certs. */
+ if (serf_ssl_cert_depth(cert) > 0)
+ {
+ svn_error_t *err;
- /* Try to find matching server name via subjectAltName first... */
- if (san) {
- int i;
- for (i = 0; i < san->nelts; i++) {
- char *s = APR_ARRAY_IDX(san, i, char*);
- if (apr_fnmatch(s, conn->session->session_url.hostname,
- APR_FNM_PERIOD | APR_FNM_CASE_BLIND) == APR_SUCCESS)
- {
- found_matching_hostname = 1;
- cert_info.hostname = s;
- break;
- }
- }
- }
+ svn_auth_set_parameter(conn->session->wc_callbacks->auth_baton,
+ SVN_AUTH_PARAM_SSL_SERVER_CERT_INFO,
+ &cert_info);
- /* Match server certificate CN with the hostname of the server */
- if (!found_matching_hostname && cert_info.hostname)
- {
- if (apr_fnmatch(cert_info.hostname, conn->session->session_url.hostname,
- APR_FNM_PERIOD | APR_FNM_CASE_BLIND) == APR_FNM_NOMATCH)
+ svn_auth_set_parameter(conn->session->wc_callbacks->auth_baton,
+ SVN_AUTH_PARAM_SSL_SERVER_FAILURES,
+ &svn_failures);
+
+ realmstring = apr_psprintf(scratch_pool, "AUTHORITY:%s",
+ cert_info.fingerprint);
+
+ err = svn_auth_first_credentials(&creds, &state,
+ SVN_AUTH_CRED_SSL_SERVER_AUTHORITY,
+ realmstring,
+ conn->session->wc_callbacks->auth_baton,
+ scratch_pool);
+
+ svn_auth_set_parameter(conn->session->wc_callbacks->auth_baton,
+ SVN_AUTH_PARAM_SSL_SERVER_CERT_INFO, NULL);
+
+ svn_auth_set_parameter(conn->session->wc_callbacks->auth_baton,
+ SVN_AUTH_PARAM_SSL_SERVER_FAILURES, NULL);
+
+ if (err)
{
- svn_failures |= SVN_AUTH_SSL_CNMISMATCH;
+ if (err->apr_err != SVN_ERR_AUTHN_NO_PROVIDER)
+ return svn_error_trace(err);
+
+ /* No provider registered that handles server authorities */
+ svn_error_clear(err);
+ creds = NULL;
}
+
+ if (creds)
+ {
+ server_creds = creds;
+ SVN_ERR(svn_auth_save_credentials(state, scratch_pool));
+
+ svn_failures &= ~server_creds->accepted_failures;
+ }
+
+ if (svn_failures)
+ conn->server_cert_failures |= svn_failures;
+
+ return APR_SUCCESS;
}
svn_auth_set_parameter(conn->session->wc_callbacks->auth_baton,
@@ -347,13 +416,27 @@ ssl_server_cert(void *baton, int failures,
if (creds)
{
server_creds = creds;
+ svn_failures &= ~server_creds->accepted_failures;
SVN_ERR(svn_auth_save_credentials(state, scratch_pool));
}
+ while (svn_failures && creds)
+ {
+ SVN_ERR(svn_auth_next_credentials(&creds, state, scratch_pool));
+
+ if (creds)
+ {
+ server_creds = creds;
+ svn_failures &= ~server_creds->accepted_failures;
+ SVN_ERR(svn_auth_save_credentials(state, scratch_pool));
+ }
+ }
+
svn_auth_set_parameter(conn->session->wc_callbacks->auth_baton,
SVN_AUTH_PARAM_SSL_SERVER_CERT_INFO, NULL);
- if (!server_creds)
+ /* Are there non accepted failures left? */
+ if (svn_failures)
{
svn_stringbuf_t *errmsg;
int reasons = 0;
diff --git a/subversion/libsvn_repos/commit.c b/subversion/libsvn_repos/commit.c
index c4606ab4b7bd..77fe84647173 100644
--- a/subversion/libsvn_repos/commit.c
+++ b/subversion/libsvn_repos/commit.c
@@ -761,6 +761,13 @@ close_edit(void *edit_baton,
if (SVN_IS_VALID_REVNUM(new_revision))
{
+ /* The actual commit succeeded, i.e. the transaction does no longer
+ exist and we can't use txn_root for conflict resolution etc.
+
+ Since close_edit is supposed to release resources, do it now. */
+ if (eb->txn_root)
+ svn_fs_close_root(eb->txn_root);
+
if (err)
{
/* If the error was in post-commit, then the commit itself
@@ -821,6 +828,10 @@ abort_edit(void *edit_baton,
eb->txn_aborted = TRUE;
+ /* Since abort_edit is supposed to release resources, do it now. */
+ if (eb->txn_root)
+ svn_fs_close_root(eb->txn_root);
+
return svn_error_trace(svn_fs_abort_txn(eb->txn, pool));
}
diff --git a/subversion/libsvn_repos/reporter.c b/subversion/libsvn_repos/reporter.c
index a9d1eff5fa38..de46858790fe 100644
--- a/subversion/libsvn_repos/reporter.c
+++ b/subversion/libsvn_repos/reporter.c
@@ -1143,7 +1143,8 @@ delta_dirs(report_baton_t *b, svn_revnum_t s_rev, const char *s_path,
svn_fs_root_t *s_root;
apr_hash_t *s_entries = NULL, *t_entries;
apr_hash_index_t *hi;
- apr_pool_t *subpool;
+ apr_pool_t *subpool = svn_pool_create(pool);
+ apr_pool_t *iterpool;
const char *name, *s_fullpath, *t_fullpath, *e_fullpath;
path_info_t *info;
@@ -1152,7 +1153,8 @@ delta_dirs(report_baton_t *b, svn_revnum_t s_rev, const char *s_path,
When we support directory locks, we must pass the lock token here. */
SVN_ERR(delta_proplists(b, s_rev, start_empty ? NULL : s_path, t_path,
- NULL, change_dir_prop, dir_baton, pool));
+ NULL, change_dir_prop, dir_baton, subpool));
+ svn_pool_clear(subpool);
if (requested_depth > svn_depth_empty
|| requested_depth == svn_depth_unknown)
@@ -1161,19 +1163,19 @@ delta_dirs(report_baton_t *b, svn_revnum_t s_rev, const char *s_path,
if (s_path && !start_empty)
{
SVN_ERR(get_source_root(b, &s_root, s_rev));
- SVN_ERR(svn_fs_dir_entries(&s_entries, s_root, s_path, pool));
+ SVN_ERR(svn_fs_dir_entries(&s_entries, s_root, s_path, subpool));
}
- SVN_ERR(svn_fs_dir_entries(&t_entries, b->t_root, t_path, pool));
+ SVN_ERR(svn_fs_dir_entries(&t_entries, b->t_root, t_path, subpool));
/* Iterate over the report information for this directory. */
- subpool = svn_pool_create(pool);
+ iterpool = svn_pool_create(pool);
while (1)
{
const svn_fs_dirent_t *s_entry, *t_entry;
- svn_pool_clear(subpool);
- SVN_ERR(fetch_path_info(b, &name, &info, e_path, subpool));
+ svn_pool_clear(iterpool);
+ SVN_ERR(fetch_path_info(b, &name, &info, e_path, iterpool));
if (!name)
break;
@@ -1193,10 +1195,10 @@ delta_dirs(report_baton_t *b, svn_revnum_t s_rev, const char *s_path,
continue;
}
- e_fullpath = svn_relpath_join(e_path, name, subpool);
- t_fullpath = svn_fspath__join(t_path, name, subpool);
+ e_fullpath = svn_relpath_join(e_path, name, iterpool);
+ t_fullpath = svn_fspath__join(t_path, name, iterpool);
t_entry = svn_hash_gets(t_entries, name);
- s_fullpath = s_path ? svn_fspath__join(s_path, name, subpool) : NULL;
+ s_fullpath = s_path ? svn_fspath__join(s_path, name, iterpool) : NULL;
s_entry = s_entries ?
svn_hash_gets(s_entries, name) : NULL;
@@ -1216,7 +1218,7 @@ delta_dirs(report_baton_t *b, svn_revnum_t s_rev, const char *s_path,
t_entry, dir_baton, e_fullpath, info,
info ? info->depth
: DEPTH_BELOW_HERE(wc_depth),
- DEPTH_BELOW_HERE(requested_depth), subpool));
+ DEPTH_BELOW_HERE(requested_depth), iterpool));
/* Don't revisit this name in the target or source entries. */
svn_hash_sets(t_entries, name, NULL);
@@ -1236,13 +1238,13 @@ delta_dirs(report_baton_t *b, svn_revnum_t s_rev, const char *s_path,
target, for graceful handling of case-only renames. */
if (s_entries)
{
- for (hi = apr_hash_first(pool, s_entries);
+ for (hi = apr_hash_first(subpool, s_entries);
hi;
hi = apr_hash_next(hi))
{
const svn_fs_dirent_t *s_entry;
- svn_pool_clear(subpool);
+ svn_pool_clear(iterpool);
s_entry = svn__apr_hash_index_val(hi);
if (svn_hash_gets(t_entries, s_entry->name) == NULL)
@@ -1259,27 +1261,29 @@ delta_dirs(report_baton_t *b, svn_revnum_t s_rev, const char *s_path,
continue;
/* There is no corresponding target entry, so delete. */
- e_fullpath = svn_relpath_join(e_path, s_entry->name, subpool);
+ e_fullpath = svn_relpath_join(e_path, s_entry->name, iterpool);
SVN_ERR(svn_repos_deleted_rev(svn_fs_root_fs(b->t_root),
svn_fspath__join(t_path,
s_entry->name,
- subpool),
+ iterpool),
s_rev, b->t_rev,
- &deleted_rev, subpool));
+ &deleted_rev, iterpool));
SVN_ERR(b->editor->delete_entry(e_fullpath,
deleted_rev,
- dir_baton, subpool));
+ dir_baton, iterpool));
}
}
}
/* Loop over the dirents in the target. */
- for (hi = apr_hash_first(pool, t_entries); hi; hi = apr_hash_next(hi))
+ for (hi = apr_hash_first(subpool, t_entries);
+ hi;
+ hi = apr_hash_next(hi))
{
const svn_fs_dirent_t *s_entry, *t_entry;
- svn_pool_clear(subpool);
+ svn_pool_clear(iterpool);
t_entry = svn__apr_hash_index_val(hi);
if (is_depth_upgrade(wc_depth, requested_depth, t_entry->kind))
@@ -1307,24 +1311,27 @@ delta_dirs(report_baton_t *b, svn_revnum_t s_rev, const char *s_path,
svn_hash_gets(s_entries, t_entry->name)
: NULL;
s_fullpath = s_entry ?
- svn_fspath__join(s_path, t_entry->name, subpool) : NULL;
+ svn_fspath__join(s_path, t_entry->name, iterpool) : NULL;
}
/* Compose the report, editor, and target paths for this entry. */
- e_fullpath = svn_relpath_join(e_path, t_entry->name, subpool);
- t_fullpath = svn_fspath__join(t_path, t_entry->name, subpool);
+ e_fullpath = svn_relpath_join(e_path, t_entry->name, iterpool);
+ t_fullpath = svn_fspath__join(t_path, t_entry->name, iterpool);
SVN_ERR(update_entry(b, s_rev, s_fullpath, s_entry, t_fullpath,
t_entry, dir_baton, e_fullpath, NULL,
DEPTH_BELOW_HERE(wc_depth),
DEPTH_BELOW_HERE(requested_depth),
- subpool));
+ iterpool));
}
/* Destroy iteration subpool. */
- svn_pool_destroy(subpool);
+ svn_pool_destroy(iterpool);
}
+
+ svn_pool_destroy(subpool);
+
return SVN_NO_ERROR;
}
diff --git a/subversion/libsvn_subr/auth.c b/subversion/libsvn_subr/auth.c
index 9dc4c776336a..3c874cf88505 100644
--- a/subversion/libsvn_subr/auth.c
+++ b/subversion/libsvn_subr/auth.c
@@ -35,6 +35,7 @@
#include "svn_private_config.h"
#include "svn_dso.h"
#include "svn_version.h"
+#include "private/svn_auth_private.h"
#include "private/svn_dep_compat.h"
#include "private/svn_subr_private.h"
@@ -540,6 +541,11 @@ svn_auth_get_platform_specific_provider(svn_auth_provider_object_t **provider,
{
svn_auth_get_windows_ssl_server_trust_provider(provider, pool);
}
+ else if (strcmp(provider_name, "windows") == 0 &&
+ strcmp(provider_type, "ssl_server_authority") == 0)
+ {
+ svn_auth__get_windows_ssl_server_authority_provider(provider, pool);
+ }
#endif
}
diff --git a/subversion/libsvn_subr/cache-membuffer.c b/subversion/libsvn_subr/cache-membuffer.c
index 5f447b3fa9bd..131d914502c9 100644
--- a/subversion/libsvn_subr/cache-membuffer.c
+++ b/subversion/libsvn_subr/cache-membuffer.c
@@ -422,7 +422,7 @@ struct svn_membuffer_t
*/
apr_uint64_t current_data;
- /* Total number of data buffer bytes in use. This is for statistics only.
+ /* Total number of data buffer bytes in use.
*/
apr_uint64_t data_used;
@@ -1374,7 +1374,11 @@ membuffer_cache_set_internal(svn_membuffer_t *cache,
* the old spot, just re-use that space. */
if (entry && ALIGN_VALUE(entry->size) >= size && buffer)
{
- cache->data_used += size - entry->size;
+ /* Careful! We need to cast SIZE to the full width of CACHE->DATA_USED
+ * lest we run into trouble with 32 bit underflow *not* treated as a
+ * negative value.
+ */
+ cache->data_used += (apr_uint64_t)size - entry->size;
entry->size = size;
#ifdef SVN_DEBUG_CACHE_MEMBUFFER
diff --git a/subversion/libsvn_subr/cmdline.c b/subversion/libsvn_subr/cmdline.c
index f52fa29833ec..89d1ff3a3a1c 100644
--- a/subversion/libsvn_subr/cmdline.c
+++ b/subversion/libsvn_subr/cmdline.c
@@ -505,7 +505,7 @@ svn_cmdline_create_auth_baton(svn_auth_baton_t **ab,
svn_auth_get_username_provider(&provider, pool);
APR_ARRAY_PUSH(providers, svn_auth_provider_object_t *) = provider;
- /* The server-cert, client-cert, and client-cert-password providers. */
+ /* The windows ssl server certificate CRYPTOAPI provider. */
SVN_ERR(svn_auth_get_platform_specific_provider(&provider,
"windows",
"ssl_server_trust",
@@ -514,6 +514,15 @@ svn_cmdline_create_auth_baton(svn_auth_baton_t **ab,
if (provider)
APR_ARRAY_PUSH(providers, svn_auth_provider_object_t *) = provider;
+ /* The windows ssl authority certificate CRYPTOAPI provider. */
+ SVN_ERR(svn_auth_get_platform_specific_provider(&provider,
+ "windows",
+ "ssl_server_authority",
+ pool));
+
+ if (provider)
+ APR_ARRAY_PUSH(providers, svn_auth_provider_object_t *) = provider;
+
svn_auth_get_ssl_server_trust_file_provider(&provider, pool);
APR_ARRAY_PUSH(providers, svn_auth_provider_object_t *) = provider;
svn_auth_get_ssl_client_cert_file_provider(&provider, pool);
diff --git a/subversion/libsvn_subr/internal_statements.h b/subversion/libsvn_subr/internal_statements.h
index 82a85befebd2..84c616f38bee 100644
--- a/subversion/libsvn_subr/internal_statements.h
+++ b/subversion/libsvn_subr/internal_statements.h
@@ -1,4 +1,4 @@
-/* This file is automatically generated from internal_statements.sql and .dist_sandbox/subversion-1.8.5/subversion/libsvn_subr/token-map.h.
+/* This file is automatically generated from internal_statements.sql and .dist_sandbox/subversion-1.8.8/subversion/libsvn_subr/token-map.h.
* Do not edit this file -- edit the source and rerun gen-make.py */
#define STMT_INTERNAL_SAVEPOINT_SVN 0
diff --git a/subversion/libsvn_subr/io.c b/subversion/libsvn_subr/io.c
index 385ae37dbe80..f0956e2aa8e9 100644
--- a/subversion/libsvn_subr/io.c
+++ b/subversion/libsvn_subr/io.c
@@ -1533,14 +1533,9 @@ io_set_file_perms(const char *path,
{
if (enable_write) /* Make read-write. */
{
- apr_file_t *fd;
-
- /* Get the perms for the original file so we'll have any other bits
- * that were already set (like the execute bits, for example). */
- SVN_ERR(svn_io_file_open(&fd, path, APR_READ,
- APR_OS_DEFAULT, pool));
- SVN_ERR(merge_default_file_perms(fd, &perms_to_set, pool));
- SVN_ERR(svn_io_file_close(fd, pool));
+ /* Tweak the owner bits only. The group/other bits aren't safe to
+ * touch because we may end up setting them in undesired ways. */
+ perms_to_set |= (APR_UREAD|APR_UWRITE);
}
else
{
@@ -4289,7 +4284,7 @@ contents_three_identical_p(svn_boolean_t *identical_p12,
/* As long as a file is not at the end yet, and it is still
* potentially identical to another file, we read the next chunk.*/
- if (!eof1 && (identical_p12 || identical_p13))
+ if (!eof1 && (*identical_p12 || *identical_p13))
{
err = svn_io_file_read_full2(file1_h, buf1,
SVN__STREAM_CHUNK_SIZE, &bytes_read1,
@@ -4299,7 +4294,7 @@ contents_three_identical_p(svn_boolean_t *identical_p12,
read_1 = TRUE;
}
- if (!eof2 && (identical_p12 || identical_p23))
+ if (!eof2 && (*identical_p12 || *identical_p23))
{
err = svn_io_file_read_full2(file2_h, buf2,
SVN__STREAM_CHUNK_SIZE, &bytes_read2,
@@ -4309,7 +4304,7 @@ contents_three_identical_p(svn_boolean_t *identical_p12,
read_2 = TRUE;
}
- if (!eof3 && (identical_p13 || identical_p23))
+ if (!eof3 && (*identical_p13 || *identical_p23))
{
err = svn_io_file_read_full2(file3_h, buf3,
SVN__STREAM_CHUNK_SIZE, &bytes_read3,
diff --git a/subversion/libsvn_subr/sqlite.c b/subversion/libsvn_subr/sqlite.c
index 149b0253be92..295a11c764a7 100644
--- a/subversion/libsvn_subr/sqlite.c
+++ b/subversion/libsvn_subr/sqlite.c
@@ -778,6 +778,21 @@ internal_open(sqlite3 **db3, const char *path, svn_sqlite__mode_t mode,
somebody initialized SQLite before us it is needed anyway. */
flags |= SQLITE_OPEN_NOMUTEX;
+#if !defined(WIN32) && !defined(SVN_SQLITE_INLINE)
+ if (mode == svn_sqlite__mode_rwcreate)
+ {
+ svn_node_kind_t kind;
+
+ /* Create the file before SQLite to avoid any permissions
+ problems with an SQLite build that uses the default
+ SQLITE_DEFAULT_FILE_PERMISSIONS of 644 modified by umask.
+ We simply want umask permissions. */
+ SVN_ERR(svn_io_check_path(path, &kind, scratch_pool));
+ if (kind == svn_node_none)
+ SVN_ERR(svn_io_file_create(path, "", scratch_pool));
+ }
+#endif
+
/* Open the database. Note that a handle is returned, even when an error
occurs (except for out-of-memory); thus, we can safely use it to
extract an error message and construct an svn_error_t. */
@@ -887,6 +902,18 @@ svn_sqlite__open(svn_sqlite__db_t **db, const char *path,
SVN_ERR(internal_open(&(*db)->db3, path, mode, scratch_pool));
+#if SQLITE_VERSION_NUMBER >= 3008000 && SQLITE_VERSION_NUMBER < 3009000
+ /* disable SQLITE_ENABLE_STAT3/4 from 3.8.1 - 3.8.3 (but not 3.8.3.1+)
+ * to prevent using it when it's buggy.
+ * See: https://www.sqlite.org/src/info/4c86b126f2 */
+ if (sqlite3_libversion_number() > 3008000 &&
+ sqlite3_libversion_number() < 3008004 &&
+ strcmp(sqlite3_sourceid(),"2014-02-11")<0)
+ {
+ sqlite3_test_control(SQLITE_TESTCTRL_OPTIMIZATIONS, (*db)->db3, 0x800);
+ }
+#endif
+
#ifdef SQLITE3_DEBUG
sqlite3_trace((*db)->db3, sqlite_tracer, (*db)->db3);
#endif
@@ -918,7 +945,13 @@ svn_sqlite__open(svn_sqlite__db_t **db, const char *path,
/* Enable recursive triggers so that a user trigger will fire
in the deletion phase of an INSERT OR REPLACE statement.
Requires SQLite >= 3.6.18 */
- "PRAGMA recursive_triggers=ON;"));
+ "PRAGMA recursive_triggers=ON;"
+ /* Enforce current Sqlite default behavior. Some distributions
+ might change the Sqlite defaults without realizing how this
+ affects application(read: Subversion) performance/behavior. */
+ "PRAGMA foreign_keys=OFF;" /* SQLITE_DEFAULT_FOREIGN_KEYS*/
+ "PRAGMA locking_mode = NORMAL;" /* SQLITE_DEFAULT_LOCKING_MODE */
+ ));
#if defined(SVN_DEBUG)
/* When running in debug mode, enable the checking of foreign key
@@ -927,6 +960,14 @@ svn_sqlite__open(svn_sqlite__db_t **db, const char *path,
SVN_ERR(exec_sql(*db, "PRAGMA foreign_keys=ON;"));
#endif
+#ifdef SVN_SQLITE_REVERSE_UNORDERED_SELECTS
+ /* When enabled, this PRAGMA causes SELECT statements without an ORDER BY
+ clause to emit their results in the reverse order of what they normally
+ would. This can help detecting invalid assumptions about the result
+ order.*/
+ SVN_ERR(exec_sql(*db, "PRAGMA reverse_unordered_selects=ON;"));
+#endif
+
/* Store temporary tables in RAM instead of in temporary files, but don't
fail on this if this option is disabled in the sqlite compilation by
setting SQLITE_TEMP_STORE to 0 (always to disk) */
diff --git a/subversion/libsvn_subr/sqlite3wrapper.c b/subversion/libsvn_subr/sqlite3wrapper.c
index d1941aa88185..c35642b72d49 100644
--- a/subversion/libsvn_subr/sqlite3wrapper.c
+++ b/subversion/libsvn_subr/sqlite3wrapper.c
@@ -50,6 +50,7 @@
# undef inline
# endif
# endif
+# define SQLITE_DEFAULT_FILE_PERMISSIONS 0666
# include <sqlite3.c>
# if __GNUC__ > 4 || (__GNUC__ == 4 && (__GNUC_MINOR__ >= 6))
# pragma GCC diagnostic pop
diff --git a/subversion/libsvn_subr/subst.c b/subversion/libsvn_subr/subst.c
index 3545289baf81..223b269a7107 100644
--- a/subversion/libsvn_subr/subst.c
+++ b/subversion/libsvn_subr/subst.c
@@ -1702,9 +1702,19 @@ create_special_file_from_stream(svn_stream_t *source, const char *dst,
### this only writes the first line!
*/
if (create_using_internal_representation)
- SVN_ERR(svn_io_write_unique(&dst_tmp, svn_dirent_dirname(dst, pool),
- contents->data, contents->len,
- svn_io_file_del_none, pool));
+ {
+ apr_file_t *new_file;
+ SVN_ERR(svn_io_open_unique_file3(&new_file, &dst_tmp,
+ svn_dirent_dirname(dst, pool),
+ svn_io_file_del_none,
+ pool, pool));
+
+ SVN_ERR(svn_io_file_write_full(new_file,
+ contents->data, contents->len, NULL,
+ pool));
+
+ SVN_ERR(svn_io_file_close(new_file, pool));
+ }
/* Do the atomic rename from our temporary location. */
return svn_io_file_rename(dst_tmp, dst, pool);
diff --git a/subversion/libsvn_subr/sysinfo.c b/subversion/libsvn_subr/sysinfo.c
index 7c37822d10a3..a506310aa906 100644
--- a/subversion/libsvn_subr/sysinfo.c
+++ b/subversion/libsvn_subr/sysinfo.c
@@ -290,11 +290,21 @@ stringbuf_split_key(svn_stringbuf_t *buffer, char delim)
return NULL;
svn_stringbuf_strip_whitespace(buffer);
+
+ /* Now we split the currently allocated buffer in two parts:
+ - a const char * HEAD
+ - the remaining stringbuf_t. */
+
+ /* Create HEAD as '\0' terminated const char * */
key = buffer->data;
end = strchr(key, delim);
*end = '\0';
- buffer->len = 1 + end - key;
+
+ /* And update the TAIL to be a smaller, but still valid stringbuf */
buffer->data = end + 1;
+ buffer->len -= 1 + end - key;
+ buffer->blocksize -= 1 + end - key;
+
svn_stringbuf_strip_whitespace(buffer);
return key;
diff --git a/subversion/libsvn_subr/win32_crypto.c b/subversion/libsvn_subr/win32_crypto.c
index a7e3828c90e2..e16866a68d52 100644
--- a/subversion/libsvn_subr/win32_crypto.c
+++ b/subversion/libsvn_subr/win32_crypto.c
@@ -436,8 +436,9 @@ windows_ssl_server_trust_first_credentials(void **credentials,
const char *realmstring,
apr_pool_t *pool)
{
- apr_uint32_t *failures = svn_hash_gets(parameters,
- SVN_AUTH_PARAM_SSL_SERVER_FAILURES);
+ apr_uint32_t *failure_ptr = svn_hash_gets(parameters,
+ SVN_AUTH_PARAM_SSL_SERVER_FAILURES);
+ apr_uint32_t failures = *failure_ptr;
const svn_auth_ssl_server_cert_info_t *cert_info =
svn_hash_gets(parameters, SVN_AUTH_PARAM_SSL_SERVER_CERT_INFO);
@@ -445,7 +446,7 @@ windows_ssl_server_trust_first_credentials(void **credentials,
*iter_baton = NULL;
/* We can accept only unknown certificate authority. */
- if (*failures & SVN_AUTH_SSL_UNKNOWNCA)
+ if (failures & SVN_AUTH_SSL_UNKNOWNCA)
{
svn_boolean_t ok;
@@ -455,15 +456,16 @@ windows_ssl_server_trust_first_credentials(void **credentials,
if (ok)
{
/* Clear failure flag. */
- *failures &= ~SVN_AUTH_SSL_UNKNOWNCA;
+ failures &= ~SVN_AUTH_SSL_UNKNOWNCA;
}
}
/* If all failures are cleared now, we return the creds */
- if (! *failures)
+ if (! failures)
{
svn_auth_cred_ssl_server_trust_t *creds =
apr_pcalloc(pool, sizeof(*creds));
+ creds->accepted_failures = *failure_ptr & ~failures;
creds->may_save = FALSE; /* No need to save it. */
*credentials = creds;
}
@@ -489,4 +491,24 @@ svn_auth_get_windows_ssl_server_trust_provider
*provider = po;
}
+static const svn_auth_provider_t windows_server_authority_provider = {
+ SVN_AUTH_CRED_SSL_SERVER_AUTHORITY,
+ windows_ssl_server_trust_first_credentials,
+ NULL,
+ NULL,
+};
+
+/* Public API */
+void
+svn_auth__get_windows_ssl_server_authority_provider(
+ svn_auth_provider_object_t **provider,
+ apr_pool_t *pool)
+{
+ svn_auth_provider_object_t *po = apr_pcalloc(pool, sizeof(*po));
+
+ po->vtable = &windows_server_authority_provider;
+ *provider = po;
+}
+
+
#endif /* WIN32 */
diff --git a/subversion/libsvn_wc/conflicts.h b/subversion/libsvn_wc/conflicts.h
index d4730653189b..839e8a0d4eb0 100644
--- a/subversion/libsvn_wc/conflicts.h
+++ b/subversion/libsvn_wc/conflicts.h
@@ -401,14 +401,18 @@ svn_wc__conflict_create_markers(svn_skel_t **work_item,
apr_pool_t *result_pool,
apr_pool_t *scratch_pool);
-/* Call the interactive conflict resolver RESOLVER_FUNC with RESOLVER_BATON to
- allow resolving the conflicts on LOCAL_ABSPATH.
+/* Call the conflict resolver RESOLVER_FUNC with RESOLVER_BATON for each
+ of the conflicts on LOCAL_ABSPATH. Depending on the results that
+ the callback returns, perhaps resolve the conflicts, and perhaps mark
+ them as resolved in the WC DB.
Call RESOLVER_FUNC once for each property conflict, and again for any
text conflict, and again for any tree conflict on the node.
CONFLICT_SKEL contains the details of the conflicts on LOCAL_ABSPATH.
+ Use MERGE_OPTIONS when the resolver requests a merge.
+
Resolver actions are directly applied to the in-db state of LOCAL_ABSPATH,
so the conflict and the state in CONFLICT_SKEL must already be installed in
wc.db. */
diff --git a/subversion/libsvn_wc/diff_local.c b/subversion/libsvn_wc/diff_local.c
index 0bd4a45cd44e..04d4c480b751 100644
--- a/subversion/libsvn_wc/diff_local.c
+++ b/subversion/libsvn_wc/diff_local.c
@@ -116,13 +116,20 @@ ensure_state(struct diff_baton *eb,
apr_pool_t *ns_pool;
if (!eb->cur)
{
- if (!svn_dirent_is_ancestor(eb->anchor_abspath, local_abspath))
+ const char *relpath;
+
+ relpath = svn_dirent_skip_ancestor(eb->anchor_abspath, local_abspath);
+ if (! relpath)
return SVN_NO_ERROR;
- SVN_ERR(ensure_state(eb,
- svn_dirent_dirname(local_abspath,scratch_pool),
- FALSE,
- scratch_pool));
+ /* Don't recurse on the anchor, as that might loop infinately because
+ svn_dirent_dirname("/",...) -> "/"
+ svn_dirent_dirname("C:/",...) -> "C:/" (Windows) */
+ if (*relpath)
+ SVN_ERR(ensure_state(eb,
+ svn_dirent_dirname(local_abspath,scratch_pool),
+ FALSE,
+ scratch_pool));
}
else if (svn_dirent_is_child(eb->cur->local_abspath, local_abspath, NULL))
SVN_ERR(ensure_state(eb, svn_dirent_dirname(local_abspath,scratch_pool),
diff --git a/subversion/libsvn_wc/upgrade.c b/subversion/libsvn_wc/upgrade.c
index ff5543c47b6b..af615fd61ba2 100644
--- a/subversion/libsvn_wc/upgrade.c
+++ b/subversion/libsvn_wc/upgrade.c
@@ -1958,6 +1958,10 @@ svn_wc__upgrade_sdb(int *result_format,
case SVN_WC__VERSION:
/* already upgraded */
*result_format = SVN_WC__VERSION;
+
+ SVN_SQLITE__WITH_LOCK(
+ svn_wc__db_install_schema_statistics(sdb, scratch_pool),
+ sdb);
}
#ifdef SVN_DEBUG
diff --git a/subversion/libsvn_wc/wc-checks.h b/subversion/libsvn_wc/wc-checks.h
index 3d87a03b74f7..14d7ef3a7552 100644
--- a/subversion/libsvn_wc/wc-checks.h
+++ b/subversion/libsvn_wc/wc-checks.h
@@ -1,4 +1,4 @@
-/* This file is automatically generated from wc-checks.sql and .dist_sandbox/subversion-1.8.5/subversion/libsvn_wc/token-map.h.
+/* This file is automatically generated from wc-checks.sql and .dist_sandbox/subversion-1.8.8/subversion/libsvn_wc/token-map.h.
* Do not edit this file -- edit the source and rerun gen-make.py */
#define STMT_VERIFICATION_TRIGGERS 0
diff --git a/subversion/libsvn_wc/wc-metadata.h b/subversion/libsvn_wc/wc-metadata.h
index 2e3182de64ee..0ab17d4537d6 100644
--- a/subversion/libsvn_wc/wc-metadata.h
+++ b/subversion/libsvn_wc/wc-metadata.h
@@ -1,4 +1,4 @@
-/* This file is automatically generated from wc-metadata.sql and .dist_sandbox/subversion-1.8.5/subversion/libsvn_wc/token-map.h.
+/* This file is automatically generated from wc-metadata.sql and .dist_sandbox/subversion-1.8.8/subversion/libsvn_wc/token-map.h.
* Do not edit this file -- edit the source and rerun gen-make.py */
#define STMT_CREATE_SCHEMA 0
@@ -159,9 +159,30 @@
" local_relpath); " \
""
-#define STMT_UPGRADE_TO_20 4
-#define STMT_4_INFO {"STMT_UPGRADE_TO_20", NULL}
+#define STMT_INSTALL_SCHEMA_STATISTICS 4
+#define STMT_4_INFO {"STMT_INSTALL_SCHEMA_STATISTICS", NULL}
#define STMT_4 \
+ "ANALYZE sqlite_master; " \
+ "INSERT OR REPLACE INTO sqlite_stat1(tbl, idx, stat) VALUES " \
+ " ('NODES', 'sqlite_autoindex_NODES_1', '8000 8000 2 1'); " \
+ "INSERT OR REPLACE INTO sqlite_stat1(tbl, idx, stat) VALUES " \
+ " ('NODES', 'I_NODES_PARENT', '8000 8000 10 2 1'); " \
+ "INSERT OR REPLACE INTO sqlite_stat1(tbl, idx, stat) VALUES " \
+ " ('NODES', 'I_NODES_MOVED', '8000 8000 1 1'); " \
+ "INSERT OR REPLACE INTO sqlite_stat1(tbl, idx, stat) VALUES " \
+ " ('ACTUAL_NODE', 'sqlite_autoindex_ACTUAL_NODE_1', '8000 8000 1'); " \
+ "INSERT OR REPLACE INTO sqlite_stat1(tbl, idx, stat) VALUES " \
+ " ('ACTUAL_NODE', 'I_ACTUAL_PARENT', '8000 8000 10 1'); " \
+ "INSERT OR REPLACE INTO sqlite_stat1(tbl, idx, stat) VALUES " \
+ " ('LOCK', 'sqlite_autoindex_LOCK_1', '100 100 1'); " \
+ "INSERT OR REPLACE INTO sqlite_stat1(tbl, idx, stat) VALUES " \
+ " ('WC_LOCK', 'sqlite_autoindex_WC_LOCK_1', '100 100 1'); " \
+ "ANALYZE sqlite_master; " \
+ ""
+
+#define STMT_UPGRADE_TO_20 5
+#define STMT_5_INFO {"STMT_UPGRADE_TO_20", NULL}
+#define STMT_5 \
"UPDATE BASE_NODE SET checksum = (SELECT checksum FROM pristine " \
" WHERE md5_checksum = BASE_NODE.checksum) " \
"WHERE EXISTS (SELECT 1 FROM pristine WHERE md5_checksum = BASE_NODE.checksum); " \
@@ -202,59 +223,59 @@
"PRAGMA user_version = 20; " \
""
-#define STMT_UPGRADE_TO_21 5
-#define STMT_5_INFO {"STMT_UPGRADE_TO_21", NULL}
-#define STMT_5 \
+#define STMT_UPGRADE_TO_21 6
+#define STMT_6_INFO {"STMT_UPGRADE_TO_21", NULL}
+#define STMT_6 \
"PRAGMA user_version = 21; " \
""
-#define STMT_UPGRADE_21_SELECT_OLD_TREE_CONFLICT 6
-#define STMT_6_INFO {"STMT_UPGRADE_21_SELECT_OLD_TREE_CONFLICT", NULL}
-#define STMT_6 \
+#define STMT_UPGRADE_21_SELECT_OLD_TREE_CONFLICT 7
+#define STMT_7_INFO {"STMT_UPGRADE_21_SELECT_OLD_TREE_CONFLICT", NULL}
+#define STMT_7 \
"SELECT wc_id, local_relpath, tree_conflict_data " \
"FROM actual_node " \
"WHERE tree_conflict_data IS NOT NULL " \
""
-#define STMT_UPGRADE_21_ERASE_OLD_CONFLICTS 7
-#define STMT_7_INFO {"STMT_UPGRADE_21_ERASE_OLD_CONFLICTS", NULL}
-#define STMT_7 \
+#define STMT_UPGRADE_21_ERASE_OLD_CONFLICTS 8
+#define STMT_8_INFO {"STMT_UPGRADE_21_ERASE_OLD_CONFLICTS", NULL}
+#define STMT_8 \
"UPDATE actual_node SET tree_conflict_data = NULL " \
""
-#define STMT_UPGRADE_TO_22 8
-#define STMT_8_INFO {"STMT_UPGRADE_TO_22", NULL}
-#define STMT_8 \
+#define STMT_UPGRADE_TO_22 9
+#define STMT_9_INFO {"STMT_UPGRADE_TO_22", NULL}
+#define STMT_9 \
"UPDATE actual_node SET tree_conflict_data = conflict_data; " \
"UPDATE actual_node SET conflict_data = NULL; " \
"PRAGMA user_version = 22; " \
""
-#define STMT_UPGRADE_TO_23 9
-#define STMT_9_INFO {"STMT_UPGRADE_TO_23", NULL}
-#define STMT_9 \
+#define STMT_UPGRADE_TO_23 10
+#define STMT_10_INFO {"STMT_UPGRADE_TO_23", NULL}
+#define STMT_10 \
"PRAGMA user_version = 23; " \
""
-#define STMT_UPGRADE_23_HAS_WORKING_NODES 10
-#define STMT_10_INFO {"STMT_UPGRADE_23_HAS_WORKING_NODES", NULL}
-#define STMT_10 \
+#define STMT_UPGRADE_23_HAS_WORKING_NODES 11
+#define STMT_11_INFO {"STMT_UPGRADE_23_HAS_WORKING_NODES", NULL}
+#define STMT_11 \
"SELECT 1 FROM nodes WHERE op_depth > 0 " \
"LIMIT 1 " \
""
-#define STMT_UPGRADE_TO_24 11
-#define STMT_11_INFO {"STMT_UPGRADE_TO_24", NULL}
-#define STMT_11 \
+#define STMT_UPGRADE_TO_24 12
+#define STMT_12_INFO {"STMT_UPGRADE_TO_24", NULL}
+#define STMT_12 \
"UPDATE pristine SET refcount = " \
" (SELECT COUNT(*) FROM nodes " \
" WHERE checksum = pristine.checksum ); " \
"PRAGMA user_version = 24; " \
""
-#define STMT_UPGRADE_TO_25 12
-#define STMT_12_INFO {"STMT_UPGRADE_TO_25", NULL}
-#define STMT_12 \
+#define STMT_UPGRADE_TO_25 13
+#define STMT_13_INFO {"STMT_UPGRADE_TO_25", NULL}
+#define STMT_13 \
"DROP VIEW IF EXISTS NODES_CURRENT; " \
"CREATE VIEW NODES_CURRENT AS " \
" SELECT * FROM nodes " \
@@ -266,9 +287,9 @@
"PRAGMA user_version = 25; " \
""
-#define STMT_UPGRADE_TO_26 13
-#define STMT_13_INFO {"STMT_UPGRADE_TO_26", NULL}
-#define STMT_13 \
+#define STMT_UPGRADE_TO_26 14
+#define STMT_14_INFO {"STMT_UPGRADE_TO_26", NULL}
+#define STMT_14 \
"DROP VIEW IF EXISTS NODES_BASE; " \
"CREATE VIEW NODES_BASE AS " \
" SELECT * FROM nodes " \
@@ -276,15 +297,15 @@
"PRAGMA user_version = 26; " \
""
-#define STMT_UPGRADE_TO_27 14
-#define STMT_14_INFO {"STMT_UPGRADE_TO_27", NULL}
-#define STMT_14 \
+#define STMT_UPGRADE_TO_27 15
+#define STMT_15_INFO {"STMT_UPGRADE_TO_27", NULL}
+#define STMT_15 \
"PRAGMA user_version = 27; " \
""
-#define STMT_UPGRADE_27_HAS_ACTUAL_NODES_CONFLICTS 15
-#define STMT_15_INFO {"STMT_UPGRADE_27_HAS_ACTUAL_NODES_CONFLICTS", NULL}
-#define STMT_15 \
+#define STMT_UPGRADE_27_HAS_ACTUAL_NODES_CONFLICTS 16
+#define STMT_16_INFO {"STMT_UPGRADE_27_HAS_ACTUAL_NODES_CONFLICTS", NULL}
+#define STMT_16 \
"SELECT 1 FROM actual_node " \
"WHERE NOT ((prop_reject IS NULL) AND (conflict_old IS NULL) " \
" AND (conflict_new IS NULL) AND (conflict_working IS NULL) " \
@@ -292,18 +313,18 @@
"LIMIT 1 " \
""
-#define STMT_UPGRADE_TO_28 16
-#define STMT_16_INFO {"STMT_UPGRADE_TO_28", NULL}
-#define STMT_16 \
+#define STMT_UPGRADE_TO_28 17
+#define STMT_17_INFO {"STMT_UPGRADE_TO_28", NULL}
+#define STMT_17 \
"UPDATE NODES SET checksum = (SELECT checksum FROM pristine " \
" WHERE md5_checksum = nodes.checksum) " \
"WHERE EXISTS (SELECT 1 FROM pristine WHERE md5_checksum = nodes.checksum); " \
"PRAGMA user_version = 28; " \
""
-#define STMT_UPGRADE_TO_29 17
-#define STMT_17_INFO {"STMT_UPGRADE_TO_29", NULL}
-#define STMT_17 \
+#define STMT_UPGRADE_TO_29 18
+#define STMT_18_INFO {"STMT_UPGRADE_TO_29", NULL}
+#define STMT_18 \
"DROP TRIGGER IF EXISTS nodes_update_checksum_trigger; " \
"DROP TRIGGER IF EXISTS nodes_insert_trigger; " \
"DROP TRIGGER IF EXISTS nodes_delete_trigger; " \
@@ -333,9 +354,9 @@
"PRAGMA user_version = 29; " \
""
-#define STMT_UPGRADE_TO_30 18
-#define STMT_18_INFO {"STMT_UPGRADE_TO_30", NULL}
-#define STMT_18 \
+#define STMT_UPGRADE_TO_30 19
+#define STMT_19_INFO {"STMT_UPGRADE_TO_30", NULL}
+#define STMT_19 \
"CREATE UNIQUE INDEX IF NOT EXISTS I_NODES_MOVED " \
"ON NODES (wc_id, moved_to, op_depth); " \
"CREATE INDEX IF NOT EXISTS I_PRISTINE_MD5 ON PRISTINE (md5_checksum); " \
@@ -343,9 +364,9 @@
"UPDATE nodes SET file_external=1 WHERE file_external IS NOT NULL; " \
""
-#define STMT_UPGRADE_30_SELECT_CONFLICT_SEPARATE 19
-#define STMT_19_INFO {"STMT_UPGRADE_30_SELECT_CONFLICT_SEPARATE", NULL}
-#define STMT_19 \
+#define STMT_UPGRADE_30_SELECT_CONFLICT_SEPARATE 20
+#define STMT_20_INFO {"STMT_UPGRADE_30_SELECT_CONFLICT_SEPARATE", NULL}
+#define STMT_20 \
"SELECT wc_id, local_relpath, " \
" conflict_old, conflict_working, conflict_new, prop_reject, tree_conflict_data " \
"FROM actual_node " \
@@ -357,24 +378,24 @@
"ORDER by wc_id, local_relpath " \
""
-#define STMT_UPGRADE_30_SET_CONFLICT 20
-#define STMT_20_INFO {"STMT_UPGRADE_30_SET_CONFLICT", NULL}
-#define STMT_20 \
+#define STMT_UPGRADE_30_SET_CONFLICT 21
+#define STMT_21_INFO {"STMT_UPGRADE_30_SET_CONFLICT", NULL}
+#define STMT_21 \
"UPDATE actual_node SET conflict_data = ?3, conflict_old = NULL, " \
" conflict_working = NULL, conflict_new = NULL, prop_reject = NULL, " \
" tree_conflict_data = NULL " \
"WHERE wc_id = ?1 and local_relpath = ?2 " \
""
-#define STMT_UPGRADE_TO_31_ALTER_TABLE 21
-#define STMT_21_INFO {"STMT_UPGRADE_TO_31_ALTER_TABLE", NULL}
-#define STMT_21 \
+#define STMT_UPGRADE_TO_31_ALTER_TABLE 22
+#define STMT_22_INFO {"STMT_UPGRADE_TO_31_ALTER_TABLE", NULL}
+#define STMT_22 \
"ALTER TABLE NODES ADD COLUMN inherited_props BLOB; " \
""
-#define STMT_UPGRADE_TO_31_FINALIZE 22
-#define STMT_22_INFO {"STMT_UPGRADE_TO_31_FINALIZE", NULL}
-#define STMT_22 \
+#define STMT_UPGRADE_TO_31_FINALIZE 23
+#define STMT_23_INFO {"STMT_UPGRADE_TO_31_FINALIZE", NULL}
+#define STMT_23 \
"DROP INDEX IF EXISTS I_ACTUAL_CHANGELIST; " \
"DROP INDEX IF EXISTS I_EXTERNALS_PARENT; " \
"DROP INDEX I_NODES_PARENT; " \
@@ -386,9 +407,9 @@
"PRAGMA user_version = 31; " \
""
-#define STMT_UPGRADE_31_SELECT_WCROOT_NODES 23
-#define STMT_23_INFO {"STMT_UPGRADE_31_SELECT_WCROOT_NODES", NULL}
-#define STMT_23 \
+#define STMT_UPGRADE_31_SELECT_WCROOT_NODES 24
+#define STMT_24_INFO {"STMT_UPGRADE_31_SELECT_WCROOT_NODES", NULL}
+#define STMT_24 \
"SELECT l.wc_id, l.local_relpath FROM nodes as l " \
"LEFT OUTER JOIN nodes as r " \
"ON l.wc_id = r.wc_id " \
@@ -400,9 +421,9 @@
" OR (l.repos_path IS NOT (CASE WHEN (r.local_relpath) = '' THEN (CASE WHEN (r.repos_path) = '' THEN (l.local_relpath) WHEN (l.local_relpath) = '' THEN (r.repos_path) ELSE (r.repos_path) || '/' || (l.local_relpath) END) WHEN (r.repos_path) = '' THEN (CASE WHEN (r.local_relpath) = '' THEN (l.local_relpath) WHEN SUBSTR((l.local_relpath), 1, LENGTH(r.local_relpath)) = (r.local_relpath) THEN CASE WHEN LENGTH(r.local_relpath) = LENGTH(l.local_relpath) THEN '' WHEN SUBSTR((l.local_relpath), LENGTH(r.local_relpath)+1, 1) = '/' THEN SUBSTR((l.local_relpath), LENGTH(r.local_relpath)+2) END END) WHEN SUBSTR((l.local_relpath), 1, LENGTH(r.local_relpath)) = (r.local_relpath) THEN CASE WHEN LENGTH(r.local_relpath) = LENGTH(l.local_relpath) THEN (r.repos_path) WHEN SUBSTR((l.local_relpath), LENGTH(r.local_relpath)+1, 1) = '/' THEN (r.repos_path) || SUBSTR((l.local_relpath), LENGTH(r.local_relpath)+1) END END))) " \
""
-#define STMT_UPGRADE_TO_32 24
-#define STMT_24_INFO {"STMT_UPGRADE_TO_32", NULL}
-#define STMT_24 \
+#define STMT_UPGRADE_TO_32 25
+#define STMT_25_INFO {"STMT_UPGRADE_TO_32", NULL}
+#define STMT_25 \
"DROP INDEX IF EXISTS I_ACTUAL_CHANGELIST; " \
"DROP INDEX IF EXISTS I_EXTERNALS_PARENT; " \
"CREATE INDEX I_EXTERNALS_PARENT ON EXTERNALS (wc_id, parent_relpath); " \
@@ -482,6 +503,7 @@
STMT_22, \
STMT_23, \
STMT_24, \
+ STMT_25, \
NULL \
}
@@ -512,5 +534,6 @@
STMT_22_INFO, \
STMT_23_INFO, \
STMT_24_INFO, \
+ STMT_25_INFO, \
{NULL, NULL} \
}
diff --git a/subversion/libsvn_wc/wc-metadata.sql b/subversion/libsvn_wc/wc-metadata.sql
index d2a61613ac62..848293d2cebb 100644
--- a/subversion/libsvn_wc/wc-metadata.sql
+++ b/subversion/libsvn_wc/wc-metadata.sql
@@ -573,6 +573,54 @@ CREATE UNIQUE INDEX I_EXTERNALS_DEFINED ON EXTERNALS (wc_id,
local_relpath);
/* ------------------------------------------------------------------------- */
+/* This statement provides SQLite with the necessary information about our
+ indexes to make better decisions in the query planner.
+
+ For every interesting index this contains a number of rows where the
+ statistics ar calculated for and then for every column in the index the
+ average number of rows with the same value in all columns left of this
+ column including the column itself.
+
+ See http://www.sqlite.org/fileformat2.html#stat1tab for more details.
+
+ The important thing here is that this tells Sqlite that the wc_id column
+ of the NODES and ACTUAL_NODE table is usually a single value, so queries
+ should use more than one column for index usage.
+
+ The current hints describe NODES+ACTUAL_NODE as a working copy with
+ 8000 nodes in 1 a single working copy(=wc_id), 10 nodes per directory
+ and an average of 2 op-depth layers per node.
+
+ The number of integers must be number of index columns + 1, which is
+ verified via the test_schema_statistics() test.
+ */
+-- STMT_INSTALL_SCHEMA_STATISTICS
+ANALYZE sqlite_master; /* Creates empty sqlite_stat1 if necessary */
+
+INSERT OR REPLACE INTO sqlite_stat1(tbl, idx, stat) VALUES
+ ('NODES', 'sqlite_autoindex_NODES_1', '8000 8000 2 1');
+INSERT OR REPLACE INTO sqlite_stat1(tbl, idx, stat) VALUES
+ ('NODES', 'I_NODES_PARENT', '8000 8000 10 2 1');
+/* Tell a lie: We ignore that 99.9% of all moved_to values are NULL */
+INSERT OR REPLACE INTO sqlite_stat1(tbl, idx, stat) VALUES
+ ('NODES', 'I_NODES_MOVED', '8000 8000 1 1');
+
+INSERT OR REPLACE INTO sqlite_stat1(tbl, idx, stat) VALUES
+ ('ACTUAL_NODE', 'sqlite_autoindex_ACTUAL_NODE_1', '8000 8000 1');
+INSERT OR REPLACE INTO sqlite_stat1(tbl, idx, stat) VALUES
+ ('ACTUAL_NODE', 'I_ACTUAL_PARENT', '8000 8000 10 1');
+
+INSERT OR REPLACE INTO sqlite_stat1(tbl, idx, stat) VALUES
+ ('LOCK', 'sqlite_autoindex_LOCK_1', '100 100 1');
+
+INSERT OR REPLACE INTO sqlite_stat1(tbl, idx, stat) VALUES
+ ('WC_LOCK', 'sqlite_autoindex_WC_LOCK_1', '100 100 1');
+
+/* sqlite_autoindex_WORK_QUEUE_1 doesn't exist because WORK_QUEUE is
+ a INTEGER PRIMARY KEY AUTOINCREMENT table */
+
+ANALYZE sqlite_master; /* Loads sqlite_stat1 data for query optimizer */
+/* ------------------------------------------------------------------------- */
/* Format 20 introduces NODES and removes BASE_NODE and WORKING_NODE */
diff --git a/subversion/libsvn_wc/wc-queries.h b/subversion/libsvn_wc/wc-queries.h
index edcf81e3bc76..0246ee50b99c 100644
--- a/subversion/libsvn_wc/wc-queries.h
+++ b/subversion/libsvn_wc/wc-queries.h
@@ -1,4 +1,4 @@
-/* This file is automatically generated from wc-queries.sql and .dist_sandbox/subversion-1.8.5/subversion/libsvn_wc/token-map.h.
+/* This file is automatically generated from wc-queries.sql and .dist_sandbox/subversion-1.8.8/subversion/libsvn_wc/token-map.h.
* Do not edit this file -- edit the source and rerun gen-make.py */
#define STMT_SELECT_NODE_INFO 0
@@ -1991,10 +1991,15 @@
#define STMT_190_INFO {"STMT_SELECT_MOVED_PAIR3", NULL}
#define STMT_190 \
"SELECT local_relpath, moved_to, op_depth, kind FROM nodes " \
+ "WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth > ?3 " \
+ " AND moved_to IS NOT NULL " \
+ "UNION ALL " \
+ "SELECT local_relpath, moved_to, op_depth, kind FROM nodes " \
"WHERE wc_id = ?1 " \
- " AND (local_relpath = ?2 OR (((local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END))) " \
+ " AND (((local_relpath) > (CASE (?2) WHEN '' THEN '' ELSE (?2) || '/' END)) AND ((local_relpath) < CASE (?2) WHEN '' THEN X'FFFF' ELSE (?2) || '0' END)) " \
" AND op_depth > ?3 " \
" AND moved_to IS NOT NULL " \
+ "ORDER BY local_relpath, op_depth " \
""
#define STMT_SELECT_MOVED_OUTSIDE 191
@@ -2299,9 +2304,30 @@
" local_relpath); " \
""
-#define STMT_UPGRADE_TO_20 209
-#define STMT_209_INFO {"STMT_UPGRADE_TO_20", NULL}
+#define STMT_INSTALL_SCHEMA_STATISTICS 209
+#define STMT_209_INFO {"STMT_INSTALL_SCHEMA_STATISTICS", NULL}
#define STMT_209 \
+ "ANALYZE sqlite_master; " \
+ "INSERT OR REPLACE INTO sqlite_stat1(tbl, idx, stat) VALUES " \
+ " ('NODES', 'sqlite_autoindex_NODES_1', '8000 8000 2 1'); " \
+ "INSERT OR REPLACE INTO sqlite_stat1(tbl, idx, stat) VALUES " \
+ " ('NODES', 'I_NODES_PARENT', '8000 8000 10 2 1'); " \
+ "INSERT OR REPLACE INTO sqlite_stat1(tbl, idx, stat) VALUES " \
+ " ('NODES', 'I_NODES_MOVED', '8000 8000 1 1'); " \
+ "INSERT OR REPLACE INTO sqlite_stat1(tbl, idx, stat) VALUES " \
+ " ('ACTUAL_NODE', 'sqlite_autoindex_ACTUAL_NODE_1', '8000 8000 1'); " \
+ "INSERT OR REPLACE INTO sqlite_stat1(tbl, idx, stat) VALUES " \
+ " ('ACTUAL_NODE', 'I_ACTUAL_PARENT', '8000 8000 10 1'); " \
+ "INSERT OR REPLACE INTO sqlite_stat1(tbl, idx, stat) VALUES " \
+ " ('LOCK', 'sqlite_autoindex_LOCK_1', '100 100 1'); " \
+ "INSERT OR REPLACE INTO sqlite_stat1(tbl, idx, stat) VALUES " \
+ " ('WC_LOCK', 'sqlite_autoindex_WC_LOCK_1', '100 100 1'); " \
+ "ANALYZE sqlite_master; " \
+ ""
+
+#define STMT_UPGRADE_TO_20 210
+#define STMT_210_INFO {"STMT_UPGRADE_TO_20", NULL}
+#define STMT_210 \
"UPDATE BASE_NODE SET checksum = (SELECT checksum FROM pristine " \
" WHERE md5_checksum = BASE_NODE.checksum) " \
"WHERE EXISTS (SELECT 1 FROM pristine WHERE md5_checksum = BASE_NODE.checksum); " \
@@ -2342,59 +2368,59 @@
"PRAGMA user_version = 20; " \
""
-#define STMT_UPGRADE_TO_21 210
-#define STMT_210_INFO {"STMT_UPGRADE_TO_21", NULL}
-#define STMT_210 \
+#define STMT_UPGRADE_TO_21 211
+#define STMT_211_INFO {"STMT_UPGRADE_TO_21", NULL}
+#define STMT_211 \
"PRAGMA user_version = 21; " \
""
-#define STMT_UPGRADE_21_SELECT_OLD_TREE_CONFLICT 211
-#define STMT_211_INFO {"STMT_UPGRADE_21_SELECT_OLD_TREE_CONFLICT", NULL}
-#define STMT_211 \
+#define STMT_UPGRADE_21_SELECT_OLD_TREE_CONFLICT 212
+#define STMT_212_INFO {"STMT_UPGRADE_21_SELECT_OLD_TREE_CONFLICT", NULL}
+#define STMT_212 \
"SELECT wc_id, local_relpath, tree_conflict_data " \
"FROM actual_node " \
"WHERE tree_conflict_data IS NOT NULL " \
""
-#define STMT_UPGRADE_21_ERASE_OLD_CONFLICTS 212
-#define STMT_212_INFO {"STMT_UPGRADE_21_ERASE_OLD_CONFLICTS", NULL}
-#define STMT_212 \
+#define STMT_UPGRADE_21_ERASE_OLD_CONFLICTS 213
+#define STMT_213_INFO {"STMT_UPGRADE_21_ERASE_OLD_CONFLICTS", NULL}
+#define STMT_213 \
"UPDATE actual_node SET tree_conflict_data = NULL " \
""
-#define STMT_UPGRADE_TO_22 213
-#define STMT_213_INFO {"STMT_UPGRADE_TO_22", NULL}
-#define STMT_213 \
+#define STMT_UPGRADE_TO_22 214
+#define STMT_214_INFO {"STMT_UPGRADE_TO_22", NULL}
+#define STMT_214 \
"UPDATE actual_node SET tree_conflict_data = conflict_data; " \
"UPDATE actual_node SET conflict_data = NULL; " \
"PRAGMA user_version = 22; " \
""
-#define STMT_UPGRADE_TO_23 214
-#define STMT_214_INFO {"STMT_UPGRADE_TO_23", NULL}
-#define STMT_214 \
+#define STMT_UPGRADE_TO_23 215
+#define STMT_215_INFO {"STMT_UPGRADE_TO_23", NULL}
+#define STMT_215 \
"PRAGMA user_version = 23; " \
""
-#define STMT_UPGRADE_23_HAS_WORKING_NODES 215
-#define STMT_215_INFO {"STMT_UPGRADE_23_HAS_WORKING_NODES", NULL}
-#define STMT_215 \
+#define STMT_UPGRADE_23_HAS_WORKING_NODES 216
+#define STMT_216_INFO {"STMT_UPGRADE_23_HAS_WORKING_NODES", NULL}
+#define STMT_216 \
"SELECT 1 FROM nodes WHERE op_depth > 0 " \
"LIMIT 1 " \
""
-#define STMT_UPGRADE_TO_24 216
-#define STMT_216_INFO {"STMT_UPGRADE_TO_24", NULL}
-#define STMT_216 \
+#define STMT_UPGRADE_TO_24 217
+#define STMT_217_INFO {"STMT_UPGRADE_TO_24", NULL}
+#define STMT_217 \
"UPDATE pristine SET refcount = " \
" (SELECT COUNT(*) FROM nodes " \
" WHERE checksum = pristine.checksum ); " \
"PRAGMA user_version = 24; " \
""
-#define STMT_UPGRADE_TO_25 217
-#define STMT_217_INFO {"STMT_UPGRADE_TO_25", NULL}
-#define STMT_217 \
+#define STMT_UPGRADE_TO_25 218
+#define STMT_218_INFO {"STMT_UPGRADE_TO_25", NULL}
+#define STMT_218 \
"DROP VIEW IF EXISTS NODES_CURRENT; " \
"CREATE VIEW NODES_CURRENT AS " \
" SELECT * FROM nodes " \
@@ -2406,9 +2432,9 @@
"PRAGMA user_version = 25; " \
""
-#define STMT_UPGRADE_TO_26 218
-#define STMT_218_INFO {"STMT_UPGRADE_TO_26", NULL}
-#define STMT_218 \
+#define STMT_UPGRADE_TO_26 219
+#define STMT_219_INFO {"STMT_UPGRADE_TO_26", NULL}
+#define STMT_219 \
"DROP VIEW IF EXISTS NODES_BASE; " \
"CREATE VIEW NODES_BASE AS " \
" SELECT * FROM nodes " \
@@ -2416,15 +2442,15 @@
"PRAGMA user_version = 26; " \
""
-#define STMT_UPGRADE_TO_27 219
-#define STMT_219_INFO {"STMT_UPGRADE_TO_27", NULL}
-#define STMT_219 \
+#define STMT_UPGRADE_TO_27 220
+#define STMT_220_INFO {"STMT_UPGRADE_TO_27", NULL}
+#define STMT_220 \
"PRAGMA user_version = 27; " \
""
-#define STMT_UPGRADE_27_HAS_ACTUAL_NODES_CONFLICTS 220
-#define STMT_220_INFO {"STMT_UPGRADE_27_HAS_ACTUAL_NODES_CONFLICTS", NULL}
-#define STMT_220 \
+#define STMT_UPGRADE_27_HAS_ACTUAL_NODES_CONFLICTS 221
+#define STMT_221_INFO {"STMT_UPGRADE_27_HAS_ACTUAL_NODES_CONFLICTS", NULL}
+#define STMT_221 \
"SELECT 1 FROM actual_node " \
"WHERE NOT ((prop_reject IS NULL) AND (conflict_old IS NULL) " \
" AND (conflict_new IS NULL) AND (conflict_working IS NULL) " \
@@ -2432,18 +2458,18 @@
"LIMIT 1 " \
""
-#define STMT_UPGRADE_TO_28 221
-#define STMT_221_INFO {"STMT_UPGRADE_TO_28", NULL}
-#define STMT_221 \
+#define STMT_UPGRADE_TO_28 222
+#define STMT_222_INFO {"STMT_UPGRADE_TO_28", NULL}
+#define STMT_222 \
"UPDATE NODES SET checksum = (SELECT checksum FROM pristine " \
" WHERE md5_checksum = nodes.checksum) " \
"WHERE EXISTS (SELECT 1 FROM pristine WHERE md5_checksum = nodes.checksum); " \
"PRAGMA user_version = 28; " \
""
-#define STMT_UPGRADE_TO_29 222
-#define STMT_222_INFO {"STMT_UPGRADE_TO_29", NULL}
-#define STMT_222 \
+#define STMT_UPGRADE_TO_29 223
+#define STMT_223_INFO {"STMT_UPGRADE_TO_29", NULL}
+#define STMT_223 \
"DROP TRIGGER IF EXISTS nodes_update_checksum_trigger; " \
"DROP TRIGGER IF EXISTS nodes_insert_trigger; " \
"DROP TRIGGER IF EXISTS nodes_delete_trigger; " \
@@ -2473,9 +2499,9 @@
"PRAGMA user_version = 29; " \
""
-#define STMT_UPGRADE_TO_30 223
-#define STMT_223_INFO {"STMT_UPGRADE_TO_30", NULL}
-#define STMT_223 \
+#define STMT_UPGRADE_TO_30 224
+#define STMT_224_INFO {"STMT_UPGRADE_TO_30", NULL}
+#define STMT_224 \
"CREATE UNIQUE INDEX IF NOT EXISTS I_NODES_MOVED " \
"ON NODES (wc_id, moved_to, op_depth); " \
"CREATE INDEX IF NOT EXISTS I_PRISTINE_MD5 ON PRISTINE (md5_checksum); " \
@@ -2483,9 +2509,9 @@
"UPDATE nodes SET file_external=1 WHERE file_external IS NOT NULL; " \
""
-#define STMT_UPGRADE_30_SELECT_CONFLICT_SEPARATE 224
-#define STMT_224_INFO {"STMT_UPGRADE_30_SELECT_CONFLICT_SEPARATE", NULL}
-#define STMT_224 \
+#define STMT_UPGRADE_30_SELECT_CONFLICT_SEPARATE 225
+#define STMT_225_INFO {"STMT_UPGRADE_30_SELECT_CONFLICT_SEPARATE", NULL}
+#define STMT_225 \
"SELECT wc_id, local_relpath, " \
" conflict_old, conflict_working, conflict_new, prop_reject, tree_conflict_data " \
"FROM actual_node " \
@@ -2497,24 +2523,24 @@
"ORDER by wc_id, local_relpath " \
""
-#define STMT_UPGRADE_30_SET_CONFLICT 225
-#define STMT_225_INFO {"STMT_UPGRADE_30_SET_CONFLICT", NULL}
-#define STMT_225 \
+#define STMT_UPGRADE_30_SET_CONFLICT 226
+#define STMT_226_INFO {"STMT_UPGRADE_30_SET_CONFLICT", NULL}
+#define STMT_226 \
"UPDATE actual_node SET conflict_data = ?3, conflict_old = NULL, " \
" conflict_working = NULL, conflict_new = NULL, prop_reject = NULL, " \
" tree_conflict_data = NULL " \
"WHERE wc_id = ?1 and local_relpath = ?2 " \
""
-#define STMT_UPGRADE_TO_31_ALTER_TABLE 226
-#define STMT_226_INFO {"STMT_UPGRADE_TO_31_ALTER_TABLE", NULL}
-#define STMT_226 \
+#define STMT_UPGRADE_TO_31_ALTER_TABLE 227
+#define STMT_227_INFO {"STMT_UPGRADE_TO_31_ALTER_TABLE", NULL}
+#define STMT_227 \
"ALTER TABLE NODES ADD COLUMN inherited_props BLOB; " \
""
-#define STMT_UPGRADE_TO_31_FINALIZE 227
-#define STMT_227_INFO {"STMT_UPGRADE_TO_31_FINALIZE", NULL}
-#define STMT_227 \
+#define STMT_UPGRADE_TO_31_FINALIZE 228
+#define STMT_228_INFO {"STMT_UPGRADE_TO_31_FINALIZE", NULL}
+#define STMT_228 \
"DROP INDEX IF EXISTS I_ACTUAL_CHANGELIST; " \
"DROP INDEX IF EXISTS I_EXTERNALS_PARENT; " \
"DROP INDEX I_NODES_PARENT; " \
@@ -2526,9 +2552,9 @@
"PRAGMA user_version = 31; " \
""
-#define STMT_UPGRADE_31_SELECT_WCROOT_NODES 228
-#define STMT_228_INFO {"STMT_UPGRADE_31_SELECT_WCROOT_NODES", NULL}
-#define STMT_228 \
+#define STMT_UPGRADE_31_SELECT_WCROOT_NODES 229
+#define STMT_229_INFO {"STMT_UPGRADE_31_SELECT_WCROOT_NODES", NULL}
+#define STMT_229 \
"SELECT l.wc_id, l.local_relpath FROM nodes as l " \
"LEFT OUTER JOIN nodes as r " \
"ON l.wc_id = r.wc_id " \
@@ -2540,9 +2566,9 @@
" OR (l.repos_path IS NOT (CASE WHEN (r.local_relpath) = '' THEN (CASE WHEN (r.repos_path) = '' THEN (l.local_relpath) WHEN (l.local_relpath) = '' THEN (r.repos_path) ELSE (r.repos_path) || '/' || (l.local_relpath) END) WHEN (r.repos_path) = '' THEN (CASE WHEN (r.local_relpath) = '' THEN (l.local_relpath) WHEN SUBSTR((l.local_relpath), 1, LENGTH(r.local_relpath)) = (r.local_relpath) THEN CASE WHEN LENGTH(r.local_relpath) = LENGTH(l.local_relpath) THEN '' WHEN SUBSTR((l.local_relpath), LENGTH(r.local_relpath)+1, 1) = '/' THEN SUBSTR((l.local_relpath), LENGTH(r.local_relpath)+2) END END) WHEN SUBSTR((l.local_relpath), 1, LENGTH(r.local_relpath)) = (r.local_relpath) THEN CASE WHEN LENGTH(r.local_relpath) = LENGTH(l.local_relpath) THEN (r.repos_path) WHEN SUBSTR((l.local_relpath), LENGTH(r.local_relpath)+1, 1) = '/' THEN (r.repos_path) || SUBSTR((l.local_relpath), LENGTH(r.local_relpath)+1) END END))) " \
""
-#define STMT_UPGRADE_TO_32 229
-#define STMT_229_INFO {"STMT_UPGRADE_TO_32", NULL}
-#define STMT_229 \
+#define STMT_UPGRADE_TO_32 230
+#define STMT_230_INFO {"STMT_UPGRADE_TO_32", NULL}
+#define STMT_230 \
"DROP INDEX IF EXISTS I_ACTUAL_CHANGELIST; " \
"DROP INDEX IF EXISTS I_EXTERNALS_PARENT; " \
"CREATE INDEX I_EXTERNALS_PARENT ON EXTERNALS (wc_id, parent_relpath); " \
@@ -2595,9 +2621,9 @@
"DROP TABLE ACTUAL_NODE_BACKUP; " \
""
-#define STMT_VERIFICATION_TRIGGERS 230
-#define STMT_230_INFO {"STMT_VERIFICATION_TRIGGERS", NULL}
-#define STMT_230 \
+#define STMT_VERIFICATION_TRIGGERS 231
+#define STMT_231_INFO {"STMT_VERIFICATION_TRIGGERS", NULL}
+#define STMT_231 \
"CREATE TEMPORARY TRIGGER no_repository_updates BEFORE UPDATE ON repository " \
"BEGIN " \
" SELECT RAISE(FAIL, 'Updates to REPOSITORY are not allowed.'); " \
@@ -2869,6 +2895,7 @@
STMT_228, \
STMT_229, \
STMT_230, \
+ STMT_231, \
NULL \
}
@@ -3105,5 +3132,6 @@
STMT_228_INFO, \
STMT_229_INFO, \
STMT_230_INFO, \
+ STMT_231_INFO, \
{NULL, NULL} \
}
diff --git a/subversion/libsvn_wc/wc-queries.sql b/subversion/libsvn_wc/wc-queries.sql
index d275a7bada0a..a8388a3a2892 100644
--- a/subversion/libsvn_wc/wc-queries.sql
+++ b/subversion/libsvn_wc/wc-queries.sql
@@ -1565,10 +1565,15 @@ WHERE wc_id = ?1
-- STMT_SELECT_MOVED_PAIR3
SELECT local_relpath, moved_to, op_depth, kind FROM nodes
+WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth > ?3
+ AND moved_to IS NOT NULL
+UNION ALL
+SELECT local_relpath, moved_to, op_depth, kind FROM nodes
WHERE wc_id = ?1
- AND (local_relpath = ?2 OR IS_STRICT_DESCENDANT_OF(local_relpath, ?2))
+ AND IS_STRICT_DESCENDANT_OF(local_relpath, ?2)
AND op_depth > ?3
AND moved_to IS NOT NULL
+ORDER BY local_relpath, op_depth
-- STMT_SELECT_MOVED_OUTSIDE
SELECT local_relpath, moved_to, op_depth FROM nodes
diff --git a/subversion/libsvn_wc/wc.h b/subversion/libsvn_wc/wc.h
index 9438e2b3b2e0..70c591ecb5be 100644
--- a/subversion/libsvn_wc/wc.h
+++ b/subversion/libsvn_wc/wc.h
@@ -157,6 +157,8 @@ extern "C" {
* The bump to 31 added the inherited_props column in the NODES table.
* Bumped in r1395109.
*
+ * == 1.8.x shipped with format 31
+ *
* Please document any further format changes here.
*/
diff --git a/subversion/libsvn_wc/wc_db.c b/subversion/libsvn_wc/wc_db.c
index 8b024c2f18eb..7d038cf57fb3 100644
--- a/subversion/libsvn_wc/wc_db.c
+++ b/subversion/libsvn_wc/wc_db.c
@@ -1390,6 +1390,15 @@ does_node_exist(svn_boolean_t *exists,
return svn_error_trace(svn_sqlite__reset(stmt));
}
+svn_error_t *
+svn_wc__db_install_schema_statistics(svn_sqlite__db_t *sdb,
+ apr_pool_t *scratch_pool)
+{
+ SVN_ERR(svn_sqlite__exec_statements(sdb, STMT_INSTALL_SCHEMA_STATISTICS));
+
+ return SVN_NO_ERROR;
+}
+
/* Helper for create_db(). Initializes our wc.db schema.
*/
static svn_error_t *
@@ -1417,6 +1426,8 @@ init_db(/* output values */
SVN_ERR(create_repos_id(repos_id, repos_root_url, repos_uuid,
db, scratch_pool));
+ SVN_ERR(svn_wc__db_install_schema_statistics(db, scratch_pool));
+
/* Insert the wcroot. */
/* ### Right now, this just assumes wc metadata is being stored locally. */
SVN_ERR(svn_sqlite__get_statement(&stmt, db, STMT_INSERT_WCROOT));
@@ -4551,6 +4562,21 @@ db_op_copy(svn_wc__db_wcroot_t *src_wcroot,
}
else
{
+ if (copyfrom_relpath)
+ {
+ const char *repos_root_url;
+ const char *repos_uuid;
+
+ /* Pass the right repos-id for the destination db! */
+
+ SVN_ERR(svn_wc__db_fetch_repos_info(&repos_root_url, &repos_uuid,
+ src_wcroot->sdb, copyfrom_id,
+ scratch_pool));
+
+ SVN_ERR(create_repos_id(&copyfrom_id, repos_root_url, repos_uuid,
+ dst_wcroot->sdb, scratch_pool));
+ }
+
SVN_ERR(cross_db_copy(src_wcroot, src_relpath, dst_wcroot,
dst_relpath, dst_presence, dst_op_depth,
dst_np_op_depth, kind,
diff --git a/subversion/libsvn_wc/wc_db.h b/subversion/libsvn_wc/wc_db.h
index 61906e3cb64f..a4ed3f976d60 100644
--- a/subversion/libsvn_wc/wc_db.h
+++ b/subversion/libsvn_wc/wc_db.h
@@ -2831,6 +2831,16 @@ svn_wc__db_scan_deletion(const char **base_del_abspath,
@{
*/
+/* Installs or updates Sqlite schema statistics for the current (aka latest)
+ working copy schema.
+
+ This function should be called once on initializing the database and after
+ an schema update completes */
+svn_error_t *
+svn_wc__db_install_schema_statistics(svn_sqlite__db_t *sdb,
+ apr_pool_t *scratch_pool);
+
+
/* Create a new wc.db file for LOCAL_DIR_ABSPATH, which is going to be a
working copy for the repository REPOS_ROOT_URL with uuid REPOS_UUID.
Return the raw sqlite handle, repository id and working copy id
diff --git a/subversion/libsvn_wc/wc_db_util.c b/subversion/libsvn_wc/wc_db_util.c
index 39dd034c5455..a6616e4706a8 100644
--- a/subversion/libsvn_wc/wc_db_util.c
+++ b/subversion/libsvn_wc/wc_db_util.c
@@ -136,22 +136,6 @@ svn_wc__db_util_open_db(svn_sqlite__db_t **sdb,
svn_dirent_local_style(sdb_abspath,
scratch_pool));
}
-#ifndef WIN32
- else
- {
- apr_file_t *f;
-
- /* A standard SQLite build creates a DB with mode 644 ^ !umask
- which means the file doesn't have group/world write access
- even when umask allows it. By ensuring the file exists before
- SQLite gets involved we give it the permissions allowed by
- umask. */
- SVN_ERR(svn_io_file_open(&f, sdb_abspath,
- (APR_READ | APR_WRITE | APR_CREATE),
- APR_OS_DEFAULT, scratch_pool));
- SVN_ERR(svn_io_file_close(f, scratch_pool));
- }
-#endif
SVN_ERR(svn_sqlite__open(sdb, sdb_abspath, smode,
my_statements ? my_statements : statements,
diff --git a/subversion/svn/conflict-callbacks.c b/subversion/svn/conflict-callbacks.c
index d5a98ddf6fbb..3d41ecf93670 100644
--- a/subversion/svn/conflict-callbacks.c
+++ b/subversion/svn/conflict-callbacks.c
@@ -489,10 +489,10 @@ static const resolver_option_t text_conflict_options[] =
/* Resolver options for a property conflict */
static const resolver_option_t prop_conflict_options[] =
{
- { "mf", N_("my version"), N_("accept my version of entire file (even "
+ { "mf", N_("my version"), N_("accept my version of entire property (even "
"non-conflicts) [mine-full]"),
svn_wc_conflict_choose_mine_full },
- { "tf", N_("their version"), N_("accept their version of entire file "
+ { "tf", N_("their version"), N_("accept their version of entire property "
"(same) [theirs-full]"),
svn_wc_conflict_choose_theirs_full },
{ "dc", N_("display conflict"), N_("show conflicts in this property"), -1 },
diff --git a/subversion/svn/status-cmd.c b/subversion/svn/status-cmd.c
index 12edd8e42a4e..9840cd2bd5eb 100644
--- a/subversion/svn/status-cmd.c
+++ b/subversion/svn/status-cmd.c
@@ -358,7 +358,8 @@ svn_cl__status(apr_getopt_t *os,
NULL, opt_state->quiet,
/* not versioned: */
SVN_ERR_WC_NOT_WORKING_COPY,
- SVN_ERR_WC_PATH_NOT_FOUND));
+ SVN_ERR_WC_PATH_NOT_FOUND,
+ SVN_NO_ERROR));
if (opt_state->xml)
SVN_ERR(print_finish_target_xml(repos_rev, iterpool));
diff --git a/subversion/svn/svn.c b/subversion/svn/svn.c
index 7ed7ed22041a..52760dd1eb24 100644
--- a/subversion/svn/svn.c
+++ b/subversion/svn/svn.c
@@ -2939,6 +2939,10 @@ sub_main(int argc, const char *argv[], apr_pool_t *pool)
"Subversion"));
}
+ /* Ensure that stdout is flushed, so the user will see any write errors.
+ This makes sure that output is not silently lost. */
+ err = svn_error_compose_create(err, svn_cmdline_fflush(stdout));
+
return EXIT_ERROR(err);
}
else
diff --git a/subversion/svnserve/svnserve.c b/subversion/svnserve/svnserve.c
index b6fa90579503..3d83323efb4b 100644
--- a/subversion/svnserve/svnserve.c
+++ b/subversion/svnserve/svnserve.c
@@ -215,9 +215,7 @@ static const apr_getopt_option_t svnserve__options[] =
" "
"minimize redundant operations.\n"
" "
- "Default is 128 for threaded and 16 for non-\n"
- " "
- "threaded mode.\n"
+ "Default is 16.\n"
" "
"[used for FSFS repositories only]")},
{"cache-txdeltas", SVNSERVE_OPT_CACHE_TXDELTAS, 1,