You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by pr...@apache.org on 2013/07/09 10:48:47 UTC
svn commit: r1501136 [4/10] - in /subversion/branches/verify-keep-going: ./
build/ build/ac-macros/ build/generator/ subversion/bindings/javahl/native/
subversion/bindings/javahl/src/org/apache/subversion/javahl/
subversion/bindings/javahl/src/org/apac...
Modified: subversion/branches/verify-keep-going/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNTests.java
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNTests.java?rev=1501136&r1=1501135&r2=1501136&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNTests.java (original)
+++ subversion/branches/verify-keep-going/subversion/bindings/javahl/tests/org/apache/subversion/javahl/SVNTests.java Tue Jul 9 08:48:43 2013
@@ -324,12 +324,12 @@ class SVNTests extends TestCase
public boolean prompt(String realm, String username)
{
- return false;
+ return true;
}
public boolean prompt(String realm, String username, boolean maySave)
{
- return false;
+ return true;
}
public String askQuestion(String realm, String question,
Modified: subversion/branches/verify-keep-going/subversion/bindings/swig/perl/native/Client.pm
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/bindings/swig/perl/native/Client.pm?rev=1501136&r1=1501135&r2=1501136&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/bindings/swig/perl/native/Client.pm (original)
+++ subversion/branches/verify-keep-going/subversion/bindings/swig/perl/native/Client.pm Tue Jul 9 08:48:43 2013
@@ -138,7 +138,7 @@ keywords) 'HEAD', 'BASE', 'COMMITTED', a
meanings as in the command line client. When referencing a working copy
you can use the string 'WORKING" to reference the BASE plus any local
modifications. C<undef> may be used to specify an unspecified revision.
-You may alos pass a date by specifying the date inside curly braces
+You may also pass a date by specifying the date inside curly braces
'{}'. The date formats accepted are the same as the command line client
accepts. Finally a C<_p_svn_opt_revision_t> object is accepted
(which may have been returned by some Subversion function).
Modified: subversion/branches/verify-keep-going/subversion/include/private/svn_io_private.h
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/include/private/svn_io_private.h?rev=1501136&r1=1501135&r2=1501136&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/include/private/svn_io_private.h (original)
+++ subversion/branches/verify-keep-going/subversion/include/private/svn_io_private.h Tue Jul 9 08:48:43 2013
@@ -90,6 +90,11 @@ svn_stream__set_is_buffered(svn_stream_t
svn_boolean_t
svn_stream__is_buffered(svn_stream_t *stream);
+/** Return the underlying file, if any, associated with the stream, or
+ * NULL if not available. Accessing the file bypasses the stream.
+ */
+apr_file_t *
+svn_stream__aprfile(svn_stream_t *stream);
#ifdef __cplusplus
}
Modified: subversion/branches/verify-keep-going/subversion/include/private/svn_repos_private.h
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/include/private/svn_repos_private.h?rev=1501136&r1=1501135&r2=1501136&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/include/private/svn_repos_private.h (original)
+++ subversion/branches/verify-keep-going/subversion/include/private/svn_repos_private.h Tue Jul 9 08:48:43 2013
@@ -38,10 +38,21 @@ extern "C" {
#endif /* __cplusplus */
-/** Validate that property @a name is valid for use in a Subversion
- * repository; return @c SVN_ERR_REPOS_BAD_ARGS if it isn't. For some
- * "svn:" properties, also validate the @a value, and return
- * @c SVN_ERR_BAD_PROPERTY_VALUE if it is not valid.
+/** Validate that property @a name with @a value is valid (as an addition
+ * or edit or deletion) in a Subversion repository. Return an error if not.
+ *
+ * If @a value is NULL, return #SVN_NO_ERROR to indicate that any property
+ * may be deleted, even an invalid one. Otherwise, if the @a name is not
+ * of kind #svn_prop_regular_kind (see #svn_prop_kind_t), return
+ * #SVN_ERR_REPOS_BAD_ARGS. Otherwise, for some "svn:" properties, also
+ * perform some validations on the @a value (e.g., for such properties,
+ * typically the @a value must be in UTF-8 with LF linefeeds), and return
+ * #SVN_ERR_BAD_PROPERTY_VALUE if it is not valid.
+ *
+ * Validations may be added in future releases, for example, for
+ * newly-added #SVN_PROP_PREFIX properties. However, user-defined
+ * (non-#SVN_PROP_PREFIX) properties will never have their @a value
+ * validated in any way.
*
* Use @a pool for temporary allocations.
*
Modified: subversion/branches/verify-keep-going/subversion/include/private/svn_wc_private.h
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/include/private/svn_wc_private.h?rev=1501136&r1=1501135&r2=1501136&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/include/private/svn_wc_private.h (original)
+++ subversion/branches/verify-keep-going/subversion/include/private/svn_wc_private.h Tue Jul 9 08:48:43 2013
@@ -293,7 +293,7 @@ svn_wc__close_db(const char *external_ab
* use @a scratch_pool for temporary allocations.
*/
svn_error_t *
-svn_wc__get_tree_conflict(const svn_wc_conflict_description2_t **tree_conflict,
+svn_wc__get_tree_conflict(const svn_wc_conflict_description3_t **tree_conflict,
svn_wc_context_t *wc_ctx,
const char *victim_abspath,
apr_pool_t *result_pool,
@@ -311,7 +311,7 @@ svn_wc__get_tree_conflict(const svn_wc_c
*/
svn_error_t *
svn_wc__add_tree_conflict(svn_wc_context_t *wc_ctx,
- const svn_wc_conflict_description2_t *conflict,
+ const svn_wc_conflict_description3_t *conflict,
apr_pool_t *scratch_pool);
/* Remove any tree conflict on victim @a victim_abspath using @a wc_ctx.
@@ -354,6 +354,25 @@ svn_wc__get_wcroot(const char **wcroot_a
* before the 1.7 release.
*/
+/*
+ * Convert from svn_wc_conflict_description3_t to
+ * svn_wc_conflict_description2_t.
+ *
+ * Allocate the result in RESULT_POOL.
+ */
+svn_wc_conflict_description2_t *
+svn_wc__cd3_to_cd2(const svn_wc_conflict_description3_t *conflict,
+ apr_pool_t *result_pool);
+
+/*
+ * Convert an array of svn_wc_conflict_description3_t * elements to an
+ * array of * svn_wc_conflict_description2_t * elements.
+ *
+ * Allocate the result in RESULT_POOL.
+ */
+apr_array_header_t *
+svn_wc__cd3_array_to_cd2_array(const apr_array_header_t *conflicts,
+ apr_pool_t *result_pool);
/*
* Convert from svn_wc_conflict_description2_t to
Modified: subversion/branches/verify-keep-going/subversion/include/svn_client.h
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/include/svn_client.h?rev=1501136&r1=1501135&r2=1501136&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/include/svn_client.h (original)
+++ subversion/branches/verify-keep-going/subversion/include/svn_client.h Tue Jul 9 08:48:43 2013
@@ -4025,12 +4025,41 @@ svn_client_mergeinfo_log_eligible(const
/** Recursively cleanup a working copy directory @a dir, finishing any
* incomplete operations, removing lockfiles, etc.
*
+ * If @a include_externals is @c TRUE, recurse into externals and clean
+ * them up as well.
+ *
+ * If @a remove_unversioned_items is @c TRUE, remove unversioned items
+ * in @a dir after successfull working copy cleanup.
+ * If @a remove_ignored_items is @c TRUE, remove ignored unversioned items
+ * in @a dir after successfull working copy cleanup.
+ *
+ * When asked to remove unversioned or ignored items, and the working copy
+ * is already locked via a different client or WC context than @a ctx, return
+ * #SVN_ERR_WC_LOCKED. This prevents accidental working copy corruption in
+ * case users run the cleanup operation to remove unversioned items while
+ * another client is performing some other operation on the working copy.
+ *
* If @a ctx->cancel_func is non-NULL, invoke it with @a
* ctx->cancel_baton at various points during the operation. If it
* returns an error (typically #SVN_ERR_CANCELLED), return that error
* immediately.
*
* Use @a scratch_pool for any temporary allocations.
+ *
+ * @since New in 1.9.
+ */
+svn_error_t *
+svn_client_cleanup2(const char *dir,
+ svn_boolean_t include_externals,
+ svn_boolean_t remove_unversioned_items,
+ svn_boolean_t remove_ignored_items,
+ svn_client_ctx_t *ctx,
+ apr_pool_t *scratch_pool);
+
+/* Like svn_client_cleanup2(), but no support for removing unversioned items
+ * and cleaning up externals.
+ *
+ * @deprecated Provided for limited backwards compatibility with the 1.8 API.
*/
svn_error_t *
svn_client_cleanup(const char *dir,
Modified: subversion/branches/verify-keep-going/subversion/include/svn_config.h
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/include/svn_config.h?rev=1501136&r1=1501135&r2=1501136&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/include/svn_config.h (original)
+++ subversion/branches/verify-keep-going/subversion/include/svn_config.h Tue Jul 9 08:48:43 2013
@@ -95,6 +95,8 @@ typedef struct svn_config_t svn_config_t
#define SVN_CONFIG_OPTION_HTTP_BULK_UPDATES "http-bulk-updates"
/** @since New in 1.8. */
#define SVN_CONFIG_OPTION_HTTP_MAX_CONNECTIONS "http-max-connections"
+/** @since New in 1.9. */
+#define SVN_CONFIG_OPTION_BUSTED_PROXY "busted-proxy"
#define SVN_CONFIG_CATEGORY_CONFIG "config"
#define SVN_CONFIG_SECTION_AUTH "auth"
@@ -723,7 +725,7 @@ svn_config_write_auth_data(apr_hash_t *h
*/
typedef svn_error_t *
(*svn_config_auth_walk_func_t)(svn_boolean_t *delete_cred,
- void *cleanup_baton,
+ void *walk_baton,
const char *cred_kind,
const char *realmstring,
apr_hash_t *hash,
Modified: subversion/branches/verify-keep-going/subversion/include/svn_error_codes.h
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/include/svn_error_codes.h?rev=1501136&r1=1501135&r2=1501136&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/include/svn_error_codes.h (original)
+++ subversion/branches/verify-keep-going/subversion/include/svn_error_codes.h Tue Jul 9 08:48:43 2013
@@ -255,6 +255,11 @@ SVN_ERROR_START
SVN_ERR_XML_CATEGORY_START + 4,
"Data cannot be safely XML-escaped")
+ /** @since New in 1.9. */
+ SVN_ERRDEF(SVN_ERR_XML_UNEXPECTED_ELEMENT,
+ SVN_ERR_XML_CATEGORY_START + 5,
+ "Unexpected XML element found")
+
/* io errors */
SVN_ERRDEF(SVN_ERR_IO_INCONSISTENT_EOL,
@@ -1507,7 +1512,10 @@ SVN_ERROR_START
SVN_ERR_RA_SERF_CATEGORY_START + 2,
"Initialization of the GSSAPI context failed")
- /** @since New in 1.7. */
+ /** @since New in 1.7.
+ * @note When @c svn_error_t.apr_err is set to this,
+ * @c svn_error_t.child->apr_err is a serf error code, not a Subversion
+ * one! */
SVN_ERRDEF(SVN_ERR_RA_SERF_WRAPPED_ERROR,
SVN_ERR_RA_SERF_CATEGORY_START + 3,
"While handling serf response:")
Modified: subversion/branches/verify-keep-going/subversion/include/svn_fs.h
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/include/svn_fs.h?rev=1501136&r1=1501135&r2=1501136&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/include/svn_fs.h (original)
+++ subversion/branches/verify-keep-going/subversion/include/svn_fs.h Tue Jul 9 08:48:43 2013
@@ -264,6 +264,38 @@ svn_fs_open(svn_fs_t **fs_p,
apr_hash_t *fs_config,
apr_pool_t *pool);
+/** The kind of action being taken by 'upgrade'.
+ *
+ * @since New in 1.9.
+ */
+typedef enum svn_fs_upgrade_notify_action_t
+{
+ /** Packing of the revprop shard has completed.
+ * The number parameter is the shard being processed. */
+ svn_fs_upgrade_pack_revprops = 0,
+
+ /** Removal of the non-packed revprop shard is completed.
+ * The number parameter is the shard being processed */
+ svn_fs_upgrade_cleanup_revprops,
+
+ /** DB format has been set to the new value.
+ * The number parameter is the new format number. */
+ svn_fs_upgrade_format_bumped
+} svn_fs_upgrade_notify_action_t;
+
+/** The type of a upgrade notification function. @a number is specifc
+ * to @a action (see #svn_fs_upgrade_notify_action_t); @a action is the
+ * type of action being performed. @a baton is the corresponding baton
+ * for the notification function, and @a pool can be used for temporary
+ * allocations, but will be cleared between invocations.
+ *
+ * @since New in 1.9.
+ */
+typedef svn_error_t *(*svn_fs_upgrade_notify_t)(void *baton,
+ apr_uint64_t number,
+ svn_fs_upgrade_notify_action_t action,
+ apr_pool_t *pool);
+
/**
* Upgrade the Subversion filesystem located in the directory @a path
* to the latest version supported by this library. Return
@@ -271,11 +303,37 @@ svn_fs_open(svn_fs_t **fs_p,
* filesystem if the requested upgrade is not supported. Use @a pool
* for necessary allocations.
*
+ * The optional @a notify_func callback is only a general feedback that
+ * the operation is still in process but may be called in e.g. random shard
+ * order and more than once for the same shard.
+ *
+ * The optional @a cancel_func callback will be invoked as usual to allow
+ * the user to preempt this potentially lengthy operation.
+ *
* @note You probably don't want to use this directly. Take a look at
* svn_repos_upgrade() instead.
*
+ * @note Canceling an upgrade is legal but may leave remnants of previous
+ * format data that may not be cleaned up automatically by later calls.
+ *
+ * @since New in 1.9.
+ */
+svn_error_t *
+svn_fs_upgrade2(const char *path,
+ svn_fs_upgrade_notify_t notify_func,
+ void *notify_baton,
+ svn_cancel_func_t cancel_func,
+ void *cancel_baton,
+ apr_pool_t *pool);
+
+/**
+ * Like svn_fs_upgrade2 but with notify_func, notify_baton, cancel_func
+ * and cancel_baton being set to NULL.
+ *
+ * @deprecated Provided for backward compatibility with the 1.8 API.
* @since New in 1.5.
*/
+SVN_DEPRECATED
svn_error_t *
svn_fs_upgrade(const char *path,
apr_pool_t *pool);
Modified: subversion/branches/verify-keep-going/subversion/include/svn_repos.h
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/include/svn_repos.h?rev=1501136&r1=1501135&r2=1501136&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/include/svn_repos.h (original)
+++ subversion/branches/verify-keep-going/subversion/include/svn_repos.h Tue Jul 9 08:48:43 2013
@@ -256,12 +256,20 @@ typedef enum svn_repos_notify_action_t
/** A revision is found with corruption/errors. @since New in 1.9. */
svn_repos_notify_failure,
+ /** A revprop shard got packed. @since New in 1.9. */
+ svn_repos_notify_pack_revprops,
+
+ /** A non-packed revprop shard got removed. @since New in 1.9. */
+ svn_repos_notify_cleanup_revprops,
+
+ /** The repository format got bumped. @since New in 1.9. */
+ svn_repos_notify_format_bumped,
+
/** Summary of corrupt revisions. @since New in 1.9. */
svn_repos_notify_failure_summary,
/** Summary title string. @since New in 1.9. */
svn_repos_notify_summary
-
} svn_repos_notify_action_t;
/** The type of error occurring.
@@ -304,7 +312,8 @@ typedef struct svn_repos_notify_t
svn_repos_notify_action_t action;
/** For #svn_repos_notify_dump_rev_end and #svn_repos_notify_verify_rev_end,
- * the revision which just completed. */
+ * the revision which just completed.
+ * For #svn_fs_upgrade_format_bumped, the new format version. */
svn_revnum_t revision;
/** For #svn_repos_notify_warning, the warning object. */
@@ -313,6 +322,8 @@ typedef struct svn_repos_notify_t
/** For #svn_repos_notify_pack_shard_start,
#svn_repos_notify_pack_shard_end,
+ #svn_repos_notify_pack_revprops,
+ #svn_repos_notify_cleanup_revprops
#svn_repos_notify_pack_shard_start_revprop, and
#svn_repos_notify_pack_shard_end_revprop, the shard processed. */
apr_int64_t shard;
@@ -2636,7 +2647,7 @@ svn_repos_verify_fs3(svn_repos_t *repos,
* Like svn_repos_verify_fs3(), but with @a keep_going set to @c FALSE.
*
* @since New in 1.7.
- * @deprecated Provided for backward compatibility with the 1.7 API.
+ * @deprecated Provided for backward compatibility with the 1.8 API.
*/
SVN_DEPRECATED
svn_error_t *
Modified: subversion/branches/verify-keep-going/subversion/include/svn_wc.h
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/include/svn_wc.h?rev=1501136&r1=1501135&r2=1501136&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/include/svn_wc.h (original)
+++ subversion/branches/verify-keep-going/subversion/include/svn_wc.h Tue Jul 9 08:48:43 2013
@@ -1255,7 +1255,11 @@ typedef enum svn_wc_notify_action_t
* copy + delete. The notified path is the move source (the deleted path).
* ### TODO: Provide path to move destination as well?
* @since New in 1.8. */
- svn_wc_notify_move_broken
+ svn_wc_notify_move_broken,
+
+ /** Running cleanup on an external module.
+ * @since New in 1.9. */
+ svn_wc_notify_cleanup_external,
} svn_wc_notify_action_t;
@@ -1810,8 +1814,6 @@ typedef struct svn_wc_conflict_descripti
const char *base_abspath; /* common ancestor of the two files being merged */
/** their version of the file */
- /* ### BH: For properties this field contains the reference to
- the property rejection (.prej) file */
const char *their_abspath;
/** my locally-edited version of the file */
@@ -1820,6 +1822,9 @@ typedef struct svn_wc_conflict_descripti
/** merged version; may contain conflict markers */
const char *merged_file;
+ /* For property conflicts, the path to the property reject file. */
+ const char *prop_reject_abspath;
+
/** The operation that exposed the conflict.
* Used only for tree conflicts.
*/
@@ -4249,6 +4254,9 @@ typedef void (*svn_wc_status_func_t)(voi
* @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.
Modified: subversion/branches/verify-keep-going/subversion/libsvn_client/blame.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_client/blame.c?rev=1501136&r1=1501135&r2=1501136&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_client/blame.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_client/blame.c Tue Jul 9 08:48:43 2013
@@ -585,7 +585,6 @@ svn_client_blame5(const char *target,
struct file_rev_baton frb;
svn_ra_session_t *ra_session;
svn_revnum_t start_revnum, end_revnum;
- svn_client__pathrev_t *end_loc;
struct blame *walk, *walk_merged = NULL;
apr_pool_t *iterpool;
svn_stream_t *last_stream;
@@ -604,32 +603,33 @@ svn_client_blame5(const char *target,
SVN_ERR(svn_dirent_get_absolute(&target_abspath_or_url, target, pool));
/* Get an RA plugin for this filesystem object. */
- SVN_ERR(svn_client__ra_session_from_path2(&ra_session, &end_loc,
- target, NULL, peg_revision, end,
+ SVN_ERR(svn_client__ra_session_from_path2(&ra_session, NULL,
+ target, NULL, peg_revision,
+ peg_revision,
ctx, pool));
- end_revnum = end_loc->rev;
SVN_ERR(svn_client__get_revision_number(&start_revnum, NULL, ctx->wc_ctx,
target_abspath_or_url, ra_session,
start, pool));
- if (start_revnum > end_revnum)
- {
- /* Repeat the last bit of svn_client__ra_session_from_path2(), to end
- up where we would have ended up if we had passed 'start' rather than
- 'end' to it.
- ### Should we try calling
- ### svn_client__open_ra_session_internal(peg_revision, start)
- ### if calling it with (peg_revision, end) fails?
- */
- svn_client__pathrev_t *start_loc;
- SVN_ERR(svn_client__resolve_rev_and_url(&start_loc, ra_session,
- target, peg_revision, start,
- ctx, pool));
-
- /* Make the session point to the real URL. */
- SVN_ERR(svn_ra_reparent(ra_session, start_loc->url, pool));
- }
+ SVN_ERR(svn_client__get_revision_number(&end_revnum, NULL, ctx->wc_ctx,
+ target_abspath_or_url, ra_session,
+ end, pool));
+
+ {
+ svn_client__pathrev_t *loc;
+ svn_opt_revision_t younger_end;
+ younger_end.kind = svn_opt_revision_number;
+ younger_end.value.number = MAX(start_revnum, end_revnum);
+
+ SVN_ERR(svn_client__resolve_rev_and_url(&loc, ra_session,
+ target, peg_revision,
+ &younger_end,
+ ctx, pool));
+
+ /* Make the session point to the real URL. */
+ SVN_ERR(svn_ra_reparent(ra_session, loc->url, pool));
+ }
/* We check the mime-type of the yougest revision before getting all
the older revisions. */
Modified: subversion/branches/verify-keep-going/subversion/libsvn_client/cleanup.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_client/cleanup.c?rev=1501136&r1=1501135&r2=1501136&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_client/cleanup.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_client/cleanup.c Tue Jul 9 08:48:43 2013
@@ -32,32 +32,210 @@
#include "svn_client.h"
#include "svn_config.h"
#include "svn_dirent_uri.h"
+#include "svn_hash.h"
#include "svn_path.h"
#include "svn_pools.h"
#include "client.h"
#include "svn_props.h"
#include "svn_private_config.h"
+#include "private/svn_wc_private.h"
/*** Code. ***/
+struct cleanup_status_walk_baton
+{
+ svn_boolean_t include_externals;
+ svn_boolean_t remove_unversioned_items;
+ svn_boolean_t remove_ignored_items;
+ svn_client_ctx_t *ctx;
+};
+
+/* Forward declararion. */
+static svn_error_t *
+cleanup_status_walk(void *baton,
+ const char *local_abspath,
+ const svn_wc_status3_t *status,
+ apr_pool_t *scratch_pool);
+
+static svn_error_t *
+do_cleanup(const char *local_abspath,
+ svn_boolean_t include_externals,
+ svn_boolean_t remove_unversioned_items,
+ svn_boolean_t remove_ignored_items,
+ svn_client_ctx_t *ctx,
+ apr_pool_t *scratch_pool)
+{
+ svn_error_t *err;
+
+ if (remove_unversioned_items || remove_ignored_items)
+ {
+ svn_boolean_t is_locked_here;
+ svn_boolean_t is_locked;
+ svn_boolean_t sqlite_exclusive;
+ svn_config_t *cfg = ctx->config
+ ? svn_hash_gets(ctx->config,
+ SVN_CONFIG_CATEGORY_CONFIG)
+ : NULL;
+
+ /* Check if someone else owns a lock for LOCAL_ABSPATH. */
+ SVN_ERR(svn_wc_locked2(&is_locked_here, &is_locked, ctx->wc_ctx,
+ local_abspath, scratch_pool));
+ if (is_locked && !is_locked_here)
+ return svn_error_createf(SVN_ERR_WC_LOCKED, NULL,
+ _("Working copy at '%s' is already locked."),
+ svn_dirent_local_style(local_abspath,
+ scratch_pool));
+
+ SVN_ERR(svn_config_get_bool(cfg, &sqlite_exclusive,
+ SVN_CONFIG_SECTION_WORKING_COPY,
+ SVN_CONFIG_OPTION_SQLITE_EXCLUSIVE,
+ FALSE));
+ if (sqlite_exclusive)
+ {
+ /* Close the db because svn_wc_cleanup3() will try to open it again,
+ * which doesn't work if exclusive sqlite locking mode is enabled. */
+ SVN_ERR(svn_wc__close_db(local_abspath, ctx->wc_ctx, scratch_pool));
+ }
+ }
+
+ err = svn_wc_cleanup3(ctx->wc_ctx, local_abspath, ctx->cancel_func,
+ ctx->cancel_baton, scratch_pool);
+ svn_io_sleep_for_timestamps(local_abspath, scratch_pool);
+ if (err)
+ return svn_error_trace(err);
+
+ if (remove_unversioned_items || remove_ignored_items || include_externals)
+ {
+ struct cleanup_status_walk_baton b;
+ apr_array_header_t *ignores;
+
+ b.include_externals = include_externals;
+ b.remove_unversioned_items = remove_unversioned_items;
+ b.remove_ignored_items = remove_ignored_items;
+ b.include_externals = include_externals;
+ b.ctx = ctx;
+
+ SVN_ERR(svn_wc_get_default_ignores(&ignores, ctx->config, scratch_pool));
+ SVN_ERR(svn_wc_walk_status(ctx->wc_ctx, local_abspath,
+ svn_depth_infinity,
+ TRUE, /* get all */
+ remove_ignored_items,
+ TRUE, /* ignore textmods */
+ ignores,
+ cleanup_status_walk, &b,
+ ctx->cancel_func,
+ ctx->cancel_baton,
+ scratch_pool));
+ }
+
+ return SVN_NO_ERROR;
+}
+
+
+/* An implementation of svn_wc_status_func4_t. */
+static svn_error_t *
+cleanup_status_walk(void *baton,
+ const char *local_abspath,
+ const svn_wc_status3_t *status,
+ apr_pool_t *scratch_pool)
+{
+ struct cleanup_status_walk_baton *b = baton;
+ svn_node_kind_t kind_on_disk;
+ svn_wc_notify_t *notify;
+
+ if (status->node_status == svn_wc_status_external && b->include_externals)
+ {
+ svn_error_t *err;
+
+ SVN_ERR(svn_io_check_path(local_abspath, &kind_on_disk, scratch_pool));
+ if (kind_on_disk == svn_node_dir)
+ {
+ if (b->ctx->notify_func2)
+ {
+ notify = svn_wc_create_notify(local_abspath,
+ svn_wc_notify_cleanup_external,
+ scratch_pool);
+ (*b->ctx->notify_func2)(b->ctx->notify_baton2, notify,
+ scratch_pool);
+ }
+
+ err = do_cleanup(local_abspath, b->include_externals,
+ b->remove_unversioned_items,
+ b->remove_ignored_items,
+ b->ctx, scratch_pool);
+ if (err && err->apr_err == SVN_ERR_WC_NOT_WORKING_COPY)
+ {
+ svn_error_clear(err);
+ return SVN_NO_ERROR;
+ }
+ else
+ SVN_ERR(err);
+ }
+
+ return SVN_NO_ERROR;
+ }
+
+ if (status->node_status == svn_wc_status_ignored)
+ {
+ if (!b->remove_ignored_items)
+ return SVN_NO_ERROR;
+ }
+ else if (status->node_status == svn_wc_status_unversioned)
+ {
+ if (!b->remove_unversioned_items)
+ return SVN_NO_ERROR;
+ }
+ else
+ return SVN_NO_ERROR;
+
+ SVN_ERR(svn_io_check_path(local_abspath, &kind_on_disk, scratch_pool));
+ switch (kind_on_disk)
+ {
+ case svn_node_file:
+ case svn_node_symlink:
+ SVN_ERR(svn_io_remove_file2(local_abspath, FALSE, scratch_pool));
+ break;
+ case svn_node_dir:
+ SVN_ERR(svn_io_remove_dir2(local_abspath, FALSE,
+ b->ctx->cancel_func, b->ctx->cancel_baton,
+ scratch_pool));
+ break;
+ case svn_node_none:
+ default:
+ return SVN_NO_ERROR;
+ }
+
+ if (b->ctx->notify_func2)
+ {
+ notify = svn_wc_create_notify(local_abspath, svn_wc_notify_delete,
+ scratch_pool);
+ notify->kind = kind_on_disk;
+ (*b->ctx->notify_func2)(b->ctx->notify_baton2, notify, scratch_pool);
+ }
+
+ return SVN_NO_ERROR;
+}
+
svn_error_t *
-svn_client_cleanup(const char *path,
- svn_client_ctx_t *ctx,
- apr_pool_t *scratch_pool)
+svn_client_cleanup2(const char *path,
+ svn_boolean_t include_externals,
+ svn_boolean_t remove_unversioned_items,
+ svn_boolean_t remove_ignored_items,
+ svn_client_ctx_t *ctx,
+ apr_pool_t *scratch_pool)
{
const char *local_abspath;
- svn_error_t *err;
if (svn_path_is_url(path))
return svn_error_createf(SVN_ERR_ILLEGAL_TARGET, NULL,
_("'%s' is not a local path"), path);
SVN_ERR(svn_dirent_get_absolute(&local_abspath, path, scratch_pool));
+ SVN_ERR(do_cleanup(local_abspath, include_externals,
+ remove_unversioned_items, remove_ignored_items,
+ ctx, scratch_pool));
- err = svn_wc_cleanup3(ctx->wc_ctx, local_abspath, ctx->cancel_func,
- ctx->cancel_baton, scratch_pool);
- svn_io_sleep_for_timestamps(path, scratch_pool);
- return svn_error_trace(err);
+ return SVN_NO_ERROR;
}
Modified: subversion/branches/verify-keep-going/subversion/libsvn_client/copy.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_client/copy.c?rev=1501136&r1=1501135&r2=1501136&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_client/copy.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_client/copy.c Tue Jul 9 08:48:43 2013
@@ -385,6 +385,7 @@ static svn_error_t *
verify_wc_dsts(const apr_array_header_t *copy_pairs,
svn_boolean_t make_parents,
svn_boolean_t is_move,
+ svn_boolean_t metadata_only,
svn_client_ctx_t *ctx,
apr_pool_t *result_pool,
apr_pool_t *scratch_pool)
@@ -435,8 +436,11 @@ verify_wc_dsts(const apr_array_header_t
}
/* Check that there is no unversioned obstruction */
- SVN_ERR(svn_io_check_path(pair->dst_abspath_or_url, &dst_kind,
- iterpool));
+ if (metadata_only)
+ dst_kind = svn_node_none;
+ else
+ SVN_ERR(svn_io_check_path(pair->dst_abspath_or_url, &dst_kind,
+ iterpool));
if (dst_kind != svn_node_none)
{
@@ -527,6 +531,7 @@ static svn_error_t *
verify_wc_srcs_and_dsts(const apr_array_header_t *copy_pairs,
svn_boolean_t make_parents,
svn_boolean_t is_move,
+ svn_boolean_t metadata_only,
svn_client_ctx_t *ctx,
apr_pool_t *result_pool,
apr_pool_t *scratch_pool)
@@ -557,7 +562,7 @@ verify_wc_srcs_and_dsts(const apr_array_
scratch_pool));
}
- SVN_ERR(verify_wc_dsts(copy_pairs, make_parents, is_move, ctx,
+ SVN_ERR(verify_wc_dsts(copy_pairs, make_parents, is_move, metadata_only, ctx,
result_pool, iterpool));
svn_pool_destroy(iterpool);
@@ -1454,7 +1459,7 @@ wc_to_repos_copy(const apr_array_header_
#ifdef ENABLE_EV2_SHIMS
if (commit_items)
{
- relpath_map = apr_hash_make(pool);
+ relpath_map = apr_hash_make(scratch_pool);
for (i = 0; i < commit_items->nelts; i++)
{
svn_client_commit_item3_t *item = APR_ARRAY_IDX(commit_items, i,
@@ -1727,8 +1732,8 @@ repos_to_wc_copy_locked(svn_boolean_t *t
/* We've already checked for physical obstruction by a working file.
But there could also be logical obstruction by an entry whose
working file happens to be missing.*/
- SVN_ERR(verify_wc_dsts(copy_pairs, FALSE, FALSE, ctx,
- scratch_pool, iterpool));
+ SVN_ERR(verify_wc_dsts(copy_pairs, FALSE, FALSE, FALSE /* metadata_only */,
+ ctx, scratch_pool, iterpool));
/* Decide whether the two repositories are the same or not. */
{
@@ -2210,7 +2215,7 @@ try_copy(svn_boolean_t *timestamp_sleep,
if ((! srcs_are_urls) && (! dst_is_url))
{
SVN_ERR(verify_wc_srcs_and_dsts(copy_pairs, make_parents, is_move,
- ctx, pool, pool));
+ metadata_only, ctx, pool, pool));
/* Copy or move all targets. */
if (is_move)
Modified: subversion/branches/verify-keep-going/subversion/libsvn_client/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_client/deprecated.c?rev=1501136&r1=1501135&r2=1501136&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_client/deprecated.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_client/deprecated.c Tue Jul 9 08:48:43 2013
@@ -2964,3 +2964,11 @@ svn_client_commit_item2_dup(const svn_cl
return new_item;
}
+svn_error_t *
+svn_client_cleanup(const char *path,
+ svn_client_ctx_t *ctx,
+ apr_pool_t *scratch_pool)
+{
+ return svn_error_trace(svn_client_cleanup2(path, FALSE, FALSE, FALSE, ctx,
+ scratch_pool));
+}
Modified: subversion/branches/verify-keep-going/subversion/libsvn_client/diff.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_client/diff.c?rev=1501136&r1=1501135&r2=1501136&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_client/diff.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_client/diff.c Tue Jul 9 08:48:43 2013
@@ -51,6 +51,7 @@
#include "private/svn_wc_private.h"
#include "private/svn_diff_private.h"
#include "private/svn_subr_private.h"
+#include "private/svn_io_private.h"
#include "svn_private_config.h"
@@ -807,14 +808,23 @@ diff_content_changed(svn_boolean_t *wrot
* ### a non-git compatible diff application.*/
/* We deal in streams, but svn_io_run_diff2() deals in file handles,
- unfortunately, so we need to make these temporary files, and then
- copy the contents to our stream. */
- SVN_ERR(svn_io_open_unique_file3(&outfile, &outfilename, NULL,
- svn_io_file_del_on_pool_cleanup,
- scratch_pool, scratch_pool));
- SVN_ERR(svn_io_open_unique_file3(&errfile, &errfilename, NULL,
- svn_io_file_del_on_pool_cleanup,
- scratch_pool, scratch_pool));
+ so we may need to make temporary files and then copy the contents
+ to our stream. */
+ outfile = svn_stream__aprfile(outstream);
+ if (outfile)
+ outfilename = NULL;
+ else
+ SVN_ERR(svn_io_open_unique_file3(&outfile, &outfilename, NULL,
+ svn_io_file_del_on_pool_cleanup,
+ scratch_pool, scratch_pool));
+
+ errfile = svn_stream__aprfile(errstream);
+ if (errfile)
+ errfilename = NULL;
+ else
+ SVN_ERR(svn_io_open_unique_file3(&errfile, &errfilename, NULL,
+ svn_io_file_del_on_pool_cleanup,
+ scratch_pool, scratch_pool));
SVN_ERR(svn_io_run_diff2(".",
diff_cmd_baton->options.for_external.argv,
@@ -824,20 +834,25 @@ diff_content_changed(svn_boolean_t *wrot
&exitcode, outfile, errfile,
diff_cmd_baton->diff_cmd, scratch_pool));
- SVN_ERR(svn_io_file_close(outfile, scratch_pool));
- SVN_ERR(svn_io_file_close(errfile, scratch_pool));
-
/* Now, open and copy our files to our output streams. */
- SVN_ERR(svn_stream_open_readonly(&stream, outfilename,
- scratch_pool, scratch_pool));
- SVN_ERR(svn_stream_copy3(stream, svn_stream_disown(outstream,
- scratch_pool),
- NULL, NULL, scratch_pool));
- SVN_ERR(svn_stream_open_readonly(&stream, errfilename,
- scratch_pool, scratch_pool));
- SVN_ERR(svn_stream_copy3(stream, svn_stream_disown(errstream,
- scratch_pool),
- NULL, NULL, scratch_pool));
+ if (outfilename)
+ {
+ SVN_ERR(svn_io_file_close(outfile, scratch_pool));
+ SVN_ERR(svn_stream_open_readonly(&stream, outfilename,
+ scratch_pool, scratch_pool));
+ SVN_ERR(svn_stream_copy3(stream, svn_stream_disown(outstream,
+ scratch_pool),
+ NULL, NULL, scratch_pool));
+ }
+ if (errfilename)
+ {
+ SVN_ERR(svn_io_file_close(errfile, scratch_pool));
+ SVN_ERR(svn_stream_open_readonly(&stream, errfilename,
+ scratch_pool, scratch_pool));
+ SVN_ERR(svn_stream_copy3(stream, svn_stream_disown(errstream,
+ scratch_pool),
+ NULL, NULL, scratch_pool));
+ }
/* We have a printed a diff for this path, mark it as visited. */
*wrote_header = TRUE;
Modified: subversion/branches/verify-keep-going/subversion/libsvn_client/diff_local.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_client/diff_local.c?rev=1501136&r1=1501135&r2=1501136&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_client/diff_local.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_client/diff_local.c Tue Jul 9 08:48:43 2013
@@ -607,7 +607,10 @@ svn_client__arbitrary_nodes_diff(const c
if (kind1 != kind2)
return svn_error_createf(SVN_ERR_NODE_UNEXPECTED_KIND, NULL,
_("'%s' is not the same node kind as '%s'"),
- local_abspath1, local_abspath2);
+ svn_dirent_local_style(local_abspath1,
+ scratch_pool),
+ svn_dirent_local_style(local_abspath2,
+ scratch_pool));
if (depth == svn_depth_unknown)
depth = svn_depth_infinity;
@@ -627,7 +630,10 @@ svn_client__arbitrary_nodes_diff(const c
else
return svn_error_createf(SVN_ERR_NODE_UNEXPECTED_KIND, NULL,
_("'%s' is not a file or directory"),
- kind1 == svn_node_none ?
- local_abspath1 : local_abspath2);
+ kind1 == svn_node_none
+ ? svn_dirent_local_style(local_abspath1,
+ scratch_pool)
+ : svn_dirent_local_style(local_abspath2,
+ scratch_pool));
return SVN_NO_ERROR;
}
Modified: subversion/branches/verify-keep-going/subversion/libsvn_client/log.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_client/log.c?rev=1501136&r1=1501135&r2=1501136&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_client/log.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_client/log.c Tue Jul 9 08:48:43 2013
@@ -712,7 +712,17 @@ run_ra_get_log(apr_array_header_t *revis
matching_segment = bsearch(&younger_rev, log_segments->elts,
log_segments->nelts, log_segments->elt_size,
compare_rev_to_segment);
- SVN_ERR_ASSERT(*matching_segment);
+ /* LOG_SEGMENTS is supposed to represent the history of PATHS from
+ the oldest to youngest revs in REVISION_RANGES. This function's
+ current sole caller svn_client_log5 *should* be providing
+ LOG_SEGMENTS that span the oldest to youngest revs in
+ REVISION_RANGES, even if one or more of the svn_location_segment_t's
+ returned have NULL path members indicating a gap in the history. So
+ MATCHING_SEGMENT should never be NULL, but clearly sometimes it is,
+ see http://svn.haxx.se/dev/archive-2013-06/0522.shtml
+ So to be safe we handle that case. */
+ if (matching_segment == NULL)
+ continue;
/* A segment with a NULL path means there is gap in the history.
We'll just proceed and let svn_ra_get_log2 fail with a useful
@@ -827,7 +837,7 @@ svn_client_log5(const apr_array_header_t
SVN_ERR(resolve_log_targets(&relative_targets, &ra_target, &peg_rev,
targets, ctx, pool, pool));
- SVN_ERR(svn_client__ra_session_from_path2(&ra_session, &actual_loc,
+ SVN_ERR(svn_client__ra_session_from_path2(&ra_session, NULL,
ra_target, NULL, &peg_rev, &peg_rev,
ctx, pool));
@@ -850,13 +860,32 @@ svn_client_log5(const apr_array_header_t
SVN_ERR(svn_client__ensure_ra_session_url(&old_session_url, ra_session,
actual_loc->url, pool));
- /* Get the svn_location_segment_t's representing the requested log ranges. */
- SVN_ERR(svn_client__repos_location_segments(&log_segments, ra_session,
- actual_loc->url,
- actual_loc->rev, /* peg */
- actual_loc->rev, /* start */
- oldest_rev, /* end */
- ctx, 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.
+ */
+ if (strcmp(actual_loc->url, actual_loc->repos_root_url) == 0)
+ {
+ 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 = "";
+ APR_ARRAY_PUSH(log_segments, svn_location_segment_t *) = segment;
+ }
+ else
+ {
+ /* Get the svn_location_segment_t's representing the requested log
+ * ranges. */
+ SVN_ERR(svn_client__repos_location_segments(&log_segments, ra_session,
+ actual_loc->url,
+ actual_loc->rev, /* peg */
+ actual_loc->rev, /* start */
+ oldest_rev, /* end */
+ ctx, pool));
+ }
+
SVN_ERR(run_ra_get_log(revision_ranges, relative_targets, log_segments,
actual_loc, ra_session, targets, limit,
Modified: subversion/branches/verify-keep-going/subversion/libsvn_client/merge.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_client/merge.c?rev=1501136&r1=1501135&r2=1501136&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_client/merge.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_client/merge.c Tue Jul 9 08:48:43 2013
@@ -1198,7 +1198,7 @@ struct merge_dir_baton_t
apr_hash_t *pending_deletes;
/* NULL, or an hashtable mapping const char * LOCAL_ABSPATHs to
- a const svn_wc_conflict_description2_t * instance, describing the just
+ a const svn_wc_conflict_description3_t * instance, describing the just
installed conflict */
apr_hash_t *new_tree_conflicts;
@@ -1301,12 +1301,15 @@ record_tree_conflict(merge_cmd_baton_t *
svn_node_kind_t node_kind,
svn_wc_conflict_action_t action,
svn_wc_conflict_reason_t reason,
- const svn_wc_conflict_description2_t *existing_conflict,
+ const svn_wc_conflict_description3_t *existing_conflict,
svn_boolean_t notify_tc,
apr_pool_t *scratch_pool)
{
svn_wc_context_t *wc_ctx = merge_b->ctx->wc_ctx;
+ if (merge_b->record_only)
+ return SVN_NO_ERROR;
+
if (merge_b->merge_source.ancestral
|| merge_b->reintegrate_merge)
{
@@ -1316,10 +1319,9 @@ record_tree_conflict(merge_cmd_baton_t *
alloc_and_store_path(&merge_b->conflicted_paths, local_abspath,
merge_b->pool);
-
- if (!merge_b->record_only && !merge_b->dry_run)
+ if (!merge_b->dry_run)
{
- svn_wc_conflict_description2_t *conflict;
+ svn_wc_conflict_description3_t *conflict;
const svn_wc_conflict_version_t *left;
const svn_wc_conflict_version_t *right;
apr_pool_t *result_pool = parent_baton ? parent_baton->pool
@@ -1358,7 +1360,7 @@ record_tree_conflict(merge_cmd_baton_t *
if (existing_conflict != NULL && existing_conflict->src_left_version)
left = existing_conflict->src_left_version;
- conflict = svn_wc_conflict_description_create_tree2(
+ conflict = svn_wc_conflict_description_create_tree3(
local_abspath, node_kind, svn_wc_operation_merge,
left, right, result_pool);
@@ -1848,7 +1850,7 @@ merge_file_opened(void **new_file_baton,
}
else
{
- const svn_wc_conflict_description2_t *old_tc = NULL;
+ const svn_wc_conflict_description3_t *old_tc = NULL;
/* The node doesn't exist pre-merge: We have an addition */
fb->added = TRUE;
@@ -2605,7 +2607,7 @@ merge_dir_opened(void **new_dir_baton,
}
else
{
- const svn_wc_conflict_description2_t *old_tc = NULL;
+ const svn_wc_conflict_description3_t *old_tc = NULL;
/* The node doesn't exist pre-merge: We have an addition */
db->added = TRUE;
Modified: subversion/branches/verify-keep-going/subversion/libsvn_client/ra.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_client/ra.c?rev=1501136&r1=1501135&r2=1501136&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_client/ra.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_client/ra.c Tue Jul 9 08:48:43 2013
@@ -601,32 +601,8 @@ svn_client__repos_location_segments(apr_
struct gls_receiver_baton_t gls_receiver_baton;
const char *old_session_url;
svn_error_t *err;
- const char *rel_path;
*segments = apr_array_make(pool, 8, sizeof(svn_location_segment_t *));
-
- /* Save us an RA layer round trip if we are on the repository root and
- know the result in advance. It's fair to assume that the repo root
- has already been cached in ra_session.
-
- We also assume that all parameters are valid and reivisons properly
- ordered. Otherwise, the error behavior might differ.
- */
- SVN_ERR(svn_ra_get_path_relative_to_root(ra_session, &rel_path, url, pool));
- if (rel_path && rel_path[0] == 0)
- {
- svn_location_segment_t *segment = apr_pcalloc(pool, sizeof(*segment));
- segment->range_start
- = end_revision <= start_revision ? end_revision : 0;
- segment->range_end
- = end_revision <= start_revision ? start_revision : 0;
- segment->path = rel_path;
- APR_ARRAY_PUSH(*segments, svn_location_segment_t *) = segment;
-
- return SVN_NO_ERROR;
- }
-
- /* Do it the hard way and ask the repository layer. */
gls_receiver_baton.segments = *segments;
gls_receiver_baton.ctx = ctx;
gls_receiver_baton.pool = pool;
@@ -651,6 +627,9 @@ svn_client__repos_location_segments(apr_
* END_REVNUM must be valid revision numbers except that END_REVNUM may
* be SVN_INVALID_REVNUM if END_URL is NULL.
*
+ * YOUNGEST_REV is the already retrieved youngest revision of the ra session,
+ * but can be SVN_INVALID_REVNUM if the value is not already retrieved.
+ *
* RA_SESSION is an open RA session parented at URL.
*/
static svn_error_t *
@@ -661,6 +640,7 @@ repos_locations(const char **start_url,
svn_revnum_t peg_revnum,
svn_revnum_t start_revnum,
svn_revnum_t end_revnum,
+ svn_revnum_t youngest_rev,
apr_pool_t *result_pool,
apr_pool_t *scratch_pool)
{
@@ -668,9 +648,9 @@ repos_locations(const char **start_url,
apr_array_header_t *revs;
apr_hash_t *rev_locs;
- SVN_ERR_ASSERT(peg_revnum != SVN_INVALID_REVNUM);
- SVN_ERR_ASSERT(start_revnum != SVN_INVALID_REVNUM);
- SVN_ERR_ASSERT(end_revnum != SVN_INVALID_REVNUM || end_url == NULL);
+ SVN_ERR_ASSERT(SVN_IS_VALID_REVNUM(peg_revnum));
+ SVN_ERR_ASSERT(SVN_IS_VALID_REVNUM(start_revnum));
+ SVN_ERR_ASSERT(SVN_IS_VALID_REVNUM(end_revnum) || end_url == NULL);
/* Avoid a network request in the common easy case. */
if (start_revnum == peg_revnum
@@ -685,6 +665,27 @@ repos_locations(const char **start_url,
SVN_ERR(svn_ra_get_repos_root2(ra_session, &repos_url, scratch_pool));
+ /* Handle another common case: The repository root can't move */
+ if (! strcmp(repos_url, url))
+ {
+ if (! SVN_IS_VALID_REVNUM(youngest_rev))
+ SVN_ERR(svn_ra_get_latest_revnum(ra_session, &youngest_rev,
+ scratch_pool));
+
+ if (start_revnum > youngest_rev
+ || (SVN_IS_VALID_REVNUM(end_revnum) && (end_revnum > youngest_rev)))
+ return svn_error_createf(SVN_ERR_FS_NO_SUCH_REVISION, NULL,
+ _("No such revision %ld"),
+ (start_revnum > youngest_rev)
+ ? start_revnum : end_revnum);
+
+ if (start_url)
+ *start_url = apr_pstrdup(result_pool, repos_url);
+ if (end_url)
+ *end_url = apr_pstrdup(result_pool, repos_url);
+ return SVN_NO_ERROR;
+ }
+
revs = apr_array_make(scratch_pool, 2, sizeof(svn_revnum_t));
APR_ARRAY_PUSH(revs, svn_revnum_t) = start_revnum;
if (end_revnum != start_revnum && end_revnum != SVN_INVALID_REVNUM)
@@ -740,7 +741,7 @@ svn_client__repos_location(svn_client__p
peg_loc->url, scratch_pool));
err = repos_locations(&op_url, NULL, ra_session,
peg_loc->url, peg_loc->rev,
- op_revnum, SVN_INVALID_REVNUM,
+ op_revnum, SVN_INVALID_REVNUM, SVN_INVALID_REVNUM,
result_pool, scratch_pool);
SVN_ERR(svn_error_compose_create(
err, svn_ra_reparent(ra_session, old_session_url, scratch_pool)));
@@ -880,7 +881,7 @@ svn_client__repos_locations(const char *
SVN_ERR(repos_locations(start_url, end_url,
ra_session, url, peg_revnum,
- start_revnum, end_revnum,
+ start_revnum, end_revnum, youngest_rev,
pool, subpool));
svn_pool_destroy(subpool);
return SVN_NO_ERROR;
Modified: subversion/branches/verify-keep-going/subversion/libsvn_client/switch.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_client/switch.c?rev=1501136&r1=1501135&r2=1501136&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_client/switch.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_client/switch.c Tue Jul 9 08:48:43 2013
@@ -239,7 +239,7 @@ switch_internal(svn_revnum_t *result_rev
return svn_error_createf(SVN_ERR_CLIENT_UNRELATED_RESOURCES, NULL,
_("'%s' shares no common ancestry with '%s'"),
switch_url,
- svn_dirent_dirname(local_abspath, pool));
+ svn_dirent_local_style(local_abspath, pool));
}
wcroot_iprops = apr_hash_make(pool);
Modified: subversion/branches/verify-keep-going/subversion/libsvn_delta/compat.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_delta/compat.c?rev=1501136&r1=1501135&r2=1501136&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_delta/compat.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_delta/compat.c Tue Jul 9 08:48:43 2013
@@ -218,6 +218,7 @@ locate_change(struct ev2_edit_baton *eb,
change = apr_pcalloc(eb->edit_pool, sizeof(*change));
change->changing = SVN_INVALID_REVNUM;
change->deleting = SVN_INVALID_REVNUM;
+ change->kind = svn_node_unknown;
svn_hash_sets(eb->changes, relpath, change);
@@ -1633,11 +1634,14 @@ apply_change(void **dir_baton,
change->copyfrom_path,
scratch_pool);
else
- copyfrom_url = change->copyfrom_path;
+ {
+ copyfrom_url = change->copyfrom_path;
- /* Make this an FS path by prepending "/" */
- if (copyfrom_url[0] != '/')
- copyfrom_url = apr_pstrcat(scratch_pool, "/", copyfrom_url, NULL);
+ /* Make this an FS path by prepending "/" */
+ if (copyfrom_url[0] != '/')
+ copyfrom_url = apr_pstrcat(scratch_pool, "/",
+ copyfrom_url, NULL);
+ }
copyfrom_rev = change->copyfrom_rev;
}
Modified: subversion/branches/verify-keep-going/subversion/libsvn_fs/fs-loader.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_fs/fs-loader.c?rev=1501136&r1=1501135&r2=1501136&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_fs/fs-loader.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_fs/fs-loader.c Tue Jul 9 08:48:43 2013
@@ -481,7 +481,12 @@ svn_fs_open(svn_fs_t **fs_p, const char
}
svn_error_t *
-svn_fs_upgrade(const char *path, apr_pool_t *pool)
+svn_fs_upgrade2(const char *path,
+ svn_fs_upgrade_notify_t notify_func,
+ void *notify_baton,
+ svn_cancel_func_t cancel_func,
+ void *cancel_baton,
+ apr_pool_t *pool)
{
fs_library_vtable_t *vtable;
svn_fs_t *fs;
@@ -490,11 +495,20 @@ svn_fs_upgrade(const char *path, apr_poo
fs = fs_new(NULL, pool);
SVN_MUTEX__WITH_LOCK(common_pool_lock,
- vtable->upgrade_fs(fs, path, pool, common_pool));
+ vtable->upgrade_fs(fs, path,
+ notify_func, notify_baton,
+ cancel_func, cancel_baton,
+ pool, common_pool));
return SVN_NO_ERROR;
}
svn_error_t *
+svn_fs_upgrade(const char *path, apr_pool_t *pool)
+{
+ return svn_error_trace(svn_fs_upgrade2(path, NULL, NULL, NULL, NULL, pool));
+}
+
+svn_error_t *
svn_fs_verify(const char *path,
apr_hash_t *fs_config,
svn_revnum_t start,
Modified: subversion/branches/verify-keep-going/subversion/libsvn_fs/fs-loader.h
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_fs/fs-loader.h?rev=1501136&r1=1501135&r2=1501136&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_fs/fs-loader.h (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_fs/fs-loader.h Tue Jul 9 08:48:43 2013
@@ -85,7 +85,13 @@ typedef struct fs_library_vtable_t
svn_error_t *(*open_fs_for_recovery)(svn_fs_t *fs, const char *path,
apr_pool_t *pool,
apr_pool_t *common_pool);
- svn_error_t *(*upgrade_fs)(svn_fs_t *fs, const char *path, apr_pool_t *pool,
+ svn_error_t *(*upgrade_fs)(svn_fs_t *fs,
+ const char *path,
+ svn_fs_upgrade_notify_t notify_func,
+ void *notify_baton,
+ svn_cancel_func_t cancel_func,
+ void *cancel_baton,
+ apr_pool_t *pool,
apr_pool_t *common_pool);
svn_error_t *(*verify_fs)(svn_fs_t *fs, const char *path,
svn_revnum_t start,
Modified: subversion/branches/verify-keep-going/subversion/libsvn_fs_base/bdb/env.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_fs_base/bdb/env.c?rev=1501136&r1=1501135&r2=1501136&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_fs_base/bdb/env.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_fs_base/bdb/env.c Tue Jul 9 08:48:43 2013
@@ -227,7 +227,7 @@ bdb_error_gatherer(const DB_ENV *dbenv,
SVN_BDB_ERROR_GATHERER_IGNORE(dbenv);
- new_err = svn_error_createf(APR_SUCCESS, NULL, "bdb: %s", msg);
+ new_err = svn_error_createf(SVN_ERR_FS_BERKELEY_DB, NULL, "bdb: %s", msg);
if (error_info->pending_errors)
svn_error_compose(error_info->pending_errors, new_err);
else
Modified: subversion/branches/verify-keep-going/subversion/libsvn_fs_base/fs.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_fs_base/fs.c?rev=1501136&r1=1501135&r2=1501136&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_fs_base/fs.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_fs_base/fs.c Tue Jul 9 08:48:43 2013
@@ -898,7 +898,13 @@ base_open_for_recovery(svn_fs_t *fs, con
}
static svn_error_t *
-base_upgrade(svn_fs_t *fs, const char *path, apr_pool_t *pool,
+base_upgrade(svn_fs_t *fs,
+ const char *path,
+ svn_fs_upgrade_notify_t notify_func,
+ void *notify_baton,
+ svn_cancel_func_t cancel_func,
+ void *cancel_baton,
+ apr_pool_t *pool,
apr_pool_t *common_pool)
{
const char *version_file_path;
@@ -921,6 +927,9 @@ base_upgrade(svn_fs_t *fs, const char *p
/* Bump the format file's stored version number. */
SVN_ERR(svn_io_write_version_file(version_file_path,
SVN_FS_BASE__FORMAT_NUMBER, pool));
+ if (notify_func)
+ SVN_ERR(notify_func(notify_baton, SVN_FS_BASE__FORMAT_NUMBER,
+ svn_fs_upgrade_format_bumped, pool));
/* Check and see if we need to record the "bump" revision. */
if (old_format_number < SVN_FS_BASE__MIN_FORWARD_DELTAS_FORMAT)
Modified: subversion/branches/verify-keep-going/subversion/libsvn_fs_fs/fs.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_fs_fs/fs.c?rev=1501136&r1=1501135&r2=1501136&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_fs_fs/fs.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_fs_fs/fs.c Tue Jul 9 08:48:43 2013
@@ -289,7 +289,13 @@ fs_open_for_recovery(svn_fs_t *fs,
/* This implements the fs_library_vtable_t.upgrade_fs() API. */
static svn_error_t *
-fs_upgrade(svn_fs_t *fs, const char *path, apr_pool_t *pool,
+fs_upgrade(svn_fs_t *fs,
+ const char *path,
+ svn_fs_upgrade_notify_t notify_func,
+ void *notify_baton,
+ svn_cancel_func_t cancel_func,
+ void *cancel_baton,
+ apr_pool_t *pool,
apr_pool_t *common_pool)
{
SVN_ERR(svn_fs__check_fs(fs, FALSE));
@@ -297,7 +303,8 @@ fs_upgrade(svn_fs_t *fs, const char *pat
SVN_ERR(svn_fs_fs__open(fs, path, pool));
SVN_ERR(svn_fs_fs__initialize_caches(fs, pool));
SVN_ERR(fs_serialized_init(fs, common_pool, pool));
- return svn_fs_fs__upgrade(fs, pool);
+ return svn_fs_fs__upgrade(fs, notify_func, notify_baton,
+ cancel_func, cancel_baton, pool);
}
static svn_error_t *
Modified: subversion/branches/verify-keep-going/subversion/libsvn_fs_fs/fs.h
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_fs_fs/fs.h?rev=1501136&r1=1501135&r2=1501136&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_fs_fs/fs.h (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_fs_fs/fs.h Tue Jul 9 08:48:43 2013
@@ -221,7 +221,11 @@ typedef struct fs_fs_shared_data_t
/* Data structure for the 1st level DAG node cache. */
typedef struct fs_fs_dag_cache_t fs_fs_dag_cache_t;
-/* Key type for all caches that use revision + offset / counter as key. */
+/* Key type for all caches that use revision + offset / counter as key.
+
+ NOTE: always initialize this using calloc() or '= {0};'! This is used
+ as a cahe key and the padding bytes on 32 bit archs should be zero for
+ cache effectiveness. */
typedef struct pair_cache_key_t
{
svn_revnum_t revision;
Modified: subversion/branches/verify-keep-going/subversion/libsvn_fs_fs/fs_fs.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_fs_fs/fs_fs.c?rev=1501136&r1=1501135&r2=1501136&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_fs_fs/fs_fs.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_fs_fs/fs_fs.c Tue Jul 9 08:48:43 2013
@@ -1467,10 +1467,15 @@ delete_revprops_shard(const char *shard_
* have no unpacked data anymore. Call upgrade_cleanup_pack_revprops after
* the bump.
*
- * Use SCRATCH_POOL for temporary allocations.
+ * NOTIFY_FUNC and NOTIFY_BATON as well as CANCEL_FUNC and CANCEL_BATON are
+ * used in the usual way. Temporary allocations are done in SCRATCH_POOL.
*/
static svn_error_t *
upgrade_pack_revprops(svn_fs_t *fs,
+ svn_fs_upgrade_notify_t notify_func,
+ void *notify_baton,
+ svn_cancel_func_t cancel_func,
+ void *cancel_baton,
apr_pool_t *scratch_pool)
{
fs_fs_data_t *ffd = fs->fsap_data;
@@ -1503,7 +1508,11 @@ upgrade_pack_revprops(svn_fs_t *fs,
shard, ffd->max_files_per_dir,
(int)(0.9 * ffd->revprop_pack_size),
compression_level,
- NULL, NULL, iterpool));
+ cancel_func, cancel_baton, iterpool));
+ if (notify_func)
+ SVN_ERR(notify_func(notify_baton, shard,
+ svn_fs_upgrade_pack_revprops, iterpool));
+
svn_pool_clear(iterpool);
}
@@ -1513,11 +1522,21 @@ upgrade_pack_revprops(svn_fs_t *fs,
}
/* In the filesystem FS, remove all non-packed revprop shards up to
- * min_unpacked_rev. Use SCRATCH_POOL for temporary allocations.
+ * min_unpacked_rev. Temporary allocations are done in SCRATCH_POOL.
+ *
+ * NOTIFY_FUNC and NOTIFY_BATON as well as CANCEL_FUNC and CANCEL_BATON are
+ * used in the usual way. Cancellation is supported in the sense that we
+ * will cleanly abort the operation. However, there will be remnant shards
+ * that must be removed manually.
+ *
* See upgrade_pack_revprops for more info.
*/
static svn_error_t *
upgrade_cleanup_pack_revprops(svn_fs_t *fs,
+ svn_fs_upgrade_notify_t notify_func,
+ void *notify_baton,
+ svn_cancel_func_t cancel_func,
+ void *cancel_baton,
apr_pool_t *scratch_pool)
{
fs_fs_data_t *ffd = fs->fsap_data;
@@ -1538,7 +1557,11 @@ upgrade_cleanup_pack_revprops(svn_fs_t *
iterpool);
SVN_ERR(delete_revprops_shard(revprops_shard_path,
shard, ffd->max_files_per_dir,
- NULL, NULL, iterpool));
+ cancel_func, cancel_baton, iterpool));
+ if (notify_func)
+ SVN_ERR(notify_func(notify_baton, shard,
+ svn_fs_upgrade_cleanup_revprops, iterpool));
+
svn_pool_clear(iterpool);
}
@@ -1547,10 +1570,22 @@ upgrade_cleanup_pack_revprops(svn_fs_t *
return SVN_NO_ERROR;
}
+/* Baton type bridging svn_fs_fs__upgrade and upgrade_body carrying
+ * parameters over between them. */
+struct upgrade_baton_t
+{
+ svn_fs_t *fs;
+ svn_fs_upgrade_notify_t notify_func;
+ void *notify_baton;
+ svn_cancel_func_t cancel_func;
+ void *cancel_baton;
+};
+
static svn_error_t *
upgrade_body(void *baton, apr_pool_t *pool)
{
- svn_fs_t *fs = baton;
+ struct upgrade_baton_t *upgrade_baton = baton;
+ svn_fs_t *fs = upgrade_baton->fs;
int format, max_files_per_dir;
const char *format_path = path_format(fs, pool);
svn_node_kind_t kind;
@@ -1615,16 +1650,31 @@ upgrade_body(void *baton, apr_pool_t *po
&& max_files_per_dir > 0)
{
needs_revprop_shard_cleanup = TRUE;
- SVN_ERR(upgrade_pack_revprops(fs, pool));
+ SVN_ERR(upgrade_pack_revprops(fs,
+ upgrade_baton->notify_func,
+ upgrade_baton->notify_baton,
+ upgrade_baton->cancel_func,
+ upgrade_baton->cancel_baton,
+ pool));
}
/* Bump the format file. */
SVN_ERR(write_format(format_path, SVN_FS_FS__FORMAT_NUMBER,
max_files_per_dir, TRUE, pool));
+ if (upgrade_baton->notify_func)
+ SVN_ERR(upgrade_baton->notify_func(upgrade_baton->notify_baton,
+ SVN_FS_FS__FORMAT_NUMBER,
+ svn_fs_upgrade_format_bumped,
+ pool));
/* Now, it is safe to remove the redundant revprop files. */
if (needs_revprop_shard_cleanup)
- SVN_ERR(upgrade_cleanup_pack_revprops(fs, pool));
+ SVN_ERR(upgrade_cleanup_pack_revprops(fs,
+ upgrade_baton->notify_func,
+ upgrade_baton->notify_baton,
+ upgrade_baton->cancel_func,
+ upgrade_baton->cancel_baton,
+ pool));
/* Done */
return SVN_NO_ERROR;
@@ -1632,9 +1682,21 @@ upgrade_body(void *baton, apr_pool_t *po
svn_error_t *
-svn_fs_fs__upgrade(svn_fs_t *fs, apr_pool_t *pool)
+svn_fs_fs__upgrade(svn_fs_t *fs,
+ svn_fs_upgrade_notify_t notify_func,
+ void *notify_baton,
+ svn_cancel_func_t cancel_func,
+ void *cancel_baton,
+ apr_pool_t *pool)
{
- return svn_fs_fs__with_write_lock(fs, upgrade_body, (void *)fs, pool);
+ struct upgrade_baton_t baton;
+ baton.fs = fs;
+ baton.notify_func = notify_func;
+ baton.notify_baton = notify_baton;
+ baton.cancel_func = cancel_func;
+ baton.cancel_baton = cancel_baton;
+
+ return svn_fs_fs__with_write_lock(fs, upgrade_body, (void *)&baton, pool);
}
@@ -2282,10 +2344,10 @@ get_cached_node_revision_body(node_revis
}
else
{
- pair_cache_key_t key;
+ pair_cache_key_t key = { 0 };
+
key.revision = svn_fs_fs__id_rev(id);
key.second = svn_fs_fs__id_offset(id);
-
SVN_ERR(svn_cache__get((void **) noderev_p,
is_cached,
ffd->node_revision_cache,
@@ -2311,10 +2373,10 @@ set_cached_node_revision_body(node_revis
if (ffd->node_revision_cache && !svn_fs_fs__id_txn_id(id))
{
- pair_cache_key_t key;
+ pair_cache_key_t key = { 0 };
+
key.revision = svn_fs_fs__id_rev(id);
key.second = svn_fs_fs__id_offset(id);
-
return svn_cache__set(ffd->node_revision_cache,
&key,
noderev_p,
@@ -3246,7 +3308,7 @@ ensure_revprop_generation(svn_fs_t *fs,
SVN_ERR(ensure_revprop_namespace(fs));
if (ffd->revprop_generation == NULL)
{
- apr_int64_t current = 0;
+ apr_int64_t current;
SVN_ERR(svn_named_atomic__get(&ffd->revprop_generation,
ffd->revprop_namespace,
@@ -3573,10 +3635,10 @@ parse_revprop(apr_hash_t **properties,
if (has_revprop_cache(fs, pool))
{
fs_fs_data_t *ffd = fs->fsap_data;
- pair_cache_key_t key;
+ pair_cache_key_t key = { 0 };
+
key.revision = revision;
key.second = generation;
-
SVN_ERR(svn_cache__set(ffd->revprop_cache, &key, *properties,
scratch_pool));
}
@@ -3666,7 +3728,7 @@ get_revprop_packname(svn_fs_t *fs,
if (revprops->manifest->nelts <= idx)
return svn_error_createf(SVN_ERR_FS_CORRUPT, NULL,
- _("Packed revprop manifest for rev %ld too "
+ _("Packed revprop manifest for r%ld too "
"small"), revprops->revision);
/* Now get the file name */
@@ -3839,14 +3901,14 @@ read_pack_revprop(packed_revprops_t **re
/* the file content should be available now */
if (!result->packed_revprops)
return svn_error_createf(SVN_ERR_FS_PACKED_REVPROP_READ_FAILURE, NULL,
- _("Failed to read revprop pack file for rev %ld"), rev);
+ _("Failed to read revprop pack file for r%ld"), rev);
/* parse it. RESULT will be complete afterwards. */
err = parse_packed_revprops(fs, result, pool, iterpool);
svn_pool_destroy(iterpool);
if (err)
return svn_error_createf(SVN_ERR_FS_CORRUPT, err,
- _("Revprop pack file for rev %ld is corrupt"), rev);
+ _("Revprop pack file for r%ld is corrupt"), rev);
*revprops = result;
@@ -3876,7 +3938,7 @@ get_revision_proplist(apr_hash_t **propl
if (has_revprop_cache(fs, pool))
{
svn_boolean_t is_cached;
- pair_cache_key_t key;
+ pair_cache_key_t key = { 0 };
SVN_ERR(read_revprop_generation(&generation, fs, pool));
@@ -5233,12 +5295,12 @@ read_representation(svn_stream_t **conte
else
{
fs_fs_data_t *ffd = fs->fsap_data;
- pair_cache_key_t fulltext_cache_key;
+ pair_cache_key_t fulltext_cache_key = { 0 };
svn_filesize_t len = rep->expanded_size ? rep->expanded_size : rep->size;
struct rep_read_baton *rb;
+
fulltext_cache_key.revision = rep->revision;
fulltext_cache_key.second = rep->offset;
-
if (ffd->fulltext_cache && SVN_IS_VALID_REVNUM(rep->revision)
&& fulltext_size_is_cachable(ffd, len))
{
@@ -5407,10 +5469,10 @@ svn_fs_fs__try_process_file_contents(svn
if (rep)
{
fs_fs_data_t *ffd = fs->fsap_data;
- pair_cache_key_t fulltext_cache_key;
+ pair_cache_key_t fulltext_cache_key = { 0 };
+
fulltext_cache_key.revision = rep->revision;
fulltext_cache_key.second = rep->offset;
-
if (ffd->fulltext_cache && SVN_IS_VALID_REVNUM(rep->revision)
&& fulltext_size_is_cachable(ffd, rep->expanded_size))
{
@@ -5714,10 +5776,10 @@ svn_fs_fs__get_proplist(apr_hash_t **pro
{
fs_fs_data_t *ffd = fs->fsap_data;
representation_t *rep = noderev->prop_rep;
- pair_cache_key_t key;
+ pair_cache_key_t key = { 0 };
+
key.revision = rep->revision;
key.second = rep->offset;
-
if (ffd->properties_cache && SVN_IS_VALID_REVNUM(rep->revision))
{
svn_boolean_t is_cached;
@@ -8229,12 +8291,9 @@ write_final_changed_path_info(apr_off_t
sorted_changed_paths = svn_sort__hash(changed_paths,
svn_sort_compare_items_lexically, pool);
- /* Iterate through the changed paths one at a time, and convert the
- temporary node-id into a permanent one for each change entry. */
+ /* Write all items to disk in the new order. */
for (i = 0; i < sorted_changed_paths->nelts; ++i)
{
- node_revision_t *noderev;
- const svn_fs_id_t *id;
svn_fs_path_change2_t *change;
const char *path;
@@ -8243,21 +8302,6 @@ write_final_changed_path_info(apr_off_t
change = APR_ARRAY_IDX(sorted_changed_paths, i, svn_sort__item_t).value;
path = APR_ARRAY_IDX(sorted_changed_paths, i, svn_sort__item_t).key;
- id = change->node_rev_id;
-
- /* If this was a delete of a mutable node, then it is OK to
- leave the change entry pointing to the non-existent temporary
- node, since it will never be used. */
- if ((change->change_kind != svn_fs_path_change_delete) &&
- (! svn_fs_fs__id_txn_id(id)))
- {
- SVN_ERR(svn_fs_fs__get_node_revision(&noderev, fs, id, iterpool));
-
- /* noderev has the permanent node-id at this point, so we just
- substitute it for the temporary one. */
- change->node_rev_id = noderev->id;
- }
-
/* Write out the new entry into the final rev-file. */
SVN_ERR(write_change_entry(file, path, change, include_node_kinds,
iterpool));
@@ -10235,13 +10279,31 @@ pack_shard(const char *revs_dir,
(svn_revnum_t)((shard + 1) * max_files_per_dir),
pool));
- /* Finally, remove the existing shard directories. */
+ /* Finally, remove the existing shard directories.
+ * For revprops, clean up older obsolete shards as well as they might
+ * have been left over from an interrupted FS upgrade. */
SVN_ERR(svn_io_remove_dir2(rev_shard_path, TRUE,
cancel_func, cancel_baton, pool));
if (revsprops_dir)
- SVN_ERR(delete_revprops_shard(revprops_shard_path,
- shard, max_files_per_dir,
- cancel_func, cancel_baton, pool));
+ {
+ svn_node_kind_t kind = svn_node_dir;
+ apr_int64_t to_cleanup = shard;
+ do
+ {
+ SVN_ERR(delete_revprops_shard(revprops_shard_path,
+ to_cleanup, max_files_per_dir,
+ cancel_func, cancel_baton, pool));
+
+ /* If the previous shard exists, clean it up as well.
+ Don't try to clean up shard 0 as it we can't tell quickly
+ whether it actually needs cleaning up. */
+ revprops_shard_path = svn_dirent_join(revsprops_dir,
+ apr_psprintf(pool, "%" APR_INT64_T_FMT, --to_cleanup),
+ pool);
+ SVN_ERR(svn_io_check_path(revprops_shard_path, &kind, pool));
+ }
+ while (kind == svn_node_dir && to_cleanup > 0);
+ }
/* Notify caller we're starting to pack this shard. */
if (notify_func)
Modified: subversion/branches/verify-keep-going/subversion/libsvn_fs_fs/fs_fs.h
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_fs_fs/fs_fs.h?rev=1501136&r1=1501135&r2=1501136&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_fs_fs/fs_fs.h (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_fs_fs/fs_fs.h Tue Jul 9 08:48:43 2013
@@ -34,8 +34,15 @@ svn_error_t *svn_fs_fs__open(svn_fs_t *f
const char *path,
apr_pool_t *pool);
-/* Upgrade the fsfs filesystem FS. Use POOL for temporary allocations. */
+/* Upgrade the fsfs filesystem FS. Indicate progress via the optional
+ * NOTIFY_FUNC callback using NOTIFY_BATON. The optional CANCEL_FUNC
+ * will periodically be called with CANCEL_BATON to allow for preemption.
+ * Use POOL for temporary allocations. */
svn_error_t *svn_fs_fs__upgrade(svn_fs_t *fs,
+ svn_fs_upgrade_notify_t notify_func,
+ void *notify_baton,
+ svn_cancel_func_t cancel_func,
+ void *cancel_baton,
apr_pool_t *pool);
/* Verify metadata in fsfs filesystem FS. Limit the checks to revisions
Modified: subversion/branches/verify-keep-going/subversion/libsvn_fs_fs/tree.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_fs_fs/tree.c?rev=1501136&r1=1501135&r2=1501136&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_fs_fs/tree.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_fs_fs/tree.c Tue Jul 9 08:48:43 2013
@@ -151,7 +151,7 @@ typedef struct cache_entry_t
{
/* hash value derived from PATH, REVISION.
Used to short-circuit failed lookups. */
- long int hash_value;
+ apr_uint32_t hash_value;
/* revision to which the NODE belongs */
svn_revnum_t revision;
@@ -340,10 +340,12 @@ cache_lookup( fs_fs_dag_cache_t *cache
{
apr_size_t i, bucket_index;
apr_size_t path_len = strlen(path);
- long int hash_value = revision;
+ apr_uint32_t hash_value = (apr_uint32_t)revision;
+#if SVN_UNALIGNED_ACCESS_IS_OK
/* "randomizing" / distributing factor used in our hash function */
- enum { factor = 0xd1f3da69 };
+ const apr_uint32_t factor = 0xd1f3da69;
+#endif
/* optimistic lookup: hit the same bucket again? */
cache_entry_t *result = &cache->buckets[cache->last_hit];
@@ -355,7 +357,28 @@ cache_lookup( fs_fs_dag_cache_t *cache
}
/* need to do a full lookup. Calculate the hash value
- (HASH_VALUE has been initialized to REVISION). */
+ (HASH_VALUE has been initialized to REVISION).
+
+ Note that the actual hash function is arbitrary as long as its result
+ in HASH_VALUE only depends on REVISION and *PATH. However, we try to
+ make as much of *PATH influence the result as possible to get an "even"
+ spread across the hash buckets (maximizes our cache retention rate and
+ thus the hit rates).
+
+ When chunked access is possible (independent of the PATH pointer's
+ value!), we read 4 bytes at once and multiply the hash value with a
+ FACTOR that mirror / pattern / shift all 4 input bytes to various bits
+ of the result. The final result will be taken from the MSBs.
+
+ When chunked access is not possible (not supported by CPU or odd bytes
+ at the end of *PATH), we use the simple traditional "* 33" hash
+ function that works very well with texts / paths and that e.g. APR uses.
+
+ Please note that the bytewise and the chunked calculation are *NOT*
+ interchangeable as they will yield different results for the same input.
+ For any given machine and *PATH, we must use a fixed combination of the
+ two functions.
+ */
i = 0;
#if SVN_UNALIGNED_ACCESS_IS_OK
/* We relax the dependency chain between iterations by processing
@@ -365,23 +388,8 @@ cache_lookup( fs_fs_dag_cache_t *cache
*/
for (; i + 8 <= path_len; i += 8)
hash_value = hash_value * factor * factor
- + ( (long int)*(const apr_uint32_t*)(path + i) * factor
- + (long int)*(const apr_uint32_t*)(path + i + 4));
-#else
- for (; i + 4 <= path_len; i += 4)
- {
- /* read the data in BIG-ENDIAN order
- (it's just simpler code and most of the machines in question are
- actually big endian) */
- apr_uint32_t val = 0;
- int j;
-
- /* most compilers will unroll this loop: */
- for (j = 0; j < 4; j++)
- val = (val << 8) + (unsigned char)path[i + j];
-
- hash_value = hash_value * factor + val;
- }
+ + ( *(const apr_uint32_t*)(path + i) * factor
+ + *(const apr_uint32_t*)(path + i + 4));
#endif
for (; i < path_len; ++i)
Modified: subversion/branches/verify-keep-going/subversion/libsvn_ra/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_ra/util.c?rev=1501136&r1=1501135&r2=1501136&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_ra/util.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_ra/util.c Tue Jul 9 08:48:43 2013
@@ -38,6 +38,26 @@
#include "svn_private_config.h"
#include "private/svn_ra_private.h"
+static const char *
+get_path(const char *path_or_url,
+ svn_ra_session_t *ra_session,
+ apr_pool_t *pool)
+{
+ if (path_or_url == NULL)
+ {
+ svn_error_t *err = svn_ra_get_session_url(ra_session, &path_or_url,
+ pool);
+ if (err)
+ {
+ /* The SVN_ERR_UNSUPPORTED_FEATURE error in the caller is more
+ important, so dummy up the session's URL and chuck this error. */
+ svn_error_clear(err);
+ return _("<repository>");
+ }
+ }
+ return path_or_url;
+}
+
svn_error_t *
svn_ra__assert_mergeinfo_capable_server(svn_ra_session_t *ra_session,
const char *path_or_url,
@@ -48,18 +68,7 @@ svn_ra__assert_mergeinfo_capable_server(
SVN_RA_CAPABILITY_MERGEINFO, pool));
if (! mergeinfo_capable)
{
- if (path_or_url == NULL)
- {
- svn_error_t *err = svn_ra_get_session_url(ra_session, &path_or_url,
- pool);
- if (err)
- {
- /* The SVN_ERR_UNSUPPORTED_FEATURE error is more important,
- so dummy up the session's URL and chuck this error. */
- svn_error_clear(err);
- path_or_url = "<repository>";
- }
- }
+ path_or_url = get_path(path_or_url, ra_session, pool);
return svn_error_createf(SVN_ERR_UNSUPPORTED_FEATURE, NULL,
_("Retrieval of mergeinfo unsupported by '%s'"),
svn_path_is_url(path_or_url)
@@ -84,12 +93,16 @@ svn_ra__assert_capable_server(svn_ra_ses
svn_boolean_t has;
SVN_ERR(svn_ra_has_capability(ra_session, &has, capability, pool));
if (! has)
- return svn_error_createf(SVN_ERR_UNSUPPORTED_FEATURE, NULL,
- _("The '%s' feature is not supported by '%s'"),
- capability,
- svn_path_is_url(path_or_url)
- ? path_or_url
- : svn_dirent_local_style(path_or_url, pool));
+ {
+ path_or_url = get_path(path_or_url, ra_session, pool);
+ return svn_error_createf(SVN_ERR_UNSUPPORTED_FEATURE, NULL,
+ _("The '%s' feature is not supported by '%s'"),
+ capability,
+ svn_path_is_url(path_or_url)
+ ? path_or_url
+ : svn_dirent_local_style(path_or_url,
+ pool));
+ }
}
return SVN_NO_ERROR;
}
Modified: subversion/branches/verify-keep-going/subversion/libsvn_ra_local/ra_local.h
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_ra_local/ra_local.h?rev=1501136&r1=1501135&r2=1501136&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_ra_local/ra_local.h (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_ra_local/ra_local.h Tue Jul 9 08:48:43 2013
@@ -62,6 +62,8 @@ typedef struct svn_ra_local__session_bat
/* Callbacks/baton passed to svn_ra_open. */
const svn_ra_callbacks2_t *callbacks;
void *callback_baton;
+
+ const char *useragent;
} svn_ra_local__session_baton_t;