You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ar...@apache.org on 2011/07/20 15:06:16 UTC
svn commit: r1148749 [5/11] - in /subversion/branches/svn-bisect: ./ build/
build/ac-macros/ build/generator/ build/generator/templates/
contrib/hook-scripts/ contrib/hook-scripts/enforcer/ contrib/server-side/
contrib/server-side/fsfsfixer/fixer/ note...
Modified: subversion/branches/svn-bisect/subversion/libsvn_fs_fs/structure
URL: http://svn.apache.org/viewvc/subversion/branches/svn-bisect/subversion/libsvn_fs_fs/structure?rev=1148749&r1=1148748&r2=1148749&view=diff
==============================================================================
--- subversion/branches/svn-bisect/subversion/libsvn_fs_fs/structure (original)
+++ subversion/branches/svn-bisect/subversion/libsvn_fs_fs/structure Wed Jul 20 13:06:00 2011
@@ -34,12 +34,13 @@ repository) is:
revs/ Subdirectory containing revs
<shard>/ Shard directory, if sharding is in use (see below)
<revnum> File containing rev <revnum>
- <shard>.pack Pack directory, if the repo has been packed (see below)
+ <shard>.pack/ Pack directory, if the repo has been packed (see below)
pack Pack file, if the repository has been packed (see below)
manifest Pack manifest file, if a pack file exists (see below)
revprops/ Subdirectory containing rev-props
<shard>/ Shard directory, if sharding is in use (see below)
<revnum> File containing rev-props for <revnum>
+ revprops.db SQLite database of the packed revision properties
transactions/ Subdirectory containing transactions
<txnid>.txn/ Directory containing transaction <txnid>
txn-protorevs/ Subdirectory containing transaction proto-revision files
@@ -61,7 +62,6 @@ repository) is:
min-unpacked-rev File containing the oldest revision not in a pack file
min-unpacked-revprop File containing the oldest revision of unpacked revprop
rep-cache.db SQLite database mapping rep checksums to locations
- revprops.db SQLite database of the packed revision properties
Files in the revprops directory are in the hash dump format used by
svn_hash_write.
@@ -102,8 +102,10 @@ When representation sharing is enabled,
representation checksum and location mappings using a SQLite database in
"rep-cache.db". The database has a single table, which stores the sha1
hash text as the primary key, mapped to the representation revision, offset,
-size and expanded size. This file is not required, and may be removed at an
-abritrary time, with the subsequent loss of rep-sharing capabilities.
+size and expanded size. This file is only consulted during writes and never
+during reads. Consequently, it is not required, and may be removed at an
+abritrary time, with the subsequent loss of rep-sharing capabilities for
+revisions written thereafter.
Filesystem formats
------------------
@@ -131,45 +133,47 @@ The formats are:
Format 2, understood by Subversion 1.4+
Format 3, understood by Subversion 1.5+
Format 4, understood by Subversion 1.6+
- Format 5, understood by Subversion 1.7+
+ Format 5, understood by Subversion 1.7-dev, never released
The differences between the formats are:
Delta representation in revision files
Format 1: svndiff0 only
- Formats 2-5: svndiff0 or svndiff1
+ Formats 2+: svndiff0 or svndiff1
Format options
Formats 1-2: none permitted
- Format 3-5: "layout" option
+ Format 3+: "layout" option
Transaction name reuse
Formats 1-2: transaction names may be reused
- Format 3-5: transaction names generated using txn-current file
+ Format 3+: transaction names generated using txn-current file
Location of proto-rev file and its lock
Formats 1-2: transactions/<txnid>/rev and
transactions/<txnid>/rev-lock.
- Format 3-5: txn-protorevs/<txnid>.rev and
+ Format 3+: txn-protorevs/<txnid>.rev and
txn-protorevs/<txnid>.rev-lock.
Node-ID and copy-ID generation
Formats 1-2: Node-IDs and copy-IDs are guaranteed to form a
monotonically increasing base36 sequence using the "current"
file.
- Format 3-5: Node-IDs and copy-IDs use the new revision number to
+ Format 3+: Node-IDs and copy-IDs use the new revision number to
ensure uniqueness and the "current" file just contains the
youngest revision.
Mergeinfo metadata:
Format 1-2: minfo-here and minfo-count node-revision fields are not
stored. svn_fs_get_mergeinfo returns an error.
- Format 3-5: minfo-here and minfo-count node-revision fields are
+ Format 3+: minfo-here and minfo-count node-revision fields are
maintained. svn_fs_get_mergeinfo works.
Revision changed paths list:
Format 1-3: Does not contain the node's kind.
- Format 4-5: Contains the node's kind.
+ Format 4+: Contains the node's kind.
+
+# Incomplete list. See SVN_FS_FS__MIN_*_FORMAT
Filesystem format options
@@ -205,10 +209,10 @@ The known layouts, and the parameters th
revs/0/ directory will contain revisions 0-999, revs/1/ will contain
1000-1999, and so on.
-Packing
--------
+Packing revisions
+-----------------
-A repository can optionally be "packed" to conserve space on disk. The
+A filesystem can optionally be "packed" to conserve space on disk. The
packing process concatenates all the revision files in each full shard to
create pack files. A manifest file is also created for each shard which
records the indexes of the corresponding revision files in the pack file.
@@ -219,6 +223,15 @@ The manifest file consists of a list of
pack file. The offsets are stored as ASCII decimal, and separated by a newline
character.
+Packing revision properties (format 5: SQLite)
+---------------------------
+
+This was supported by 1.7-dev builds but never included in a blessed release.
+
+See r1143829 of this file:
+http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_fs_fs/structure?view=markup&pathrev=1143829
+
+
Node-revision IDs
-----------------
Propchange: subversion/branches/svn-bisect/subversion/libsvn_fs_fs/temp_serializer.c
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Jul 20 13:06:00 2011
@@ -1 +1,2 @@
-/subversion/trunk/subversion/libsvn_fs_fs/temp_serializer.c:1067687-1072301
+/subversion/branches/revprop-packing/subversion/libsvn_fs_fs/temp_serializer.c:1143907,1143971,1144017,1144568,1146145
+/subversion/trunk/subversion/libsvn_fs_fs/temp_serializer.c:1067687-1072301,1140046-1148712
Propchange: subversion/branches/svn-bisect/subversion/libsvn_fs_fs/temp_serializer.h
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Jul 20 13:06:00 2011
@@ -1 +1,2 @@
-/subversion/trunk/subversion/libsvn_fs_fs/temp_serializer.h:1067687-1072301
+/subversion/branches/revprop-packing/subversion/libsvn_fs_fs/temp_serializer.h:1143907,1143971,1144017,1144568,1146145
+/subversion/trunk/subversion/libsvn_fs_fs/temp_serializer.h:1067687-1072301,1140046-1148712
Modified: subversion/branches/svn-bisect/subversion/libsvn_fs_fs/tree.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-bisect/subversion/libsvn_fs_fs/tree.c?rev=1148749&r1=1148748&r2=1148749&view=diff
==============================================================================
--- subversion/branches/svn-bisect/subversion/libsvn_fs_fs/tree.c (original)
+++ subversion/branches/svn-bisect/subversion/libsvn_fs_fs/tree.c Wed Jul 20 13:06:00 2011
@@ -2110,7 +2110,7 @@ fs_copy(svn_fs_root_t *from_root,
apr_pool_t *pool)
{
return svn_error_trace(copy_helper(from_root, from_path, to_root, to_path,
- TRUE, pool));
+ TRUE, pool));
}
@@ -2127,7 +2127,7 @@ fs_revision_link(svn_fs_root_t *from_roo
return SVN_FS__NOT_TXN(to_root);
return svn_error_trace(copy_helper(from_root, path, to_root, path,
- FALSE, pool));
+ FALSE, pool));
}
@@ -3105,7 +3105,6 @@ history_prev(void *baton, apr_pool_t *po
dag_node_t *node;
svn_fs_root_t *root;
svn_boolean_t reported = fhd->is_interesting;
- svn_boolean_t retry = FALSE;
svn_revnum_t copyroot_rev;
const char *copyroot_path;
@@ -3224,6 +3223,8 @@ history_prev(void *baton, apr_pool_t *po
'copy-style' history object. */
if (src_path && SVN_IS_VALID_REVNUM(src_rev))
{
+ svn_boolean_t retry = FALSE;
+
/* It's possible for us to find a copy location that is the same
as the history point we've just reported. If that happens,
we simply need to take another trip through this history
Modified: subversion/branches/svn-bisect/subversion/libsvn_ra/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-bisect/subversion/libsvn_ra/deprecated.c?rev=1148749&r1=1148748&r2=1148749&view=diff
==============================================================================
--- subversion/branches/svn-bisect/subversion/libsvn_ra/deprecated.c (original)
+++ subversion/branches/svn-bisect/subversion/libsvn_ra/deprecated.c Wed Jul 20 13:06:00 2011
@@ -426,10 +426,8 @@ svn_error_t *svn_ra_get_mergeinfo(svn_ra
svn_boolean_t include_descendants,
apr_pool_t *pool)
{
- svn_boolean_t validate_inherited_mergeinfo = FALSE;
-
return svn_error_trace(svn_ra_get_mergeinfo2(session, catalog, paths,
- revision, inherit, &validate_inherited_mergeinfo,
+ revision, inherit, FALSE,
include_descendants, pool));
}
Modified: subversion/branches/svn-bisect/subversion/libsvn_ra/ra_loader.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-bisect/subversion/libsvn_ra/ra_loader.c?rev=1148749&r1=1148748&r2=1148749&view=diff
==============================================================================
--- subversion/branches/svn-bisect/subversion/libsvn_ra/ra_loader.c (original)
+++ subversion/branches/svn-bisect/subversion/libsvn_ra/ra_loader.c Wed Jul 20 13:06:00 2011
@@ -201,14 +201,13 @@ load_ra_module(svn_ra__init_func_t *func
return SVN_NO_ERROR;
}
-/* If DEFN may support URL, return the scheme. Else, return NULL. */
+/* If SCHEMES contains URL, return the scheme. Else, return NULL. */
static const char *
-has_scheme_of(const struct ra_lib_defn *defn, const char *url)
+has_scheme_of(const char * const *schemes, const char *url)
{
- const char * const *schemes;
apr_size_t len;
- for (schemes = defn->schemes; *schemes != NULL; ++schemes)
+ for ( ; *schemes != NULL; ++schemes)
{
const char *scheme = *schemes;
len = strlen(scheme);
@@ -454,7 +453,7 @@ svn_error_t *svn_ra_open4(svn_ra_session
{
const char *scheme;
- if ((scheme = has_scheme_of(defn, repos_URL)))
+ if ((scheme = has_scheme_of(defn->schemes, repos_URL)))
{
svn_ra__init_func_t initfunc = defn->initfunc;
@@ -475,6 +474,11 @@ svn_error_t *svn_ra_open4(svn_ra_session
SVN_ERR(check_ra_version(vtable->get_version(), scheme));
+ if (! has_scheme_of(vtable->get_schemes(sesspool), repos_URL))
+ /* Library doesn't support the scheme at runtime. */
+ continue;
+
+
break;
}
}
@@ -771,7 +775,7 @@ svn_error_t *svn_ra_get_mergeinfo2(svn_r
const apr_array_header_t *paths,
svn_revnum_t revision,
svn_mergeinfo_inheritance_t inherit,
- svn_boolean_t *validate_inherited_mergeinfo,
+ svn_boolean_t validate_inherited_mergeinfo,
svn_boolean_t include_descendants,
apr_pool_t *pool)
{
@@ -1332,7 +1336,7 @@ svn_ra_get_ra_library(svn_ra_plugin_t **
for (defn = ra_libraries; defn->ra_name != NULL; ++defn)
{
const char *scheme;
- if ((scheme = has_scheme_of(defn, url)))
+ if ((scheme = has_scheme_of(defn->schemes, url)))
{
svn_ra_init_func_t compat_initfunc = defn->compat_initfunc;
Modified: subversion/branches/svn-bisect/subversion/libsvn_ra/ra_loader.h
URL: http://svn.apache.org/viewvc/subversion/branches/svn-bisect/subversion/libsvn_ra/ra_loader.h?rev=1148749&r1=1148748&r2=1148749&view=diff
==============================================================================
--- subversion/branches/svn-bisect/subversion/libsvn_ra/ra_loader.h (original)
+++ subversion/branches/svn-bisect/subversion/libsvn_ra/ra_loader.h Wed Jul 20 13:06:00 2011
@@ -131,7 +131,7 @@ typedef struct svn_ra__vtable_t {
const apr_array_header_t *paths,
svn_revnum_t revision,
svn_mergeinfo_inheritance_t inherit,
- svn_boolean_t *validate_inherited_mergeinfo,
+ svn_boolean_t validate_inherited_mergeinfo,
svn_boolean_t include_merged_revisions,
apr_pool_t *pool);
/* See svn_ra_do_update2(). */
Modified: subversion/branches/svn-bisect/subversion/libsvn_ra_local/ra_plugin.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-bisect/subversion/libsvn_ra_local/ra_plugin.c?rev=1148749&r1=1148748&r2=1148749&view=diff
==============================================================================
--- subversion/branches/svn-bisect/subversion/libsvn_ra_local/ra_plugin.c (original)
+++ subversion/branches/svn-bisect/subversion/libsvn_ra_local/ra_plugin.c Wed Jul 20 13:06:00 2011
@@ -238,6 +238,15 @@ static const svn_ra_reporter3_t ra_local
};
+/* ...
+ *
+ * Wrap a cancellation editor using SESSION's cancellation function around
+ * the supplied EDITOR. ### Some callers (via svn_ra_do_update2() etc.)
+ * don't appear to know that we do this, and are supplying an editor that
+ * they have already wrapped with the same cancellation editor, so it ends
+ * up double-wrapped.
+ *
+ * ... */
static svn_error_t *
make_reporter(svn_ra_session_t *session,
const svn_ra_reporter3_t **reporter,
@@ -256,7 +265,6 @@ make_reporter(svn_ra_session_t *session,
svn_ra_local__session_baton_t *sess = session->priv;
void *rbaton;
const char *other_fs_path = NULL;
- const char *repos_url_decoded;
/* Get the HEAD revision if one is not supplied. */
if (! SVN_IS_VALID_REVNUM(revision))
@@ -266,22 +274,19 @@ make_reporter(svn_ra_session_t *session,
regular filesystem path. */
if (other_url)
{
- size_t repos_url_len;
-
- other_url = svn_path_uri_decode(other_url, pool);
- repos_url_decoded = svn_path_uri_decode(sess->repos_url, pool);
- repos_url_len = strlen(repos_url_decoded);
+ const char *other_relpath
+ = svn_uri_skip_ancestor(sess->repos_url, other_url, pool);
/* Sanity check: the other_url better be in the same repository as
the original session url! */
- if (strncmp(other_url, repos_url_decoded, repos_url_len) != 0)
+ if (! other_relpath)
return svn_error_createf
(SVN_ERR_RA_ILLEGAL_URL, NULL,
_("'%s'\n"
"is not the same repository as\n"
"'%s'"), other_url, sess->repos_url);
- other_fs_path = other_url + repos_url_len;
+ other_fs_path = apr_pstrcat(pool, "/", other_relpath, (char *)NULL);
}
/* Pass back our reporter */
@@ -700,7 +705,7 @@ svn_ra_local__get_mergeinfo(svn_ra_sessi
const apr_array_header_t *paths,
svn_revnum_t revision,
svn_mergeinfo_inheritance_t inherit,
- svn_boolean_t *validate_inherited_mergeinfo,
+ svn_boolean_t validate_inherited_mergeinfo,
svn_boolean_t include_descendants,
apr_pool_t *pool)
{
@@ -719,7 +724,7 @@ svn_ra_local__get_mergeinfo(svn_ra_sessi
SVN_ERR(svn_repos_fs_get_mergeinfo2(&tmp_catalog, sess->repos, abs_paths,
revision, inherit,
- *validate_inherited_mergeinfo,
+ validate_inherited_mergeinfo,
include_descendants,
NULL, NULL, pool));
if (apr_hash_count(tmp_catalog) > 0)
@@ -1422,7 +1427,9 @@ svn_ra_local__has_capability(svn_ra_sess
{
*has = TRUE;
}
- else if (strcmp(capability, SVN_RA_CAPABILITY_MERGEINFO) == 0)
+ else if ((strcmp(capability, SVN_RA_CAPABILITY_MERGEINFO) == 0)
+ || (strcmp(capability,
+ SVN_RA_CAPABILITY_VALIDATE_INHERITED_MERGEINFO) == 0))
{
/* With mergeinfo, the code's capabilities may not reflect the
repository's, so inquire further. */
Modified: subversion/branches/svn-bisect/subversion/libsvn_ra_neon/commit.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-bisect/subversion/libsvn_ra_neon/commit.c?rev=1148749&r1=1148748&r2=1148749&view=diff
==============================================================================
--- subversion/branches/svn-bisect/subversion/libsvn_ra_neon/commit.c (original)
+++ subversion/branches/svn-bisect/subversion/libsvn_ra_neon/commit.c Wed Jul 20 13:06:00 2011
@@ -603,11 +603,11 @@ static svn_error_t * do_proppatch(resour
apr_psprintf(pool, "(<%s>)", rb->token));
return svn_error_trace(svn_ra_neon__do_proppatch(rb->cc->ras,
- proppatch_target,
- rb->prop_changes,
- rb->prop_deletes,
- NULL, extra_headers,
- pool));
+ proppatch_target,
+ rb->prop_changes,
+ rb->prop_deletes,
+ NULL, extra_headers,
+ pool));
}
@@ -710,8 +710,8 @@ apply_revprops(commit_ctx_t *cc,
}
return svn_error_trace(svn_ra_neon__do_proppatch(cc->ras, proppatch_url,
- cc->revprop_table,
- NULL, NULL, NULL, pool));
+ cc->revprop_table,
+ NULL, NULL, NULL, pool));
}
Modified: subversion/branches/svn-bisect/subversion/libsvn_ra_neon/fetch.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-bisect/subversion/libsvn_ra_neon/fetch.c?rev=1148749&r1=1148748&r2=1148749&view=diff
==============================================================================
--- subversion/branches/svn-bisect/subversion/libsvn_ra_neon/fetch.c (original)
+++ subversion/branches/svn-bisect/subversion/libsvn_ra_neon/fetch.c Wed Jul 20 13:06:00 2011
@@ -249,27 +249,6 @@ static svn_error_t *simple_store_vsn_url
return NULL;
}
-static svn_error_t *get_delta_base(const char **delta_base,
- const char *relpath,
- svn_ra_get_wc_prop_func_t get_wc_prop,
- void *cb_baton,
- apr_pool_t *pool)
-{
- const svn_string_t *value;
-
- if (relpath == NULL || get_wc_prop == NULL)
- {
- *delta_base = NULL;
- return SVN_NO_ERROR;
- }
-
- SVN_ERR((*get_wc_prop)(cb_baton, relpath, SVN_RA_NEON__LP_VSN_URL,
- &value, pool));
-
- *delta_base = value ? value->data : NULL;
- return SVN_NO_ERROR;
-}
-
/* helper func which maps certain DAV: properties to svn:wc:
properties. Used during checkouts and updates. */
static svn_error_t *set_special_wc_prop(const char *key,
@@ -355,7 +334,7 @@ static svn_error_t *add_props(apr_hash_t
static svn_error_t *custom_get_request(svn_ra_neon__session_t *ras,
const char *url,
- const char *relpath,
+ const char *editor_relpath,
svn_ra_neon__block_reader reader,
void *subctx,
svn_ra_get_wc_prop_func_t get_wc_prop,
@@ -364,21 +343,26 @@ static svn_error_t *custom_get_request(s
apr_pool_t *pool)
{
custom_get_ctx_t cgc = { 0 };
- const char *delta_base;
+ const char *delta_base = NULL;
svn_ra_neon__request_t *request;
svn_error_t *err;
- if (use_base)
+ if (use_base && editor_relpath != NULL)
{
/* See if we can get a version URL for this resource. This will
refer to what we already have in the working copy, thus we
can get a diff against this particular resource. */
- SVN_ERR(get_delta_base(&delta_base, relpath,
- get_wc_prop, cb_baton, pool));
- }
- else
- {
- delta_base = NULL;
+
+ if (get_wc_prop != NULL)
+ {
+ const svn_string_t *value;
+
+ SVN_ERR(get_wc_prop(cb_baton, editor_relpath,
+ SVN_RA_NEON__LP_VSN_URL,
+ &value, pool));
+
+ delta_base = value ? value->data : NULL;
+ }
}
SVN_ERR(svn_ra_neon__request_create(&request, ras, "GET", url, pool));
@@ -2056,8 +2040,7 @@ end_element(void *userdata, int state,
rb->file_baton,
NULL, /* no base checksum in an add */
rb->editor,
- rb->ras->callbacks->get_wc_prop,
- rb->ras->callback_baton,
+ NULL, NULL, /* dav_prop callback */
rb->file_pool));
/* fetch node props as necessary. */
@@ -2290,7 +2273,8 @@ static svn_error_t * reporter_set_path(v
"%s</S:entry>" DEBUG_CR,
revision, depthstring, tokenstring, qpath->data);
- return svn_io_file_write_full(rb->tmpfile, entry, strlen(entry), NULL, pool);
+ return svn_error_trace(svn_io_file_write_full(rb->tmpfile, entry,
+ strlen(entry), NULL, pool));
}
@@ -2343,7 +2327,8 @@ static svn_error_t * reporter_link_path(
revision, depthstring, tokenstring,
qlinkpath->data, qpath->data);
- return svn_io_file_write_full(rb->tmpfile, entry, strlen(entry), NULL, pool);
+ return svn_error_trace(svn_io_file_write_full(rb->tmpfile, entry,
+ strlen(entry), NULL, pool));
}
@@ -2360,7 +2345,8 @@ static svn_error_t * reporter_delete_pat
"<S:missing>%s</S:missing>" DEBUG_CR,
qpath->data);
- return svn_io_file_write_full(rb->tmpfile, s, strlen(s), NULL, pool);
+ return svn_error_trace(svn_io_file_write_full(rb->tmpfile, s, strlen(s),
+ NULL, pool));
}
@@ -2369,7 +2355,7 @@ static svn_error_t * reporter_abort_repo
{
report_baton_t *rb = report_baton;
- (void) apr_file_close(rb->tmpfile);
+ SVN_ERR(svn_io_file_close(rb->tmpfile, pool));
return SVN_NO_ERROR;
}
@@ -2414,8 +2400,10 @@ static svn_error_t * reporter_finish_rep
/* We're done with the file. this should delete it. Note: it
isn't a big deal if this line is never executed -- the pool
will eventually get it. We're just being proactive here. */
- (void) apr_file_close(rb->tmpfile);
- return err;
+ return svn_error_trace(
+ svn_error_compose_create(err,
+ svn_io_file_close(rb->tmpfile,
+ pool)));
}
/* dispatch the REPORT. */
@@ -2429,17 +2417,16 @@ static svn_error_t * reporter_finish_rep
rb->spool_response, pool);
/* We're done with the file. Proactively close/delete the thing. */
- (void) apr_file_close(rb->tmpfile);
-
- SVN_ERR(err);
+ SVN_ERR(svn_error_compose_create(err,
+ svn_io_file_close(rb->tmpfile, pool)));
/* We got the whole HTTP response thing done. *Whew*. Our edit
baton should have been closed by now, so return a failure if it
hasn't been. */
if (rb->edit_baton)
{
- return svn_error_createf
- (SVN_ERR_RA_DAV_REQUEST_FAILED, NULL,
+ return svn_error_createf(
+ SVN_ERR_RA_DAV_REQUEST_FAILED, NULL,
_("REPORT response handling failed to complete the editor drive"));
}
Modified: subversion/branches/svn-bisect/subversion/libsvn_ra_neon/mergeinfo.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-bisect/subversion/libsvn_ra_neon/mergeinfo.c?rev=1148749&r1=1148748&r2=1148749&view=diff
==============================================================================
--- subversion/branches/svn-bisect/subversion/libsvn_ra_neon/mergeinfo.c (original)
+++ subversion/branches/svn-bisect/subversion/libsvn_ra_neon/mergeinfo.c Wed Jul 20 13:06:00 2011
@@ -51,7 +51,6 @@ struct mergeinfo_baton
svn_stringbuf_t *curr_path;
svn_stringbuf_t *curr_info;
svn_mergeinfo_catalog_t catalog;
- svn_boolean_t validated_inherited_mergeinfo;
svn_error_t *err;
};
@@ -63,8 +62,6 @@ static const svn_ra_neon__xml_elm_t merg
SVN_RA_NEON__XML_CDATA },
{ SVN_XML_NAMESPACE, SVN_DAV__MERGEINFO_INFO, ELEM_mergeinfo_info,
SVN_RA_NEON__XML_CDATA },
- { SVN_XML_NAMESPACE, SVN_DAV__VALIDATE_INHERITED,
- ELEM_validate_inherited_mergeinfo, SVN_RA_NEON__XML_CDATA },
{ NULL }
};
@@ -96,10 +93,6 @@ start_element(int *elem, void *baton, in
svn_stringbuf_setempty(mb->curr_info);
svn_stringbuf_setempty(mb->curr_path);
}
- else if (elm->id == ELEM_validate_inherited_mergeinfo)
- {
- mb->validated_inherited_mergeinfo = TRUE;
- }
SVN_ERR(mb->err);
@@ -170,7 +163,7 @@ svn_ra_neon__get_mergeinfo(svn_ra_sessio
const apr_array_header_t *paths,
svn_revnum_t revision,
svn_mergeinfo_inheritance_t inherit,
- svn_boolean_t *validate_inherited_mergeinfo,
+ svn_boolean_t validate_inherited_mergeinfo,
svn_boolean_t include_descendants,
apr_pool_t *pool)
{
@@ -202,7 +195,7 @@ svn_ra_neon__get_mergeinfo(svn_ra_sessio
"</S:inherit>",
svn_inheritance_to_word(inherit)));
- if (*validate_inherited_mergeinfo)
+ if (validate_inherited_mergeinfo)
{
/* Send it only if true; server will default to "no". */
svn_stringbuf_appendcstr(request_body,
@@ -240,7 +233,6 @@ svn_ra_neon__get_mergeinfo(svn_ra_sessio
mb.curr_path = svn_stringbuf_create("", pool);
mb.curr_info = svn_stringbuf_create("", pool);
mb.catalog = apr_hash_make(pool);
- mb.validated_inherited_mergeinfo = FALSE;
mb.err = SVN_NO_ERROR;
/* ras's URL may not exist in HEAD, and thus it's not safe to send
@@ -268,7 +260,5 @@ svn_ra_neon__get_mergeinfo(svn_ra_sessio
if (mb.err == SVN_NO_ERROR && apr_hash_count(mb.catalog))
*catalog = mb.catalog;
- *validate_inherited_mergeinfo = mb.validated_inherited_mergeinfo;
-
return mb.err;
}
Modified: subversion/branches/svn-bisect/subversion/libsvn_ra_neon/options.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-bisect/subversion/libsvn_ra_neon/options.c?rev=1148749&r1=1148748&r2=1148749&view=diff
==============================================================================
--- subversion/branches/svn-bisect/subversion/libsvn_ra_neon/options.c (original)
+++ subversion/branches/svn-bisect/subversion/libsvn_ra_neon/options.c Wed Jul 20 13:06:00 2011
@@ -34,6 +34,8 @@
#include "ra_neon.h"
+/* In a debug build, setting this environment variable to "yes" will force
+ the client to speak v1, even if the server is capable of speaking v2. */
#define SVN_IGNORE_V2_ENV_VAR "SVN_I_LIKE_LATENCY_SO_IGNORE_HTTPV2"
static const svn_ra_neon__xml_elm_t options_elements[] =
@@ -134,9 +136,9 @@ static const char *capability_server_yes
information discovered from REQ's headers. Use POOL for temporary
allocation only.
- Also, set *YOUNGEST_REV to the current youngest revision if we can
- detect that from the OPTIONS exchange; set it to SVN_INVALID_REVNUM
- otherwise. */
+ Also, if YOUNGEST_REV is not NULL, set *YOUNGEST_REV to the current
+ youngest revision if we can detect that from the OPTIONS exchange, or
+ to SVN_INVALID_REVNUM otherwise. */
static void
parse_capabilities(ne_request *req,
svn_ra_neon__session_t *ras,
@@ -145,7 +147,8 @@ parse_capabilities(ne_request *req,
{
const char *val;
- *youngest_rev = SVN_INVALID_REVNUM;
+ if (youngest_rev)
+ *youngest_rev = SVN_INVALID_REVNUM;
/* Start out assuming all capabilities are unsupported. */
apr_hash_set(ras->capabilities, SVN_RA_CAPABILITY_PARTIAL_REPLAY,
@@ -195,11 +198,16 @@ parse_capabilities(ne_request *req,
apr_hash_set(ras->capabilities, SVN_RA_CAPABILITY_DEPTH,
APR_HASH_KEY_STRING, capability_yes);
+ /* For mergeinfo capabilities, the server doesn't know what repository
+ we're referring to, so it can't just say capability_yes. */
if (svn_cstring_match_list(SVN_DAV_NS_DAV_SVN_MERGEINFO, vals))
- /* The server doesn't know what repository we're referring
- to, so it can't just say capability_yes. */
apr_hash_set(ras->capabilities, SVN_RA_CAPABILITY_MERGEINFO,
APR_HASH_KEY_STRING, capability_server_yes);
+ if (svn_cstring_match_list(SVN_DAV_NS_DAV_SVN_MERGEINFO_VALIDATION,
+ vals))
+ apr_hash_set(ras->capabilities,
+ SVN_RA_CAPABILITY_VALIDATE_INHERITED_MERGEINFO,
+ APR_HASH_KEY_STRING, capability_server_yes);
if (svn_cstring_match_list(SVN_DAV_NS_DAV_SVN_LOG_REVPROPS, vals))
apr_hash_set(ras->capabilities, SVN_RA_CAPABILITY_LOG_REVPROPS,
@@ -217,7 +225,8 @@ parse_capabilities(ne_request *req,
/* Not strictly capabilities, but while we're here, we might as well... */
if ((val = ne_get_response_header(req, SVN_DAV_YOUNGEST_REV_HEADER)))
{
- *youngest_rev = SVN_STR_TO_REV(val);
+ if (youngest_rev)
+ *youngest_rev = SVN_STR_TO_REV(val);
}
if ((val = ne_get_response_header(req, SVN_DAV_REPOS_UUID_HEADER)))
{
@@ -235,17 +244,13 @@ parse_capabilities(ne_request *req,
if ((val = ne_get_response_header(req, SVN_DAV_ME_RESOURCE_HEADER)))
{
#ifdef SVN_DEBUG
- /* ### This section is throw in here for development use. It
- ### allows devs the chance to force the client to speak v1,
- ### even if the server is capable of speaking v2. We should
- ### probably remove it before 1.7 goes final. */
char *ignore_v2_env_var = getenv(SVN_IGNORE_V2_ENV_VAR);
if (! (ignore_v2_env_var
&& apr_strnatcasecmp(ignore_v2_env_var, "yes") == 0))
ras->me_resource = apr_pstrdup(ras->pool, val);
#else
- ras->me_resource = apr_pstrdup(ras->pool, val);
+ ras->me_resource = apr_pstrdup(ras->pool, val);
#endif
}
if ((val = ne_get_response_header(req, SVN_DAV_REV_ROOT_STUB_HEADER)))
@@ -290,7 +295,8 @@ svn_ra_neon__exchange_capabilities(svn_r
oc.pool = pool;
oc.cdata = svn_stringbuf_create("", pool);
- *youngest_rev = SVN_INVALID_REVNUM;
+ if (youngest_rev)
+ *youngest_rev = SVN_INVALID_REVNUM;
if (relocation_location)
*relocation_location = NULL;
@@ -354,10 +360,8 @@ svn_ra_neon__get_activity_collection(con
svn_ra_neon__session_t *ras,
apr_pool_t *pool)
{
- svn_revnum_t ignored_revnum;
if (! ras->act_coll)
- SVN_ERR(svn_ra_neon__exchange_capabilities(ras, NULL,
- &ignored_revnum, pool));
+ SVN_ERR(svn_ra_neon__exchange_capabilities(ras, NULL, NULL, pool));
*activity_coll = svn_string_create(ras->act_coll, pool);
return SVN_NO_ERROR;
}
@@ -386,9 +390,7 @@ svn_ra_neon__has_capability(svn_ra_sessi
/* If any capability is unknown, they're all unknown, so ask. */
if (cap_result == NULL)
{
- svn_revnum_t ignored_revnum;
- SVN_ERR(svn_ra_neon__exchange_capabilities(ras, NULL,
- &ignored_revnum, pool));
+ SVN_ERR(svn_ra_neon__exchange_capabilities(ras, NULL, NULL, pool));
}
@@ -397,12 +399,13 @@ svn_ra_neon__has_capability(svn_ra_sessi
capability, APR_HASH_KEY_STRING);
/* Some capabilities depend on the repository as well as the server.
- NOTE: ../libsvn_ra_serf/serf.c:svn_ra_serf__has_capability()
- has a very similar code block. If you change something here,
- check there as well. */
+ NOTE: svn_ra_serf__has_capability() has a very similar code block. If
+ you change something here, check there as well. */
if (cap_result == capability_server_yes)
{
- if (strcmp(capability, SVN_RA_CAPABILITY_MERGEINFO) == 0)
+ if ((strcmp(capability, SVN_RA_CAPABILITY_MERGEINFO) == 0)
+ || (strcmp(capability,
+ SVN_RA_CAPABILITY_VALIDATE_INHERITED_MERGEINFO) == 0))
{
/* Handle mergeinfo specially. Mergeinfo depends on the
repository as well as the server, but the server routine
@@ -410,7 +413,7 @@ svn_ra_neon__has_capability(svn_ra_sessi
above didn't even know which repository we were interested in
-- it just told us whether the server supports mergeinfo.
If the answer was 'no', there's no point checking the
- particular repository; but if it was 'yes, we still must
+ particular repository; but if it was 'yes', we still must
change it to 'no' iff the repository itself doesn't
support mergeinfo. */
svn_mergeinfo_catalog_t ignored;
@@ -422,7 +425,7 @@ svn_ra_neon__has_capability(svn_ra_sessi
err = svn_ra_neon__get_mergeinfo(session, &ignored, paths, 0,
FALSE,
- &validate_inherited_mergeinfo,
+ validate_inherited_mergeinfo,
FALSE, pool);
if (err)
@@ -447,9 +450,14 @@ svn_ra_neon__has_capability(svn_ra_sessi
else
cap_result = capability_yes;
- apr_hash_set(ras->capabilities,
- SVN_RA_CAPABILITY_MERGEINFO, APR_HASH_KEY_STRING,
- cap_result);
+ if (strcmp(capability, SVN_RA_CAPABILITY_MERGEINFO) == 0)
+ apr_hash_set(ras->capabilities,
+ SVN_RA_CAPABILITY_MERGEINFO, APR_HASH_KEY_STRING,
+ cap_result);
+ else
+ apr_hash_set(ras->capabilities,
+ SVN_RA_CAPABILITY_VALIDATE_INHERITED_MERGEINFO,
+ APR_HASH_KEY_STRING, cap_result);
}
else
{
Modified: subversion/branches/svn-bisect/subversion/libsvn_ra_neon/props.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-bisect/subversion/libsvn_ra_neon/props.c?rev=1148749&r1=1148748&r2=1148749&view=diff
==============================================================================
--- subversion/branches/svn-bisect/subversion/libsvn_ra_neon/props.c (original)
+++ subversion/branches/svn-bisect/subversion/libsvn_ra_neon/props.c Wed Jul 20 13:06:00 2011
@@ -1011,9 +1011,13 @@ svn_error_t *svn_ra_neon__get_baseline_i
}
if (bc_relative_p)
{
- const char *relpath = svn_uri__is_child(sess->repos_root, url, pool);
+ const char *relpath = svn_uri_skip_ancestor(sess->repos_root, url,
+ pool);
if (! relpath)
- relpath = "";
+ return svn_error_createf(SVN_ERR_RA_REPOS_ROOT_URL_MISMATCH, NULL,
+ _("Url '%s' is not in repository '%s'"),
+ url, sess->repos_root);
+
*bc_relative_p = relpath;
}
if (latest_rev)
Modified: subversion/branches/svn-bisect/subversion/libsvn_ra_neon/ra_neon.h
URL: http://svn.apache.org/viewvc/subversion/branches/svn-bisect/subversion/libsvn_ra_neon/ra_neon.h?rev=1148749&r1=1148748&r2=1148749&view=diff
==============================================================================
--- subversion/branches/svn-bisect/subversion/libsvn_ra_neon/ra_neon.h (original)
+++ subversion/branches/svn-bisect/subversion/libsvn_ra_neon/ra_neon.h Wed Jul 20 13:06:00 2011
@@ -308,7 +308,7 @@ svn_error_t * svn_ra_neon__get_mergeinfo
const apr_array_header_t *paths,
svn_revnum_t revision,
svn_mergeinfo_inheritance_t inherit,
- svn_boolean_t *validate_inherited_mergeinfo,
+ svn_boolean_t validate_inherited_mergeinfo,
svn_boolean_t include_descendants,
apr_pool_t *pool);
@@ -1125,7 +1125,8 @@ svn_ra_neon__has_capability(svn_ra_sessi
If the server is kind enough to tell us the current youngest
revision of the target repository, set *YOUNGEST_REV to that value;
- set it to SVN_INVALID_REVNUM otherwise.
+ set it to SVN_INVALID_REVNUM otherwise. YOUNGEST_REV may be NULL if
+ the caller is not interested in receiving this information.
NOTE: This function also expects the server to announce the
activity collection. */
Modified: subversion/branches/svn-bisect/subversion/libsvn_ra_neon/session.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-bisect/subversion/libsvn_ra_neon/session.c?rev=1148749&r1=1148748&r2=1148749&view=diff
==============================================================================
--- subversion/branches/svn-bisect/subversion/libsvn_ra_neon/session.c (original)
+++ subversion/branches/svn-bisect/subversion/libsvn_ra_neon/session.c Wed Jul 20 13:06:00 2011
@@ -451,8 +451,12 @@ static svn_error_t *get_server_settings(
apr_pool_t *pool)
{
const char *exceptions, *port_str, *timeout_str, *server_group;
- const char *debug_str, *http_auth_types;
+ const char *debug_str;
svn_boolean_t is_exception = FALSE;
+#ifdef SVN_NEON_0_26
+ const char *http_auth_types = NULL;
+#endif
+
/* If we find nothing, default to nulls. */
*proxy_host = NULL;
*proxy_port = (unsigned int) -1;
@@ -461,7 +465,6 @@ static svn_error_t *get_server_settings(
port_str = NULL;
timeout_str = NULL;
debug_str = NULL;
- http_auth_types = NULL;
*pk11_provider = NULL;
/* Use the default proxy-specific settings if and only if
@@ -791,7 +794,6 @@ svn_ra_neon__open(svn_ra_session_t *sess
const char *pkcs11_provider;
const char *useragent = NULL;
const char *client_string = NULL;
- svn_revnum_t ignored_revnum;
SVN_ERR_ASSERT(svn_uri_is_canonical(repos_URL, pool));
@@ -1076,8 +1078,7 @@ svn_ra_neon__open(svn_ra_session_t *sess
session->priv = ras;
- return svn_ra_neon__exchange_capabilities(ras, corrected_url,
- &ignored_revnum, pool);
+ return svn_ra_neon__exchange_capabilities(ras, corrected_url, NULL, pool);
}
Modified: subversion/branches/svn-bisect/subversion/libsvn_ra_serf/log.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-bisect/subversion/libsvn_ra_serf/log.c?rev=1148749&r1=1148748&r2=1148749&view=diff
==============================================================================
--- subversion/branches/svn-bisect/subversion/libsvn_ra_serf/log.c (original)
+++ subversion/branches/svn-bisect/subversion/libsvn_ra_serf/log.c Wed Jul 20 13:06:00 2011
@@ -121,11 +121,12 @@ push_state(svn_ra_serf__xml_parser_t *pa
if (state == ITEM)
{
log_info_t *info;
+ apr_pool_t *info_pool = svn_pool_create(parser->state->pool);
- info = apr_pcalloc(parser->state->pool, sizeof(*info));
- info->log_entry = svn_log_entry_create(parser->state->pool);
+ info = apr_pcalloc(info_pool, sizeof(*info));
+ info->pool = info_pool;
+ info->log_entry = svn_log_entry_create(info_pool);
- info->pool = parser->state->pool;
info->log_entry->revision = SVN_INVALID_REVNUM;
parser->state->private = info;
@@ -220,11 +221,14 @@ start_log(svn_ra_serf__xml_parser_t *par
}
else if (strcmp(name.name, "revprop") == 0)
{
+ const char *revprop_name;
info = push_state(parser, log_ctx, REVPROP);
- info->revprop_name = svn_xml_get_attr_value("name", attrs);
- if (info->revprop_name == NULL)
+ revprop_name = svn_xml_get_attr_value("name", attrs);
+ if (revprop_name == NULL)
return svn_error_createf(SVN_ERR_RA_DAV_MALFORMED_DATA, NULL,
_("Missing name attr in revprop element"));
+
+ info->revprop_name = apr_pstrdup(info->pool, revprop_name);
}
else if (strcmp(name.name, "has-children") == 0)
{
@@ -342,6 +346,7 @@ end_log(svn_ra_serf__xml_parser_t *parse
log_ctx->nest_level--;
}
+ svn_pool_destroy(info->pool);
svn_ra_serf__xml_pop_state(parser);
}
else if (state == VERSION &&
Modified: subversion/branches/svn-bisect/subversion/libsvn_ra_serf/mergeinfo.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-bisect/subversion/libsvn_ra_serf/mergeinfo.c?rev=1148749&r1=1148748&r2=1148749&view=diff
==============================================================================
--- subversion/branches/svn-bisect/subversion/libsvn_ra_serf/mergeinfo.c (original)
+++ subversion/branches/svn-bisect/subversion/libsvn_ra_serf/mergeinfo.c Wed Jul 20 13:06:00 2011
@@ -44,8 +44,7 @@ typedef enum mergeinfo_state_e {
MERGEINFO_REPORT,
MERGEINFO_ITEM,
MERGEINFO_PATH,
- MERGEINFO_INFO,
- MERGEINFO_VALIDATED
+ MERGEINFO_INFO
} mergeinfo_state_e;
/* Baton for accumulating mergeinfo. RESULT_CATALOG stores the final
@@ -63,7 +62,6 @@ typedef struct mergeinfo_context_t {
svn_revnum_t revision;
svn_mergeinfo_inheritance_t inherit;
svn_boolean_t validate_inherited_mergeinfo;
- svn_boolean_t validated_inherited_mergeinfo;
svn_boolean_t include_descendants;
} mergeinfo_context_t;
@@ -82,11 +80,6 @@ start_element(svn_ra_serf__xml_parser_t
svn_ra_serf__xml_push_state(parser, MERGEINFO_REPORT);
}
else if (state == MERGEINFO_REPORT &&
- strcmp(name.name, SVN_DAV__VALIDATE_INHERITED) == 0)
- {
- svn_ra_serf__xml_push_state(parser, MERGEINFO_VALIDATED);
- }
- else if (state == MERGEINFO_REPORT &&
strcmp(name.name, SVN_DAV__MERGEINFO_ITEM) == 0)
{
svn_ra_serf__xml_push_state(parser, MERGEINFO_ITEM);
@@ -176,11 +169,6 @@ cdata_handler(svn_ra_serf__xml_parser_t
svn_stringbuf_appendbytes(mergeinfo_ctx->curr_info, data, len);
break;
- case MERGEINFO_VALIDATED:
- if (strncmp(data, "yes", 3) == 0)
- mergeinfo_ctx->validated_inherited_mergeinfo = TRUE;
- break;
-
default:
break;
}
@@ -254,7 +242,7 @@ svn_ra_serf__get_mergeinfo(svn_ra_sessio
const apr_array_header_t *paths,
svn_revnum_t revision,
svn_mergeinfo_inheritance_t inherit,
- svn_boolean_t *validate_inherited_mergeinfo,
+ svn_boolean_t validate_inherited_mergeinfo,
svn_boolean_t include_descendants,
apr_pool_t *pool)
{
@@ -284,8 +272,7 @@ svn_ra_serf__get_mergeinfo(svn_ra_sessio
mergeinfo_ctx->paths = paths;
mergeinfo_ctx->revision = revision;
mergeinfo_ctx->inherit = inherit;
- mergeinfo_ctx->validate_inherited_mergeinfo = *validate_inherited_mergeinfo;
- mergeinfo_ctx->validated_inherited_mergeinfo = FALSE;
+ mergeinfo_ctx->validate_inherited_mergeinfo = validate_inherited_mergeinfo;
mergeinfo_ctx->include_descendants = include_descendants;
handler = apr_pcalloc(pool, sizeof(*handler));
@@ -325,9 +312,6 @@ svn_ra_serf__get_mergeinfo(svn_ra_sessio
SVN_ERR(err);
- *validate_inherited_mergeinfo =
- mergeinfo_ctx->validated_inherited_mergeinfo;
-
if (mergeinfo_ctx->done && apr_hash_count(mergeinfo_ctx->result_catalog))
*catalog = mergeinfo_ctx->result_catalog;
Modified: subversion/branches/svn-bisect/subversion/libsvn_ra_serf/options.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-bisect/subversion/libsvn_ra_serf/options.c?rev=1148749&r1=1148748&r2=1148749&view=diff
==============================================================================
--- subversion/branches/svn-bisect/subversion/libsvn_ra_serf/options.c (original)
+++ subversion/branches/svn-bisect/subversion/libsvn_ra_serf/options.c Wed Jul 20 13:06:00 2011
@@ -39,6 +39,9 @@
#include "ra_serf.h"
+
+/* In a debug build, setting this environment variable to "yes" will force
+ the client to speak v1, even if the server is capable of speaking v2. */
#define SVN_IGNORE_V2_ENV_VAR "SVN_I_LIKE_LATENCY_SO_IGNORE_HTTPV2"
@@ -296,13 +299,22 @@ capabilities_headers_iterator_callback(v
apr_hash_set(orc->session->capabilities, SVN_RA_CAPABILITY_DEPTH,
APR_HASH_KEY_STRING, capability_yes);
}
+
+ /* For mergeinfo capabilities, the server doesn't know what repository
+ we're referring to, so it can't just say capability_yes. */
if (svn_cstring_match_list(SVN_DAV_NS_DAV_SVN_MERGEINFO, vals))
{
- /* The server doesn't know what repository we're referring
- to, so it can't just say capability_yes. */
apr_hash_set(orc->session->capabilities, SVN_RA_CAPABILITY_MERGEINFO,
APR_HASH_KEY_STRING, capability_server_yes);
}
+ if (svn_cstring_match_list(SVN_DAV_NS_DAV_SVN_MERGEINFO_VALIDATION,
+ vals))
+ {
+ apr_hash_set(orc->session->capabilities,
+ SVN_RA_CAPABILITY_VALIDATE_INHERITED_MERGEINFO,
+ APR_HASH_KEY_STRING, capability_server_yes);
+ }
+
if (svn_cstring_match_list(SVN_DAV_NS_DAV_SVN_LOG_REVPROPS, vals))
{
apr_hash_set(orc->session->capabilities,
@@ -340,10 +352,6 @@ capabilities_headers_iterator_callback(v
else if (svn_cstring_casecmp(key, SVN_DAV_ME_RESOURCE_HEADER) == 0)
{
#ifdef SVN_DEBUG
- /* ### This section is throw in here for development use. It
- ### allows devs the chance to force the client to speak v1,
- ### even if the server is capable of speaking v2. We should
- ### probably remove it before 1.7 goes final. */
char *ignore_v2_env_var = getenv(SVN_IGNORE_V2_ENV_VAR);
if (!(ignore_v2_env_var
@@ -553,12 +561,13 @@ svn_ra_serf__has_capability(svn_ra_sessi
capability, APR_HASH_KEY_STRING);
/* Some capabilities depend on the repository as well as the server.
- NOTE: ../libsvn_ra_neon/session.c:svn_ra_neon__has_capability()
- has a very similar code block. If you change something here,
- check there as well. */
+ NOTE: svn_ra_neon__has_capability() has a very similar code block. If
+ you change something here, check there as well. */
if (cap_result == capability_server_yes)
{
- if (strcmp(capability, SVN_RA_CAPABILITY_MERGEINFO) == 0)
+ if ((strcmp(capability, SVN_RA_CAPABILITY_MERGEINFO) == 0)
+ || (strcmp(capability,
+ SVN_RA_CAPABILITY_VALIDATE_INHERITED_MERGEINFO) == 0))
{
/* Handle mergeinfo specially. Mergeinfo depends on the
repository as well as the server, but the server routine
@@ -566,7 +575,7 @@ svn_ra_serf__has_capability(svn_ra_sessi
didn't even know which repository we were interested in
-- it just told us whether the server supports mergeinfo.
If the answer was 'no', there's no point checking the
- particular repository; but if it was 'yes, we still must
+ particular repository; but if it was 'yes', we still must
change it to 'no' iff the repository itself doesn't
support mergeinfo. */
svn_mergeinfo_catalog_t ignored;
@@ -578,7 +587,7 @@ svn_ra_serf__has_capability(svn_ra_sessi
err = svn_ra_serf__get_mergeinfo(ra_session, &ignored, paths, 0,
FALSE,
- &validate_inherited_mergeinfo,
+ validate_inherited_mergeinfo,
FALSE, pool);
if (err)
@@ -602,9 +611,14 @@ svn_ra_serf__has_capability(svn_ra_sessi
else
cap_result = capability_yes;
- apr_hash_set(serf_sess->capabilities,
- SVN_RA_CAPABILITY_MERGEINFO, APR_HASH_KEY_STRING,
- cap_result);
+ if (strcmp(capability, SVN_RA_CAPABILITY_MERGEINFO) == 0)
+ apr_hash_set(serf_sess->capabilities,
+ SVN_RA_CAPABILITY_MERGEINFO, APR_HASH_KEY_STRING,
+ cap_result);
+ else
+ apr_hash_set(serf_sess->capabilities,
+ SVN_RA_CAPABILITY_VALIDATE_INHERITED_MERGEINFO,
+ APR_HASH_KEY_STRING, cap_result);
}
else
{
Modified: subversion/branches/svn-bisect/subversion/libsvn_ra_serf/ra_serf.h
URL: http://svn.apache.org/viewvc/subversion/branches/svn-bisect/subversion/libsvn_ra_serf/ra_serf.h?rev=1148749&r1=1148748&r2=1148749&view=diff
==============================================================================
--- subversion/branches/svn-bisect/subversion/libsvn_ra_serf/ra_serf.h (original)
+++ subversion/branches/svn-bisect/subversion/libsvn_ra_serf/ra_serf.h Wed Jul 20 13:06:00 2011
@@ -535,6 +535,10 @@ struct svn_ra_serf__xml_parser_t {
/* Temporary allocations should be made in this pool. */
apr_pool_t *pool;
+ /* What kind of response are we parsing? If set, this should typically
+ define the report name. */
+ const char *response_type;
+
/* Caller-specific data passed to the start, end, cdata callbacks. */
void *user_data;
@@ -1376,7 +1380,7 @@ svn_error_t * svn_ra_serf__get_mergeinfo
const apr_array_header_t *paths,
svn_revnum_t revision,
svn_mergeinfo_inheritance_t inherit,
- svn_boolean_t *validate_inherited_mergeinfo,
+ svn_boolean_t validate_inherited_mergeinfo,
svn_boolean_t include_descendants,
apr_pool_t *pool);
Modified: subversion/branches/svn-bisect/subversion/libsvn_ra_serf/serf.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-bisect/subversion/libsvn_ra_serf/serf.c?rev=1148749&r1=1148748&r2=1148749&view=diff
==============================================================================
--- subversion/branches/svn-bisect/subversion/libsvn_ra_serf/serf.c (original)
+++ subversion/branches/svn-bisect/subversion/libsvn_ra_serf/serf.c Wed Jul 20 13:06:00 2011
@@ -1087,6 +1087,9 @@ svn_ra_serf__init(const svn_version_t *l
{ "svn_delta", svn_delta_version },
{ NULL, NULL }
};
+ int serf_major;
+ int serf_minor;
+ int serf_patch;
SVN_ERR(svn_ver_check_list(ra_serf_version(), checklist));
@@ -1094,12 +1097,27 @@ svn_ra_serf__init(const svn_version_t *l
VTABLE parameter. The RA loader does a more exhaustive check. */
if (loader_version->major != SVN_VER_MAJOR)
{
- return svn_error_createf
- (SVN_ERR_VERSION_MISMATCH, NULL,
+ return svn_error_createf(
+ SVN_ERR_VERSION_MISMATCH, NULL,
_("Unsupported RA loader version (%d) for ra_serf"),
loader_version->major);
}
+ /* Make sure that we have loaded a compatible library: the MAJOR must
+ match, and the minor must be at *least* what we compiled against.
+ The patch level is simply ignored. */
+ serf_lib_version(&serf_major, &serf_minor, &serf_patch);
+ if (serf_major != SERF_MAJOR_VERSION
+ || serf_minor < SERF_MINOR_VERSION)
+ {
+ return svn_error_createf(
+ SVN_ERR_VERSION_MISMATCH, NULL,
+ _("ra_serf was compiled for serf %d.%d.%d but loaded "
+ "an incompatible %d.%d.%d library"),
+ SERF_MAJOR_VERSION, SERF_MINOR_VERSION, SERF_PATCH_VERSION,
+ serf_major, serf_minor, serf_patch);
+ }
+
*vtable = &serf_vtable;
return SVN_NO_ERROR;
Modified: subversion/branches/svn-bisect/subversion/libsvn_ra_serf/update.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-bisect/subversion/libsvn_ra_serf/update.c?rev=1148749&r1=1148748&r2=1148749&view=diff
==============================================================================
--- subversion/branches/svn-bisect/subversion/libsvn_ra_serf/update.c (original)
+++ subversion/branches/svn-bisect/subversion/libsvn_ra_serf/update.c Wed Jul 20 13:06:00 2011
@@ -115,9 +115,13 @@ typedef struct report_dir_t
/* the expanded directory name (including all parent names) */
const char *name;
- /* the canonical url for this directory. */
+ /* the canonical url for this directory after updating. (received) */
const char *url;
+ /* The original repos_relpath of this url (from the workingcopy)
+ or NULL if the repos_relpath can be calculated from the edit root. */
+ const char *repos_relpath;
+
/* Our base revision - SVN_INVALID_REVNUM if we're adding this dir. */
svn_revnum_t base_rev;
@@ -199,7 +203,7 @@ typedef struct report_info_t
svn_revnum_t target_rev;
/* our delta base, if present (NULL if we're adding the file) */
- const svn_string_t *delta_base;
+ const char *delta_base;
/* Path of original item if add with history */
const char *copyfrom_path;
@@ -315,6 +319,13 @@ struct report_context_t {
/* Path -> lock token mapping. */
apr_hash_t *lock_path_tokens;
+ /* Path -> const char *repos_relpath mapping */
+ apr_hash_t *switched_paths;
+
+ /* Boolean indicating whether "" is switched.
+ (This indicates that the we are updating a single file) */
+ svn_boolean_t root_is_switched;
+
/* Our master update editor and baton. */
const svn_delta_editor_t *update_editor;
void *update_baton;
@@ -464,9 +475,9 @@ set_file_props(void *baton,
prop_name = svn_ra_serf__svnname_from_wirename(ns, name, scratch_pool);
if (prop_name != NULL)
return svn_error_trace(editor->change_file_prop(info->file_baton,
- prop_name,
- val,
- scratch_pool));
+ prop_name,
+ val,
+ scratch_pool));
return SVN_NO_ERROR;
}
@@ -485,9 +496,9 @@ set_dir_props(void *baton,
prop_name = svn_ra_serf__svnname_from_wirename(ns, name, scratch_pool);
if (prop_name != NULL)
return svn_error_trace(editor->change_dir_prop(dir->dir_baton,
- prop_name,
- val,
- scratch_pool));
+ prop_name,
+ val,
+ scratch_pool));
return SVN_NO_ERROR;
}
@@ -506,9 +517,9 @@ remove_file_props(void *baton,
prop_name = svn_ra_serf__svnname_from_wirename(ns, name, scratch_pool);
if (prop_name != NULL)
return svn_error_trace(editor->change_file_prop(info->file_baton,
- prop_name,
- NULL,
- scratch_pool));
+ prop_name,
+ NULL,
+ scratch_pool));
return SVN_NO_ERROR;
}
@@ -527,9 +538,9 @@ remove_dir_props(void *baton,
prop_name = svn_ra_serf__svnname_from_wirename(ns, name, scratch_pool);
if (prop_name != NULL)
return svn_error_trace(editor->change_dir_prop(dir->dir_baton,
- prop_name,
- NULL,
- scratch_pool));
+ prop_name,
+ NULL,
+ scratch_pool));
return SVN_NO_ERROR;
}
@@ -716,7 +727,7 @@ headers_fetch(serf_bucket_t *headers,
fetch_ctx->info->delta_base)
{
serf_bucket_headers_setn(headers, SVN_DAV_DELTA_BASE_HEADER,
- fetch_ctx->info->delta_base->data);
+ fetch_ctx->info->delta_base);
serf_bucket_headers_setn(headers, "Accept-Encoding",
"svndiff1;q=0.9,svndiff;q=0.8");
}
@@ -1361,6 +1372,15 @@ start_report(svn_ra_serf__xml_parser_t *
info->base_name = info->dir->base_name;
info->name = info->dir->name;
+
+ info->dir->repos_relpath = apr_hash_get(ctx->switched_paths, "",
+ APR_HASH_KEY_STRING);
+
+ if (!info->dir->repos_relpath)
+ SVN_ERR(svn_ra_serf__get_relative_path(&info->dir->repos_relpath,
+ ctx->sess->session_url.path,
+ ctx->sess, ctx->conn,
+ info->dir->pool));
}
else if (state == NONE)
{
@@ -1408,6 +1428,13 @@ start_report(svn_ra_serf__xml_parser_t *
dir->name = svn_relpath_join(dir->parent_dir->name, dir->base_name,
dir->pool);
info->name = dir->name;
+
+ dir->repos_relpath = apr_hash_get(ctx->switched_paths, dir->name,
+ APR_HASH_KEY_STRING);
+
+ if (!dir->repos_relpath)
+ dir->repos_relpath = svn_relpath_join(dir->parent_dir->repos_relpath,
+ dir->base_name, dir->pool);
}
else if ((state == OPEN_DIR || state == ADD_DIR) &&
strcmp(name.name, "add-directory") == 0)
@@ -1446,6 +1473,9 @@ start_report(svn_ra_serf__xml_parser_t *
dir->base_rev = info->base_rev;
dir->target_rev = ctx->target_rev;
dir->fetch_props = TRUE;
+
+ dir->repos_relpath = svn_relpath_join(dir->parent_dir->repos_relpath,
+ dir->base_name, dir->pool);
}
else if ((state == OPEN_DIR || state == ADD_DIR) &&
strcmp(name.name, "open-file") == 0)
@@ -1845,126 +1875,54 @@ end_report(svn_ra_serf__xml_parser_t *pa
* rather than fetching a fulltext.
*
* In HTTP v2, we can simply construct the URL we need given the
- * path and base revision number.
+ * repos_relpath and base revision number.
*/
if (SVN_RA_SERF__HAVE_HTTPV2_SUPPORT(ctx->sess))
{
- const char *fs_path;
- const char *full_path =
- svn_fspath__join(ctx->sess->session_url.path,
- svn_path_uri_encode(info->name, info->pool),
- info->pool);
-
- SVN_ERR(svn_ra_serf__get_relative_path(&fs_path, full_path,
- ctx->sess, NULL, info->pool));
- info->delta_base = svn_string_createf(info->pool, "%s/%ld/%s",
- ctx->sess->rev_root_stub,
- info->base_rev, fs_path);
- }
-
- /* Still no base URL? If we have a WC, we might be able to dive all
- * the way into the WC to get the previous URL so we can do a
- * differential GET with the base URL.
- */
- if ((! info->delta_base) && (ctx->sess->wc_callbacks->get_wc_prop))
- {
- SVN_ERR(ctx->sess->wc_callbacks->get_wc_prop(
- ctx->sess->wc_callback_baton, info->name,
- SVN_RA_SERF__WC_CHECKED_IN_URL, &info->delta_base, info->pool));
- }
-
-#if 0 /* ### FIXME: Something's not quite right with this algorithm.
- ### Would be great to figure out the problem and correct it,
- ### but that'll only bring a performance enhancement to the
- ### technical correctness of not falling back to this URL
- ### construction. Motivation is low on this, though, because
- ### HTTP v2 won't hit this block. */
-
- /* STILL no base URL? Well, all else has failed, but we can
- * manually reconstruct the base URL. This avoids us having to
- * grab two full-text for URL<->URL diffs. Instead, we can just
- * grab one full-text and a diff from the server against that
- * other file.
- */
- if (! info->delta_base)
- {
- const char *c;
- apr_size_t comp_count;
- svn_stringbuf_t *path;
-
- c = svn_ra_serf__get_ver_prop(info->props, info->base_name,
- info->base_rev, "DAV:", "checked-in");
-
- path = svn_stringbuf_create(c, info->pool);
-
- comp_count = svn_path_component_count(info->name);
-
- svn_path_remove_components(path, comp_count);
-
- /* Find out the difference of the destination compared to
- * the repos root url. Cut off this difference from path,
- * which will give us our version resource root path.
- *
- * Example:
- * path:
- * /repositories/log_tests-17/!svn/ver/4/branches/a
- * repos_root:
- * http://localhost/repositories/log_tests-17
- * destination:
- * http://localhost/repositories/log_tests-17/branches/a
- *
- * So, find 'branches/a' as the difference. Cutting it off
- * path, gives us:
- * /repositories/log_tests-17/!svn/ver/4
- */
- if (ctx->destination &&
- strcmp(ctx->destination, ctx->sess->repos_root_str) != 0)
- {
- apr_size_t root_count, src_count;
+ const char *repos_relpath;
- src_count = svn_path_component_count(ctx->destination);
- root_count = svn_path_component_count(ctx->sess->repos_root_str);
-
- svn_path_remove_components(path, src_count - root_count);
- }
-
- /* At this point, we should just have the version number
- * remaining. We know our target revision, so we'll replace it
- * and recreate what we just chopped off.
+ /* If this file is switched vs the editor root we should provide
+ its real url instead of the one calculated from the session root.
*/
- svn_path_remove_component(path);
+ repos_relpath = apr_hash_get(ctx->switched_paths, info->name,
+ APR_HASH_KEY_STRING);
- svn_path_add_component(path, apr_ltoa(info->pool, info->base_rev));
-
- /* Similar as above, we now have to add the relative path between
- * source and root path.
- *
- * Example:
- * path:
- * /repositories/log_tests-17/!svn/ver/2
- * repos_root path:
- * /repositories/log_tests-17
- * source:
- * /repositories/log_tests-17/trunk
- *
- * So, find 'trunk' as the difference. Addding it to path, gives us:
- * /repositories/log_tests-17/!svn/ver/2/trunk
- */
- if (strcmp(ctx->source, ctx->sess->repos_root.path) != 0)
+ if (!repos_relpath)
{
- apr_size_t root_len;
-
- root_len = strlen(ctx->sess->repos_root.path) + 1;
+ if (ctx->root_is_switched)
+ {
+ /* We are updating a direct target (most likely a file)
+ that is switched vs its parent url */
+ SVN_ERR_ASSERT(*svn_relpath_dirname(info->name, info->pool)
+ == '\0');
- svn_path_add_component(path, &ctx->source[root_len]);
+ repos_relpath = apr_hash_get(ctx->switched_paths, "",
+ APR_HASH_KEY_STRING);
+ }
+ else
+ repos_relpath = svn_relpath_join(info->dir->repos_relpath,
+ info->base_name, info->pool);
}
- /* Re-add the filename. */
- svn_path_add_component(path, info->name);
+ info->delta_base = apr_psprintf(info->pool, "%s/%ld/%s",
+ ctx->sess->rev_root_stub,
+ info->base_rev,
+ svn_path_uri_encode(repos_relpath,
+ info->pool));
+ }
+ else if (ctx->sess->wc_callbacks->get_wc_prop)
+ {
+ /* If we have a WC, we might be able to dive all the way into the WC
+ * to get the previous URL so we can do a differential GET with the
+ * base URL.
+ */
+ const svn_string_t *value = NULL;
+ SVN_ERR(ctx->sess->wc_callbacks->get_wc_prop(
+ ctx->sess->wc_callback_baton, info->name,
+ SVN_RA_SERF__WC_CHECKED_IN_URL, &value, info->pool));
- info->delta_base = svn_string_create_from_buf(path, info->pool);
+ info->delta_base = value ? value->data : NULL;
}
-#endif
SVN_ERR(fetch_file(ctx, info));
svn_ra_serf__xml_pop_state(parser);
@@ -2214,11 +2172,18 @@ link_path(void *report_baton,
SVN_ERR(svn_io_file_write_full(report->body_file, buf->data, buf->len,
NULL, pool));
+ /* Store the switch roots to allow generating repos_relpaths from just
+ the working copy paths. (Needed for HTTPv2) */
+ path = apr_pstrdup(report->pool, path);
+ apr_hash_set(report->switched_paths, path, APR_HASH_KEY_STRING,
+ apr_pstrdup(report->pool, link+1));
+
+ if (!*path)
+ report->root_is_switched = TRUE;
+
if (lock_token)
{
- apr_hash_set(report->lock_path_tokens,
- apr_pstrdup(report->pool, path),
- APR_HASH_KEY_STRING,
+ apr_hash_set(report->lock_path_tokens, path, APR_HASH_KEY_STRING,
apr_pstrdup(report->pool, lock_token));
}
@@ -2359,6 +2324,7 @@ finish_report(void *report_baton,
parser_ctx = apr_pcalloc(pool, sizeof(*parser_ctx));
parser_ctx->pool = pool;
+ parser_ctx->response_type = "update-report";
parser_ctx->user_data = report;
parser_ctx->start = start_report;
parser_ctx->end = end_report;
@@ -2639,6 +2605,7 @@ make_update_reporter(svn_ra_session_t *r
report->send_copyfrom_args = send_copyfrom_args;
report->text_deltas = text_deltas;
report->lock_path_tokens = apr_hash_make(report->pool);
+ report->switched_paths = apr_hash_make(report->pool);
report->source = src_path;
report->destination = dest_path;
Modified: subversion/branches/svn-bisect/subversion/libsvn_ra_serf/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-bisect/subversion/libsvn_ra_serf/util.c?rev=1148749&r1=1148748&r2=1148749&view=diff
==============================================================================
--- subversion/branches/svn-bisect/subversion/libsvn_ra_serf/util.c (original)
+++ subversion/branches/svn-bisect/subversion/libsvn_ra_serf/util.c Wed Jul 20 13:06:00 2011
@@ -102,6 +102,67 @@ struct svn_ra_serf__pending_t {
into a temporary file. */
#define SPILL_SIZE 1000000
+/* See notes/ra-serf-testing.txt for some information on testing this
+ new "paused" feature (aka network pushback).
+
+ Define PBTEST_ACTIVE, if you would like to run the pushback tests. */
+#undef PBTEST_ACTIVE
+#ifdef PBTEST_ACTIVE
+
+static int pbtest_step = 0;
+
+/* Note: this cannot resolve states 5 and 7. */
+#define PBTEST_STATE(p) \
+ ((p) == NULL ? 1 \
+ : ((p)->spill == NULL ? ((p)->head == NULL ? 2 : 3) \
+ : ((p)->head == NULL ? 6 : 4)))
+
+typedef struct {
+ svn_boolean_t paused; /* pause the parser on this step? */
+ svn_boolean_t inject; /* inject pending content on this step? */
+ int when_next; /* when to move to the next step? */
+ const char *completed; /* what test was completed? */
+} pbtest_desc_t;
+
+static const pbtest_desc_t pbtest_description[] = {
+ { 0 }, /* unused */
+ { TRUE, FALSE, 3, "1.1" },
+ { TRUE, FALSE, 3, "1.3" },
+ { FALSE, FALSE, 3, "2.3" },
+ { FALSE, TRUE, 2, "3.3" }, /* WHEN_NEXT is ignored due to INJECT */
+ { TRUE, FALSE, 3, "1.2" },
+ { TRUE, FALSE, 4, NULL },
+ { TRUE, FALSE, 4, "1.4" },
+ { FALSE, FALSE, 4, "2.4" },
+ { FALSE, TRUE, 6, "3.4" }, /* WHEN_NEXT is ignored due to INJECT */
+ { TRUE, FALSE, 6, "1.6" },
+ { FALSE, FALSE, 6, "2.6" },
+ { FALSE, TRUE, 7, "3.6" }, /* WHEN_NEXT is ignored due to INJECT */
+ { TRUE, FALSE, 6, "1.7" },
+ { 0 } /* unused */
+};
+
+#define PBTEST_SET_PAUSED(ctx) \
+ (pbtest_step < 14 \
+ ? (ctx)->paused = pbtest_description[pbtest_step].paused \
+ : FALSE)
+
+#define PBTEST_MAYBE_STEP(ctx) maybe_next_step(ctx)
+
+#define PBTEST_FORCE_SPILL() (pbtest_step == 6)
+
+#else /* PBTEST_ACTIVE */
+
+/* Be wary with the definition of these macros so that we don't
+ end up with "statement with no effect" warnings. Obviously, this
+ depends upon particular usage, which is easy to verify. */
+#define PBTEST_SET_PAUSED(ctx) /* empty */
+#define PBTEST_MAYBE_STEP(ctx) /* empty */
+
+#define PBTEST_FORCE_SPILL() FALSE
+
+#endif /* PBTEST_ACTIVE */
+
static const apr_uint32_t serf_failure_map[][2] =
@@ -1247,6 +1308,48 @@ add_done_item(svn_ra_serf__xml_parser_t
}
+#ifdef PBTEST_ACTIVE
+
+/* Determine whether we should move to the next step. Print out the
+ transition for debugging purposes. */
+static void
+maybe_next_step(svn_ra_serf__xml_parser_t *parser)
+{
+ const pbtest_desc_t *desc;
+ int state;
+
+ /* This would fail the state transition, but for clarity... just return
+ when the testing has completed. */
+ if (pbtest_step == 14)
+ return;
+
+ desc = &pbtest_description[pbtest_step];
+ state = PBTEST_STATE(parser->pending);
+
+ if (desc->inject || state == desc->when_next || pbtest_step == 0)
+ {
+ ++pbtest_step;
+
+ if (desc->completed != NULL)
+ SVN_DBG(("PBTEST: completed TEST %s\n", desc->completed));
+
+ /* Pause the parser based on the new step's config. */
+ ++desc;
+ parser->paused = desc->paused;
+
+ SVN_DBG(("PBTEST: advanced: step=%d paused=%d inject=%d\n",
+ pbtest_step, desc->paused, desc->inject));
+ }
+ else
+ {
+ SVN_DBG(("PBTEST: step[%d]: state=%d waiting_for=%d\n",
+ pbtest_step, state, desc->when_next));
+ }
+}
+
+#endif /* PBTEST_ACTIVE */
+
+
/* Get a buffer from the parsing context. It will come from the free list,
or allocated as necessary. */
static struct pending_buffer_t *
@@ -1290,10 +1393,18 @@ write_to_pending(svn_ra_serf__xml_parser
/* We do not (yet) have a spill file, but the amount stored in memory
has grown too large. Create the file and place the pending data into
- the temporary file. */
- if (ctx->pending->spill == NULL
- && ctx->pending->memory_size > SPILL_SIZE)
- {
+ the temporary file.
+
+ For testing purposes, there are points when we may want to
+ create the spill file, regardless. */
+ if (PBTEST_FORCE_SPILL()
+ || (ctx->pending->spill == NULL
+ && ctx->pending->memory_size > SPILL_SIZE))
+ {
+#ifdef PBTEST_ACTIVE
+ /* Only allow a spill file for steps 6 or later. */
+ if (pbtest_step >= 6)
+#endif
SVN_ERR(svn_io_open_unique_file3(&ctx->pending->spill,
NULL /* temp_path */,
NULL /* dirpath */,
@@ -1368,6 +1479,10 @@ inject_to_parser(svn_ra_serf__xml_parser
if (ctx->error && !ctx->ignore_errors)
return svn_error_trace(ctx->error);
+ /* We may want to ignore the callbacks choice for the PAUSED flag.
+ Set this value, as appropriate. */
+ PBTEST_SET_PAUSED(ctx);
+
return SVN_NO_ERROR;
}
@@ -1380,6 +1495,18 @@ svn_ra_serf__process_pending(svn_ra_serf
svn_error_t *err;
apr_off_t output_unused;
+ /* We may need to repair the PAUSED state when testing. */
+ PBTEST_SET_PAUSED(parser);
+
+#ifdef PBTEST_ACTIVE
+ /* If this step should not inject content, then fast-path exit. */
+ if (pbtest_step < 14 && !pbtest_description[pbtest_step].inject)
+ {
+ SVN_DBG(("PBTEST: process: injection disabled\n"));
+ return SVN_NO_ERROR;
+ }
+#endif
+
/* Fast path exit: already paused, or nothing to do. */
if (parser->paused || parser->pending == NULL)
return SVN_NO_ERROR;
@@ -1417,6 +1544,17 @@ svn_ra_serf__process_pending(svn_ra_serf
return SVN_NO_ERROR;
}
+#ifdef PBTEST_ACTIVE
+ /* For steps 4 and 9, we wait until all of the memory content has been
+ injected. At that point, we can take another step which will pause
+ the parser, and we'll need to exit. */
+ if (pbtest_step == 4 || pbtest_step == 9)
+ {
+ PBTEST_MAYBE_STEP(parser);
+ return SVN_NO_ERROR;
+ }
+#endif
+
/* If we don't have a spill file, then we've exhausted all
pending content. */
if (parser->pending->spill == NULL)
@@ -1478,6 +1616,11 @@ svn_ra_serf__process_pending(svn_ra_serf
XML_ParserFree(parser->xmlp);
add_done_item(parser);
}
+
+ /* For testing step 12, we have written all of the disk content. This
+ will advance to step 13 and pause the parser again. */
+ PBTEST_MAYBE_STEP(parser);
+
return SVN_NO_ERROR;
}
@@ -1535,6 +1678,14 @@ svn_ra_serf__handle_xml_parser(serf_requ
{
XML_SetCharacterDataHandler(ctx->xmlp, cdata_xml);
}
+
+ /* This is the first invocation. If we're looking at an update
+ report, then move to step 1 of the testing sequence. */
+#ifdef PBTEST_ACTIVE
+ if (ctx->response_type != NULL
+ && strcmp(ctx->response_type, "update-report") == 0)
+ PBTEST_MAYBE_STEP(ctx);
+#endif
}
/* If we are storing content into a spill file, then move to the end of
@@ -1561,6 +1712,16 @@ svn_ra_serf__handle_xml_parser(serf_requ
return svn_error_wrap_apr(status, NULL);
}
+ /* Ensure that the parser's PAUSED state is correct before we test
+ the flag. */
+ PBTEST_SET_PAUSED(ctx);
+
+#ifdef PBTEST_ACTIVE
+ SVN_DBG(("response: len=%d paused=%d status=%08x\n",
+ (int)len, ctx->paused, status));
+ SVN_DBG(("content=%s\n", data));
+#endif
+
/* Note: once the callbacks invoked by inject_to_parser() sets the
PAUSED flag, then it will not be cleared. write_to_pending() will
only save the content. Logic outside of serf_context_run() will
@@ -1570,10 +1731,17 @@ svn_ra_serf__handle_xml_parser(serf_requ
We want to save arriving content into the PENDING structures if
the parser has been paused, or we already have data in there (so
the arriving data is appended, rather than injected out of order) */
-#ifdef DISABLE_THIS_FOR_NOW
+#ifdef PBTEST_ACTIVE
if (ctx->paused || HAS_PENDING_DATA(ctx->pending))
{
err = write_to_pending(ctx, data, len, pool);
+
+ /* We may have a transition to a next step.
+
+ Note: this only happens on writing to PENDING. If the
+ parser is unpaused, then we will never change state within
+ this network-reading loop. */
+ PBTEST_MAYBE_STEP(ctx);
}
else
#endif
Modified: subversion/branches/svn-bisect/subversion/libsvn_ra_svn/client.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-bisect/subversion/libsvn_ra_svn/client.c?rev=1148749&r1=1148748&r2=1148749&view=diff
==============================================================================
--- subversion/branches/svn-bisect/subversion/libsvn_ra_svn/client.c (original)
+++ subversion/branches/svn-bisect/subversion/libsvn_ra_svn/client.c Wed Jul 20 13:06:00 2011
@@ -1185,7 +1185,7 @@ static svn_error_t *ra_svn_get_mergeinfo
const apr_array_header_t *paths,
svn_revnum_t revision,
svn_mergeinfo_inheritance_t inherit,
- svn_boolean_t *validate_inherited_mergeinfo,
+ svn_boolean_t validate_inherited_mergeinfo,
svn_boolean_t include_descendants,
apr_pool_t *pool)
{
@@ -1195,7 +1195,6 @@ static svn_error_t *ra_svn_get_mergeinfo
apr_array_header_t *mergeinfo_tuple;
svn_ra_svn_item_t *elt;
const char *path;
- apr_uint64_t validated_inherited_mergeinfo;
SVN_ERR(svn_ra_svn_write_tuple(conn, pool, "w((!", "get-mergeinfo"));
for (i = 0; i < paths->nelts; i++)
@@ -1206,14 +1205,10 @@ static svn_error_t *ra_svn_get_mergeinfo
SVN_ERR(svn_ra_svn_write_tuple(conn, pool, "!)(?r)wbb)", revision,
svn_inheritance_to_word(inherit),
include_descendants,
- *validate_inherited_mergeinfo));
+ validate_inherited_mergeinfo));
SVN_ERR(handle_auth_request(sess_baton, pool));
- SVN_ERR(svn_ra_svn_read_cmd_response(conn, pool, "l?B", &mergeinfo_tuple,
- &validated_inherited_mergeinfo));
-
- *validate_inherited_mergeinfo =
- (optbool_to_tristate(validated_inherited_mergeinfo) == svn_tristate_true);
+ SVN_ERR(svn_ra_svn_read_cmd_response(conn, pool, "l", &mergeinfo_tuple));
*catalog = NULL;
if (mergeinfo_tuple->nelts > 0)
@@ -2471,6 +2466,10 @@ static svn_error_t *ra_svn_has_capabilit
*has = svn_ra_svn_has_capability(sess->conn, SVN_RA_SVN_CAP_DEPTH);
else if (strcmp(capability, SVN_RA_CAPABILITY_MERGEINFO) == 0)
*has = svn_ra_svn_has_capability(sess->conn, SVN_RA_SVN_CAP_MERGEINFO);
+ else if (strcmp(capability,
+ SVN_RA_SVN_CAP_VALIDATE_INHERITED_MERGEINFO) == 0)
+ *has = svn_ra_svn_has_capability(
+ sess->conn, SVN_RA_SVN_CAP_VALIDATE_INHERITED_MERGEINFO);
else if (strcmp(capability, SVN_RA_CAPABILITY_LOG_REVPROPS) == 0)
*has = svn_ra_svn_has_capability(sess->conn, SVN_RA_SVN_CAP_LOG_REVPROPS);
else if (strcmp(capability, SVN_RA_CAPABILITY_PARTIAL_REPLAY) == 0)
Modified: subversion/branches/svn-bisect/subversion/libsvn_ra_svn/editorp.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-bisect/subversion/libsvn_ra_svn/editorp.c?rev=1148749&r1=1148748&r2=1148749&view=diff
==============================================================================
--- subversion/branches/svn-bisect/subversion/libsvn_ra_svn/editorp.c (original)
+++ subversion/branches/svn-bisect/subversion/libsvn_ra_svn/editorp.c Wed Jul 20 13:06:00 2011
@@ -914,6 +914,17 @@ svn_error_t *svn_ra_svn_drive_editor2(sv
}
if (ra_svn_edit_cmds[i].cmd)
err = (*ra_svn_edit_cmds[i].handler)(conn, subpool, params, &state);
+ else if (strcmp(cmd, "failure") == 0)
+ {
+ /* While not really an editor command this can occur when
+ reporter->finish_report() fails before the first editor command */
+ if (aborted)
+ *aborted = TRUE;
+ err = svn_ra_svn__handle_failure_status(params, pool);
+ return svn_error_compose_create(
+ err,
+ editor->abort_edit(edit_baton, subpool));
+ }
else
{
err = svn_error_createf(SVN_ERR_RA_SVN_UNKNOWN_CMD, NULL,
Modified: subversion/branches/svn-bisect/subversion/libsvn_ra_svn/marshal.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-bisect/subversion/libsvn_ra_svn/marshal.c?rev=1148749&r1=1148748&r2=1148749&view=diff
==============================================================================
--- subversion/branches/svn-bisect/subversion/libsvn_ra_svn/marshal.c (original)
+++ subversion/branches/svn-bisect/subversion/libsvn_ra_svn/marshal.c Wed Jul 20 13:06:00 2011
@@ -44,6 +44,7 @@
#include "private/svn_string_private.h"
#include "private/svn_dep_compat.h"
+#include "private/svn_error_private.h"
#define svn_iswhitespace(c) ((c) == ' ' || (c) == '\n')
@@ -1096,7 +1097,14 @@ svn_error_t *svn_ra_svn_write_cmd_failur
SVN_ERR(svn_ra_svn_start_list(conn, pool));
for (; err; err = err->child)
{
- const char *msg = svn_err_best_message(err, buffer, sizeof(buffer));
+ const char *msg;
+
+#ifdef SVN_ERR__TRACING
+ if (svn_error__is_tracing_link(err))
+ msg = err->message;
+ else
+#endif
+ msg = svn_err_best_message(err, buffer, sizeof(buffer));
/* The message string should have been optional, but we can't
easily change that, so marshal nonexistent messages as "". */
Modified: subversion/branches/svn-bisect/subversion/libsvn_ra_svn/protocol
URL: http://svn.apache.org/viewvc/subversion/branches/svn-bisect/subversion/libsvn_ra_svn/protocol?rev=1148749&r1=1148748&r2=1148749&view=diff
==============================================================================
--- subversion/branches/svn-bisect/subversion/libsvn_ra_svn/protocol (original)
+++ subversion/branches/svn-bisect/subversion/libsvn_ra_svn/protocol Wed Jul 20 13:06:00 2011
@@ -202,6 +202,11 @@ capability and C indicates a client capa
[S] atomic-revprops If the server presents this capability, it
supports the change-rev-prop2 command.
See section 3.1.1.
+[S] validate-inherited-mergeinfo If the server presents this capability, it
+ understands the optional
+ validate-inherited-mergeinfo parameter in
+ the get-mergeinfo command. See section
+ 3.1.1.
3. Commands
-----------
@@ -325,7 +330,8 @@ second place for auth-request point as n
get-mergeinfo
params: ( ( path:string ... ) [ rev:number ] inherit:word
- descendents:bool)
+ descendents:bool
+ ? validate-inherited-mergeinfo:bool)
response: ( ( ( path:string merge-info:string ) ... ) )
New in svn 1.5. If no paths are specified, an empty response is
returned. If rev is not specified, the youngest revision is used.
Modified: subversion/branches/svn-bisect/subversion/libsvn_repos/commit.c
URL: http://svn.apache.org/viewvc/subversion/branches/svn-bisect/subversion/libsvn_repos/commit.c?rev=1148749&r1=1148748&r2=1148749&view=diff
==============================================================================
--- subversion/branches/svn-bisect/subversion/libsvn_repos/commit.c (original)
+++ subversion/branches/svn-bisect/subversion/libsvn_repos/commit.c Wed Jul 20 13:06:00 2011
@@ -531,39 +531,6 @@ open_file(const char *path,
}
-/* Verify the mergeinfo property value VALUE and return an error if it
- * is invalid. The PATH on which that property is set is used for error
- * messages only. Use SCRATCH_POOL for temporary allocations. */
-static svn_error_t *
-verify_mergeinfo(const svn_string_t *value,
- const char *path,
- apr_pool_t *scratch_pool)
-{
- svn_error_t *err;
- svn_mergeinfo_t mergeinfo;
-
- /* It's okay to delete svn:mergeinfo. */
- if (value == NULL)
- return SVN_NO_ERROR;
-
- /* Mergeinfo is UTF-8 encoded so the number of bytes returned by strlen()
- * should match VALUE->LEN. Prevents trailing garbage in the property. */
- if (strlen(value->data) != value->len)
- return svn_error_createf(SVN_ERR_MERGEINFO_PARSE_ERROR, NULL,
- _("Commit rejected because mergeinfo on '%s' "
- "contains unexpected string terminator"),
- path);
-
- err = svn_mergeinfo_parse(&mergeinfo, value->data, scratch_pool);
- if (err)
- return svn_error_createf(err->apr_err, err,
- _("Commit rejected because mergeinfo on '%s' "
- "is syntactically invalid"),
- path);
- return SVN_NO_ERROR;
-}
-
-
static svn_error_t *
change_file_prop(void *file_baton,
const char *name,
@@ -577,9 +544,6 @@ change_file_prop(void *file_baton,
SVN_ERR(check_authz(eb, fb->path, eb->txn_root,
svn_authz_write, pool));
- if (value && strcmp(name, SVN_PROP_MERGEINFO) == 0)
- SVN_ERR(verify_mergeinfo(value, fb->path, pool));
-
return svn_repos_fs_change_node_prop(eb->txn_root, fb->path,
name, value, pool);
}
@@ -638,9 +602,6 @@ change_dir_prop(void *dir_baton,
return out_of_date(db->path, svn_node_dir);
}
- if (value && strcmp(name, SVN_PROP_MERGEINFO) == 0)
- SVN_ERR(verify_mergeinfo(value, db->path, pool));
-
return svn_repos_fs_change_node_prop(eb->txn_root, db->path,
name, value, pool);
}