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 [6/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/libsvn_ra_serf/update.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/update.c?rev=1501136&r1=1501135&r2=1501136&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/update.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/update.c Tue Jul 9 08:48:43 2013
@@ -49,6 +49,10 @@
#include "ra_serf.h"
#include "../libsvn_ra/ra_loader.h"
+/*
+#define USE_TRANSITION_PARSER
+*/
+
/*
* This enum represents the current state of our XML parsing for a REPORT.
@@ -64,7 +68,7 @@
*/
typedef enum report_state_e {
NONE = 0,
- INITIAL = 0,
+ INITIAL = XML_STATE_INITIAL /* = 0 */,
UPDATE_REPORT,
TARGET_REVISION,
OPEN_DIR,
@@ -77,6 +81,17 @@ typedef enum report_state_e {
IGNORE_PROP_NAME,
NEED_PROP_NAME,
TXDELTA
+
+#ifdef USE_TRANSITION_PARSER
+ ,
+
+ CHECKED_IN,
+ CHECKED_IN_HREF,
+
+ SET_PROP,
+
+ MD5_CHECKSUM
+#endif
} report_state_e;
@@ -375,9 +390,6 @@ struct report_context_t {
/* The path to the REPORT request */
const char *path;
- /* Are we done parsing the REPORT response? */
- svn_boolean_t done;
-
/* Did we receive all data from the network? */
svn_boolean_t report_received;
@@ -392,13 +404,14 @@ struct report_context_t {
};
-#ifdef NOT_USED_YET
+#ifdef USE_TRANSITION_PARSER
#define D_ "DAV:"
#define S_ SVN_XML_NAMESPACE
+#define V_ SVN_DAV_PROP_NS_DAV
static const svn_ra_serf__xml_transition_t update_ttable[] = {
{ INITIAL, S_, "update-report", UPDATE_REPORT,
- FALSE, { NULL }, FALSE },
+ FALSE, { NULL }, TRUE },
{ UPDATE_REPORT, S_, "target-revision", TARGET_REVISION,
FALSE, { "rev", NULL }, TRUE },
@@ -410,19 +423,19 @@ static const svn_ra_serf__xml_transition
FALSE, { "rev", "name", NULL }, TRUE },
{ OPEN_DIR, S_, "add-directory", ADD_DIR,
- FALSE, { "rev", "name", "?copyfrom-path", "?copyfrom-rev", NULL }, TRUE },
+ FALSE, { "name", "?rev", "?copyfrom-path", "?copyfrom-rev", NULL }, TRUE },
{ ADD_DIR, S_, "add-directory", ADD_DIR,
- FALSE, { "rev", "name", "?copyfrom-path", "?copyfrom-rev", NULL }, TRUE },
+ FALSE, { "name", "?rev", "?copyfrom-path", "?copyfrom-rev", NULL }, TRUE },
{ OPEN_DIR, S_, "open-file", OPEN_FILE,
FALSE, { "rev", "name", NULL }, TRUE },
{ OPEN_DIR, S_, "add-file", ADD_FILE,
- FALSE, { "rev", "name", "?copyfrom-path", "?copyfrom-rev", NULL }, TRUE },
+ FALSE, { "name", "?rev", "?copyfrom-path", "?copyfrom-rev", NULL }, TRUE },
{ ADD_DIR, S_, "add-file", ADD_FILE,
- FALSE, { "rev", "name", "?copyfrom-path", "?copyfrom-rev", NULL }, TRUE },
+ FALSE, { "name", "?rev", "?copyfrom-path", "?copyfrom-rev", NULL }, TRUE },
{ OPEN_DIR, S_, "delete-entry", OPEN_FILE,
FALSE, { "?rev", "name", NULL }, TRUE },
@@ -439,65 +452,45 @@ static const svn_ra_serf__xml_transition
{ ADD_DIR, S_, "absent-file", ABSENT_FILE,
FALSE, { "name", NULL }, TRUE },
- { 0 }
-};
+ { OPEN_DIR, D_, "checked-in", CHECKED_IN,
+ FALSE, { NULL }, FALSE },
+ { ADD_DIR, D_, "checked-in", CHECKED_IN,
+ FALSE, { NULL }, FALSE },
-/* Conforms to svn_ra_serf__xml_opened_t */
-static svn_error_t *
-update_opened(svn_ra_serf__xml_estate_t *xes,
- void *baton,
- int entered_state,
- const svn_ra_serf__dav_props_t *tag,
- apr_pool_t *scratch_pool)
-{
- report_context_t *ctx = baton;
+ { ADD_FILE, D_, "checked-in", CHECKED_IN,
+ FALSE, { NULL }, FALSE },
- return SVN_NO_ERROR;
-}
+ { OPEN_DIR, S_, "set-prop", SET_PROP,
+ TRUE, { "name", "?encoding", NULL }, TRUE },
+ { ADD_DIR, S_, "set-prop", SET_PROP,
+ TRUE, { "name", "?encoding", NULL }, TRUE },
-/* Conforms to svn_ra_serf__xml_closed_t */
-static svn_error_t *
-update_closed(svn_ra_serf__xml_estate_t *xes,
- void *baton,
- int leaving_state,
- const svn_string_t *cdata,
- apr_hash_t *attrs,
- apr_pool_t *scratch_pool)
-{
- report_context_t *ctx = baton;
+ { OPEN_FILE, S_, "set-prop", SET_PROP,
+ TRUE, { "name", "?encoding", NULL }, TRUE },
- if (leaving_state == TARGET_REVISION)
- {
- const char *rev = svn_hash_gets(attrs, "rev");
+ { ADD_FILE, S_, "set-prop", SET_PROP,
+ TRUE, { "name", "?encoding", NULL }, TRUE },
- SVN_ERR(ctx->update_editor->set_target_revision(ctx->update_baton,
- SVN_STR_TO_REV(rev),
- ctx->sess->pool));
- }
- return SVN_NO_ERROR;
-}
+ { OPEN_FILE, S_, "prop", PROP,
+ FALSE, { NULL }, FALSE },
+ { ADD_FILE, S_, "prop", PROP,
+ FALSE, { NULL }, FALSE },
+ { CHECKED_IN, D_, "href", CHECKED_IN_HREF,
+ TRUE, { NULL }, TRUE },
-/* Conforms to svn_ra_serf__xml_cdata_t */
-static svn_error_t *
-update_cdata(svn_ra_serf__xml_estate_t *xes,
- void *baton,
- int current_state,
- const char *data,
- apr_size_t len,
- apr_pool_t *scratch_pool)
-{
- report_context_t *ctx = baton;
+ { PROP, V_, "md5-checksum", MD5_CHECKSUM,
+ TRUE, { NULL }, TRUE },
- return SVN_NO_ERROR;
-}
+ { 0 }
+};
-#endif /* NOT_USED_YET */
+#endif /* USE_TRANSITION_PARSER */
/* Returns best connection for fetching files/properties. */
@@ -2539,6 +2532,72 @@ cdata_report(svn_ra_serf__xml_parser_t *
return SVN_NO_ERROR;
}
+#ifdef USE_TRANSITION_PARSER
+/* Conforms to svn_ra_serf__xml_opened_t */
+static svn_error_t *
+update_opened(svn_ra_serf__xml_estate_t *xes,
+ void *baton,
+ int entered_state,
+ const svn_ra_serf__dav_props_t *tag,
+ apr_pool_t *scratch_pool)
+{
+ report_context_t *ctx = baton;
+ SVN_DBG(("Enter state: %d", entered_state));
+
+ return SVN_NO_ERROR;
+}
+
+
+
+/* Conforms to svn_ra_serf__xml_closed_t */
+static svn_error_t *
+update_closed(svn_ra_serf__xml_estate_t *xes,
+ void *baton,
+ int leaving_state,
+ const svn_string_t *cdata,
+ apr_hash_t *attrs,
+ apr_pool_t *scratch_pool)
+{
+ report_context_t *ctx = baton;
+
+ SVN_DBG(("Leaving state: %d", leaving_state));
+
+ if (leaving_state == UPDATE_REPORT)
+ {
+ ctx->report_completed = TRUE;
+ }
+ else if (leaving_state == TARGET_REVISION)
+ {
+ const char *revstr = svn_hash_gets(attrs, "rev");
+ apr_int64_t rev;
+
+ SVN_ERR(svn_cstring_atoi64(&rev, revstr));
+
+ SVN_ERR(ctx->update_editor->set_target_revision(ctx->update_baton,
+ (svn_revnum_t)rev,
+ ctx->sess->pool));
+ }
+
+
+ return SVN_NO_ERROR;
+}
+
+
+/* Conforms to svn_ra_serf__xml_cdata_t */
+static svn_error_t *
+update_cdata(svn_ra_serf__xml_estate_t *xes,
+ void *baton,
+ int current_state,
+ const char *data,
+ apr_size_t len,
+ apr_pool_t *scratch_pool)
+{
+ report_context_t *ctx = baton;
+ SVN_DBG(("Got CDATA in state %d\n", current_state));
+ return SVN_NO_ERROR;
+}
+#endif /* USE_TRANSITION_PARSER */
+
/** Editor callbacks given to callers to create request body */
@@ -2739,7 +2798,7 @@ setup_update_report_headers(serf_bucket_
if (report->sess->using_compression)
{
serf_bucket_headers_setn(headers, "Accept-Encoding",
- "gzip;svndiff1;q=0.9,svndiff;q=0.8");
+ "gzip,svndiff1;q=0.9,svndiff;q=0.8");
}
else
{
@@ -2757,7 +2816,11 @@ finish_report(void *report_baton,
report_context_t *report = report_baton;
svn_ra_serf__session_t *sess = report->sess;
svn_ra_serf__handler_t *handler;
+#ifdef USE_TRANSITION_PARSER
+ svn_ra_serf__xml_context_t *xmlctx;
+#else
svn_ra_serf__xml_parser_t *parser_ctx;
+#endif
const char *report_target;
svn_stringbuf_t *buf = NULL;
apr_pool_t *iterpool = svn_pool_create(pool);
@@ -2787,7 +2850,16 @@ finish_report(void *report_baton,
/* create and deliver request */
report->path = report_target;
+#ifdef USE_TRANSITION_PARSER
+ xmlctx = svn_ra_serf__xml_context_create(update_ttable,
+ update_opened, update_closed,
+ update_cdata,
+ report,
+ pool);
+ handler = svn_ra_serf__create_expat_handler(xmlctx, pool);
+#else
handler = apr_pcalloc(pool, sizeof(*handler));
+#endif
handler->handler_pool = pool;
handler->method = "REPORT";
@@ -2801,6 +2873,7 @@ finish_report(void *report_baton,
handler->conn = sess->conns[0];
handler->session = sess;
+#ifndef USE_TRANSITION_PARSER
parser_ctx = apr_pcalloc(pool, sizeof(*parser_ctx));
parser_ctx->pool = pool;
@@ -2809,12 +2882,13 @@ finish_report(void *report_baton,
parser_ctx->start = start_report;
parser_ctx->end = end_report;
parser_ctx->cdata = cdata_report;
- parser_ctx->done = &report->done;
+ parser_ctx->done = &handler->done;
handler->response_handler = svn_ra_serf__handle_xml_parser;
handler->response_baton = parser_ctx;
report->parser_ctx = parser_ctx;
+#endif
svn_ra_serf__request_create(handler);
@@ -2828,7 +2902,7 @@ finish_report(void *report_baton,
network or because we've spooled the entire response into our "pending"
content of the XML parser. The DONE flag will get set when all the
XML content has been received *and* parsed. */
- while (!report->done
+ while (!handler->done
|| report->num_active_fetches
|| report->num_active_propfinds)
{
@@ -2865,8 +2939,10 @@ finish_report(void *report_baton,
the connection timed out. */
if (APR_STATUS_IS_TIMEUP(status))
{
- svn_error_clear(err);
- err = SVN_NO_ERROR;
+ /* If there is a pending error, handle it.
+ Unlikely case, as this should have made serf_context run return
+ an error but we shouldn't ignore true errors */
+ SVN_ERR(err);
status = 0;
if (sess->timeout)
@@ -3068,6 +3144,7 @@ finish_report(void *report_baton,
}
report->done_dir_propfinds = NULL;
+#ifndef USE_TRANSITION_PARSER
/* If the parser is paused, and the number of active requests has
dropped far enough, then resume parsing. */
if (parser_ctx->paused
@@ -3082,6 +3159,7 @@ finish_report(void *report_baton,
SVN_ERR(svn_ra_serf__process_pending(parser_ctx,
&report->report_received,
iterpool_inner));
+#endif
/* Debugging purposes only! */
for (i = 0; i < sess->num_conns; i++)
@@ -3202,7 +3280,6 @@ make_update_reporter(svn_ra_session_t *r
report->update_editor = update_editor;
report->update_baton = update_baton;
- report->done = FALSE;
*reporter = &ra_serf_reporter;
*report_baton = report;
Modified: subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/util.c?rev=1501136&r1=1501135&r2=1501136&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/util.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/util.c Tue Jul 9 08:48:43 2013
@@ -99,6 +99,7 @@ struct expat_ctx_t {
svn_ra_serf__xml_context_t *xmlctx;
XML_Parser parser;
svn_ra_serf__handler_t *handler;
+ const int *expected_status;
svn_error_t *inner_error;
@@ -641,8 +642,9 @@ setup_serf_req(serf_request_t *request,
serf_bucket_alloc_t *allocator = serf_request_get_alloc(request);
svn_spillbuf_t *buf;
+ svn_boolean_t set_CL = session->http10 || !session->using_chunked_requests;
- if (session->http10 && body_bkt != NULL)
+ if (set_CL && body_bkt != NULL)
{
/* Ugh. Use HTTP/1.0 to talk to the server because we don't know if
it speaks HTTP/1.1 (and thus, chunked requests), or because the
@@ -670,7 +672,7 @@ setup_serf_req(serf_request_t *request,
/* Set the Content-Length value. This will also trigger an HTTP/1.0
request (rather than the default chunked request). */
- if (session->http10)
+ if (set_CL)
{
if (body_bkt == NULL)
serf_bucket_request_set_CL(*req_bkt, 0);
@@ -2414,8 +2416,10 @@ svn_ra_serf__error_on_status(serf_status
case 411:
return svn_error_createf(SVN_ERR_RA_DAV_REQUEST_FAILED, NULL,
- _("DAV request failed: "
- "Content length required"));
+ _("DAV request failed: 411 Content length required. The "
+ "server or an intermediate proxy does not accept "
+ "chunked encoding. Try setting 'busted-proxy=yes' "
+ "in your client configuration."));
}
if (sline.code >= 300)
@@ -2503,38 +2507,65 @@ expat_response_handler(serf_request_t *r
apr_pool_t *scratch_pool)
{
struct expat_ctx_t *ectx = baton;
+ svn_boolean_t got_expected_status;
- if (!ectx->parser)
+ if (ectx->expected_status)
{
- ectx->parser = XML_ParserCreate(NULL);
- apr_pool_cleanup_register(ectx->cleanup_pool, &ectx->parser,
- xml_parser_cleanup, apr_pool_cleanup_null);
- XML_SetUserData(ectx->parser, ectx);
- XML_SetElementHandler(ectx->parser, expat_start, expat_end);
- XML_SetCharacterDataHandler(ectx->parser, expat_cdata);
+ const int *status = ectx->expected_status;
+ got_expected_status = FALSE;
+
+ while (*status && ectx->handler->sline.code != *status)
+ status++;
+
+ got_expected_status = (*status) != 0;
}
+ else
+ got_expected_status = (ectx->handler->sline.code == 200);
- /* ### TODO: sline.code < 200 should really be handled by the core */
- if ((ectx->handler->sline.code < 200) || (ectx->handler->sline.code >= 300))
+ if ((ectx->handler->sline.code < 200) || (ectx->handler->sline.code >= 300)
+ || ! got_expected_status)
{
/* By deferring to expect_empty_body(), it will make a choice on
how to handle the body. Whatever the decision, the core handler
will take over, and we will not be called again. */
+
+ /* ### This handles xml bodies as svn-errors (returned via serf context
+ ### loop), but ignores non-xml errors.
+
+ Current code depends on this behavior and checks itself while other
+ continues, and then verifies if work has been performed.
+
+ ### TODO: Make error checking consistent */
+
+ /* ### If !GOT_EXPECTED_STATUS, this should always produce an error */
return svn_error_trace(svn_ra_serf__expect_empty_body(
request, response, ectx->handler,
scratch_pool));
}
+ if (!ectx->parser)
+ {
+ ectx->parser = XML_ParserCreate(NULL);
+ apr_pool_cleanup_register(ectx->cleanup_pool, &ectx->parser,
+ xml_parser_cleanup, apr_pool_cleanup_null);
+ XML_SetUserData(ectx->parser, ectx);
+ XML_SetElementHandler(ectx->parser, expat_start, expat_end);
+ XML_SetCharacterDataHandler(ectx->parser, expat_cdata);
+ }
+
while (1)
{
apr_status_t status;
const char *data;
apr_size_t len;
int expat_status;
+ svn_boolean_t at_eof = FALSE;
status = serf_bucket_read(response, PARSE_CHUNK_SIZE, &data, &len);
if (SERF_BUCKET_READ_ERROR(status))
return svn_ra_serf__wrap_err(status, NULL);
+ else if (APR_STATUS_IS_EOF(status))
+ at_eof = TRUE;
#if 0
/* ### move restart/skip into the core handler */
@@ -2546,7 +2577,17 @@ expat_response_handler(serf_request_t *r
/* ### should we have an IGNORE_ERRORS flag like the v1 parser? */
- expat_status = XML_Parse(ectx->parser, data, (int)len, 0 /* isFinal */);
+ expat_status = XML_Parse(ectx->parser, data, (int)len,
+ at_eof /* isFinal */);
+
+ if (at_eof
+ || ectx->inner_error
+ || expat_status != XML_STATUS_OK)
+ {
+ /* Release xml parser state/tables. */
+ apr_pool_cleanup_run(ectx->cleanup_pool, &ectx->parser,
+ xml_parser_cleanup);
+ }
/* We need to check INNER_ERROR first. This is an error from the
callbacks that has been "dropped off" for us to retrieve. On
@@ -2555,15 +2596,9 @@ expat_response_handler(serf_request_t *r
If an error is not present, THEN we go ahead and look for parsing
errors. */
- if (ectx->inner_error)
- {
- apr_pool_cleanup_run(ectx->cleanup_pool, &ectx->parser,
- xml_parser_cleanup);
- return svn_error_trace(ectx->inner_error);
- }
- if (expat_status == XML_STATUS_ERROR)
- return svn_error_createf(SVN_ERR_XML_MALFORMED,
- ectx->inner_error,
+ SVN_ERR(ectx->inner_error);
+ if (expat_status != XML_STATUS_OK)
+ return svn_error_createf(SVN_ERR_XML_MALFORMED, NULL,
_("The %s response contains invalid XML"
" (%d %s)"),
ectx->handler->method,
@@ -2572,18 +2607,10 @@ expat_response_handler(serf_request_t *r
/* The parsing went fine. What has the bucket told us? */
- if (APR_STATUS_IS_EOF(status))
+ if (at_eof)
{
- /* Tell expat we've reached the end of the content. Ignore the
- return status. We just don't care. */
- (void) XML_Parse(ectx->parser, NULL, 0, 1 /* isFinal */);
-
- svn_ra_serf__xml_context_destroy(ectx->xmlctx);
- apr_pool_cleanup_run(ectx->cleanup_pool, &ectx->parser,
- xml_parser_cleanup);
-
- /* ### should check XMLCTX to see if it has returned to the
- ### INITIAL state. we may have ended early... */
+ /* Make sure we actually got xml and clean up after parsing */
+ SVN_ERR(svn_ra_serf__xml_context_done(ectx->xmlctx));
}
if (status && !SERF_BUCKET_READ_ERROR(status))
@@ -2598,6 +2625,7 @@ expat_response_handler(serf_request_t *r
svn_ra_serf__handler_t *
svn_ra_serf__create_expat_handler(svn_ra_serf__xml_context_t *xmlctx,
+ const int *expected_status,
apr_pool_t *result_pool)
{
svn_ra_serf__handler_t *handler;
@@ -2606,6 +2634,7 @@ svn_ra_serf__create_expat_handler(svn_ra
ectx = apr_pcalloc(result_pool, sizeof(*ectx));
ectx->xmlctx = xmlctx;
ectx->parser = NULL;
+ ectx->expected_status = expected_status;
ectx->cleanup_pool = result_pool;
Modified: subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/util_error.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/util_error.c?rev=1501136&r1=1501135&r2=1501136&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/util_error.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/util_error.c Tue Jul 9 08:48:43 2013
@@ -61,6 +61,7 @@ svn_ra_serf__wrap_err(apr_status_t statu
if (serf_err_msg)
{
+ err = svn_error_create(SVN_ERR_RA_SERF_WRAPPED_ERROR, err, NULL);
err_msg = serf_err_msg;
}
else
Modified: subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/xml.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/xml.c?rev=1501136&r1=1501135&r2=1501136&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/xml.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_ra_serf/xml.c Tue Jul 9 08:48:43 2013
@@ -57,6 +57,7 @@ struct svn_ra_serf__xml_context_t {
svn_ra_serf__xml_opened_t opened_cb;
svn_ra_serf__xml_closed_t closed_cb;
svn_ra_serf__xml_cdata_t cdata_cb;
+ svn_ra_serf__xml_done_t done_cb;
void *baton;
/* Linked list of free states. */
@@ -458,11 +459,58 @@ lazy_create_pool(void *baton)
return xes->state_pool;
}
-void
-svn_ra_serf__xml_context_destroy(
- svn_ra_serf__xml_context_t *xmlctx)
+svn_error_t *
+svn_ra_serf__xml_context_done(svn_ra_serf__xml_context_t *xmlctx)
{
+ if (xmlctx->current->prev)
+ {
+ /* Probably unreachable as this would be an xml parser error */
+ return svn_error_createf(SVN_ERR_XML_MALFORMED, NULL,
+ _("XML stream truncated: closing '%s' missing"),
+ xmlctx->current->tag.name);
+ }
+ else if (! xmlctx->free_states)
+ {
+ /* If we have no items on the free_states list, we didn't push anything,
+ which tells us that we found an empty xml body */
+ const svn_ra_serf__xml_transition_t *scan;
+ const svn_ra_serf__xml_transition_t *document = NULL;
+ const char *msg;
+
+ for (scan = xmlctx->ttable; scan->ns != NULL; ++scan)
+ {
+ if (scan->from_state == XML_STATE_INITIAL)
+ {
+ if (document != NULL)
+ {
+ document = NULL; /* Multiple document elements defined */
+ break;
+ }
+ document = scan;
+ }
+ }
+
+ if (document)
+ msg = apr_psprintf(xmlctx->scratch_pool, "'%s' element not found",
+ document->name);
+ else
+ msg = _("document element not found");
+
+ return svn_error_createf(SVN_ERR_XML_MALFORMED, NULL,
+ _("XML stream truncated: %s"),
+ msg);
+ }
+
+ if (xmlctx->done_cb != NULL)
+ {
+ START_CALLBACK(xmlctx);
+ SVN_ERR(xmlctx->done_cb(xmlctx->baton,
+ xmlctx->scratch_pool));
+ END_CALLBACK(xmlctx);
+ }
+
svn_pool_destroy(xmlctx->scratch_pool);
+ return SVN_NO_ERROR;
}
svn_ra_serf__xml_context_t *
@@ -471,6 +519,7 @@ svn_ra_serf__xml_context_create(
svn_ra_serf__xml_opened_t opened_cb,
svn_ra_serf__xml_closed_t closed_cb,
svn_ra_serf__xml_cdata_t cdata_cb,
+ svn_ra_serf__xml_done_t done_cb,
void *baton,
apr_pool_t *result_pool)
{
@@ -482,6 +531,7 @@ svn_ra_serf__xml_context_create(
xmlctx->opened_cb = opened_cb;
xmlctx->closed_cb = closed_cb;
xmlctx->cdata_cb = cdata_cb;
+ xmlctx->done_cb = done_cb;
xmlctx->baton = baton;
xmlctx->scratch_pool = svn_pool_create(result_pool);
@@ -615,6 +665,14 @@ svn_ra_serf__xml_cb_start(svn_ra_serf__x
}
if (scan->ns == NULL)
{
+ if (current->state == XML_STATE_INITIAL)
+ {
+ return svn_error_createf(
+ SVN_ERR_XML_UNEXPECTED_ELEMENT, NULL,
+ _("XML Parsing failed: Unexpected root element '%s'"),
+ elemname.name);
+ }
+
xmlctx->waiting = elemname;
/* ### return? */
return SVN_NO_ERROR;
@@ -669,10 +727,11 @@ svn_ra_serf__xml_cb_start(svn_ra_serf__x
name = *saveattr;
value = svn_xml_get_attr_value(name, attrs);
if (value == NULL)
- return svn_error_createf(SVN_ERR_XML_ATTRIB_NOT_FOUND,
- NULL,
- _("Missing XML attribute: '%s'"),
- name);
+ return svn_error_createf(
+ SVN_ERR_XML_ATTRIB_NOT_FOUND,
+ NULL,
+ _("Missing XML attribute '%s' on '%s' element"),
+ name, scan->name);
}
if (value)
Modified: subversion/branches/verify-keep-going/subversion/libsvn_ra_svn/client.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_ra_svn/client.c?rev=1501136&r1=1501135&r2=1501136&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_ra_svn/client.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_ra_svn/client.c Tue Jul 9 08:48:43 2013
@@ -978,6 +978,28 @@ static svn_error_t *ra_svn_commit(svn_ra
const svn_string_t *log_msg = svn_hash_gets(revprop_table,
SVN_PROP_REVISION_LOG);
+ if (log_msg == NULL &&
+ ! svn_ra_svn_has_capability(conn, SVN_RA_SVN_CAP_COMMIT_REVPROPS))
+ {
+ return svn_error_createf(SVN_ERR_BAD_PROPERTY_VALUE, NULL,
+ _("ra_svn does not support not specifying "
+ "a log message with pre-1.5 servers; "
+ "consider passing an empty one, or upgrading "
+ "the server"));
+ }
+ else if (log_msg == NULL)
+ /* 1.5+ server. Set LOG_MSG to something, since the 'logmsg' argument
+ to the 'commit' protocol command is non-optional; on the server side,
+ only REVPROP_TABLE will be used, and LOG_MSG will be ignored. The
+ "svn:log" member of REVPROP_TABLE table is NULL, therefore the commit
+ will have a NULL log message (not just "", really NULL).
+
+ svnserve 1.5.x+ has always ignored LOG_MSG when REVPROP_TABLE was
+ present; this was elevated to a protocol promise in r1498550 (and
+ later documented in this comment) in order to fix the segmentation
+ fault bug described in the log message of r1498550.*/
+ log_msg = svn_string_create("", pool);
+
/* If we're sending revprops other than svn:log, make sure the server won't
silently ignore them. */
if (apr_hash_count(revprop_table) > 1 &&
Modified: subversion/branches/verify-keep-going/subversion/libsvn_ra_svn/protocol
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_ra_svn/protocol?rev=1501136&r1=1501135&r2=1501136&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_ra_svn/protocol (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_ra_svn/protocol Tue Jul 9 08:48:43 2013
@@ -294,8 +294,12 @@ second place for auth-request point as n
Upon receiving response, client switches to editor command set.
Upon successful completion of edit, server sends auth-request.
After auth exchange completes, server sends commit-info.
+ If rev-props is present, logmsg is ignored. Only the svn:log entry in
+ rev-props (if any) will be used.
commit-info: ( new-rev:number date:string author:string
? ( post-commit-err:string ) )
+ NOTE: when revving this, make 'logmsg' optional, or delete that parameter
+ and have the log message specified in 'rev-props'.
get-file
params: ( path:string [ rev:number ] want-props:bool want-contents:bool
Modified: subversion/branches/verify-keep-going/subversion/libsvn_repos/fs-wrap.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_repos/fs-wrap.c?rev=1501136&r1=1501135&r2=1501136&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_repos/fs-wrap.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_repos/fs-wrap.c Tue Jul 9 08:48:43 2013
@@ -172,6 +172,10 @@ svn_repos__validate_prop(const char *nam
{
svn_prop_kind_t kind = svn_property_kind2(name);
+ /* Allow deleting any property, even a property we don't allow to set. */
+ if (value == NULL)
+ return SVN_NO_ERROR;
+
/* Disallow setting non-regular properties. */
if (kind != svn_prop_regular_kind)
return svn_error_createf
Modified: subversion/branches/verify-keep-going/subversion/libsvn_repos/repos.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_repos/repos.c?rev=1501136&r1=1501135&r2=1501136&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_repos/repos.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_repos/repos.c Tue Jul 9 08:48:43 2013
@@ -1534,6 +1534,54 @@ svn_repos_open2(svn_repos_t **repos_p,
return get_repos(repos_p, path, FALSE, FALSE, TRUE, fs_config, pool);
}
+/* Baton used with fs_upgrade_notify, specifying the svn_repos layer
+ * notification parameters.
+ */
+struct fs_upgrade_notify_baton_t
+{
+ svn_repos_notify_func_t notify_func;
+ void *notify_baton;
+};
+
+/* Implements svn_fs_upgrade_notify_t as forwarding to a
+ * svn_repos_notify_func_t passed in a fs_upgrade_notify_baton_t* BATON.
+ */
+static svn_error_t *
+fs_upgrade_notify(void *baton,
+ apr_uint64_t number,
+ svn_fs_upgrade_notify_action_t action,
+ apr_pool_t *pool)
+{
+ struct fs_upgrade_notify_baton_t *fs_baton = baton;
+
+ svn_repos_notify_t *notify = svn_repos_notify_create(
+ svn_repos_notify_mutex_acquired, pool);
+ switch(action)
+ {
+ case svn_fs_upgrade_pack_revprops:
+ notify->shard = number;
+ notify->action = svn_repos_notify_pack_revprops;
+ break;
+
+ case svn_fs_upgrade_cleanup_revprops:
+ notify->shard = number;
+ notify->action = svn_repos_notify_cleanup_revprops;
+ break;
+
+ case svn_fs_upgrade_format_bumped:
+ notify->revision = number;
+ notify->action = svn_repos_notify_format_bumped;
+ break;
+
+ default:
+ /* unknown notification */
+ SVN_ERR_MALFUNCTION();
+ }
+
+ fs_baton->notify_func(fs_baton->notify_baton, notify, pool);
+
+ return SVN_NO_ERROR;
+}
svn_error_t *
svn_repos_upgrade2(const char *path,
@@ -1547,6 +1595,10 @@ svn_repos_upgrade2(const char *path,
int format;
apr_pool_t *subpool = svn_pool_create(pool);
+ struct fs_upgrade_notify_baton_t fs_notify_baton;
+ fs_notify_baton.notify_func = notify_func;
+ fs_notify_baton.notify_baton = notify_baton;
+
/* Fetch a repository object; for the Berkeley DB backend, it is
initialized with an EXCLUSIVE lock on the database. This will at
least prevent others from trying to read or write to it while we
@@ -1575,7 +1627,9 @@ svn_repos_upgrade2(const char *path,
SVN_ERR(svn_io_write_version_file(format_path, format, subpool));
/* Try to upgrade the filesystem. */
- SVN_ERR(svn_fs_upgrade(repos->db_path, subpool));
+ SVN_ERR(svn_fs_upgrade2(repos->db_path,
+ notify_func ? fs_upgrade_notify : NULL,
+ &fs_notify_baton, NULL, NULL, subpool));
/* Now overwrite our format file with the latest version. */
SVN_ERR(svn_io_write_version_file(format_path, SVN_REPOS__FORMAT_NUMBER,
Modified: subversion/branches/verify-keep-going/subversion/libsvn_subr/config_file.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_subr/config_file.c?rev=1501136&r1=1501135&r2=1501136&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_subr/config_file.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_subr/config_file.c Tue Jul 9 08:48:43 2013
@@ -94,7 +94,7 @@ parser_getc(parse_context_t *ctx, int *c
}
else if (ctx->buffer_pos < ctx->buffer_size)
{
- *c = ctx->parser_buffer[ctx->buffer_pos];
+ *c = (unsigned char)ctx->parser_buffer[ctx->buffer_pos];
ctx->buffer_pos++;
}
else
@@ -107,7 +107,7 @@ parser_getc(parse_context_t *ctx, int *c
if (ctx->buffer_pos < ctx->buffer_size)
{
- *c = ctx->parser_buffer[ctx->buffer_pos];
+ *c = (unsigned char)ctx->parser_buffer[ctx->buffer_pos];
ctx->buffer_pos++;
}
else
@@ -131,7 +131,7 @@ parser_getc_plain(parse_context_t *ctx,
{
if (ctx->buffer_pos < ctx->buffer_size)
{
- *c = ctx->parser_buffer[ctx->buffer_pos];
+ *c = (unsigned char)ctx->parser_buffer[ctx->buffer_pos];
ctx->buffer_pos++;
return SVN_NO_ERROR;
@@ -189,6 +189,32 @@ skip_to_eoln(parse_context_t *ctx, int *
return SVN_NO_ERROR;
}
+/* Skip a UTF-8 Byte Order Mark if found. */
+static APR_INLINE svn_error_t *
+skip_bom(parse_context_t *ctx)
+{
+ int ch;
+
+ SVN_ERR(parser_getc(ctx, &ch));
+ if (ch == 0xEF)
+ {
+ const unsigned char *buf = (unsigned char *)ctx->parser_buffer;
+ /* This makes assumptions about the implementation of parser_getc and
+ * the use of skip_bom. Specifically that parser_getc() will get all
+ * of the BOM characters into the parse_context_t buffer. This can
+ * safely be assumed as long as we only try to use skip_bom() at the
+ * start of the stream and the buffer is longer than 3 characters. */
+ SVN_ERR_ASSERT(ctx->buffer_size > ctx->buffer_pos + 1);
+ if (buf[ctx->buffer_pos] == 0xBB && buf[ctx->buffer_pos + 1] == 0xBF)
+ ctx->buffer_pos += 2;
+ else
+ SVN_ERR(parser_ungetc(ctx, ch));
+ }
+ else
+ SVN_ERR(parser_ungetc(ctx, ch));
+
+ return SVN_NO_ERROR;
+}
/* Parse a single option value */
static svn_error_t *
@@ -454,6 +480,8 @@ svn_config__parse_stream(svn_config_t *c
ctx->buffer_pos = 0;
ctx->buffer_size = 0;
+ SVN_ERR(skip_bom(ctx));
+
do
{
SVN_ERR(skip_whitespace(ctx, &ch, &count));
@@ -810,6 +838,9 @@ svn_config_ensure(const char *config_dir
"### http-max-connections Maximum number of parallel server" NL
"### connections to use for any given" NL
"### HTTP operation." NL
+ "### busted-proxy The proxy may have some protocol" NL
+ "### issues that Subversion needs to" NL
+ "### detect and work around." NL
"### neon-debug-mask Debug mask for Neon HTTP library" NL
"### ssl-authority-files List of files, each of a trusted CA"
NL
Modified: subversion/branches/verify-keep-going/subversion/libsvn_subr/gpg_agent.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_subr/gpg_agent.c?rev=1501136&r1=1501135&r2=1501136&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_subr/gpg_agent.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_subr/gpg_agent.c Tue Jul 9 08:48:43 2013
@@ -156,42 +156,28 @@ send_option(int sd, char *buf, size_t n,
return (strncmp(buf, "OK", 2) == 0);
}
-/* Implementation of svn_auth__password_get_t that retrieves the password
- from gpg-agent */
+
+/* Locate a running GPG Agent, and return an open file descriptor
+ * for communication with the agent in *NEW_SD. If no running agent
+ * can be found, set *NEW_SD to -1. */
static svn_error_t *
-password_get_gpg_agent(svn_boolean_t *done,
- const char **password,
- apr_hash_t *creds,
- const char *realmstring,
- const char *username,
- apr_hash_t *parameters,
- svn_boolean_t non_interactive,
- apr_pool_t *pool)
+find_running_gpg_agent(int *new_sd, apr_pool_t *pool)
{
- int sd;
+ char *buffer;
char *gpg_agent_info = NULL;
+ const char *socket_name = NULL;
+ const char *request = NULL;
const char *p = NULL;
char *ep = NULL;
- char *buffer;
-
- apr_array_header_t *socket_details;
- const char *request = NULL;
- const char *cache_id = NULL;
- struct sockaddr_un addr;
- const char *tty_name;
- const char *tty_type;
- const char *lc_ctype;
- const char *display;
- const char *socket_name = NULL;
- svn_checksum_t *digest = NULL;
- char *password_prompt;
- char *realm_prompt;
+ int sd;
- *done = FALSE;
+ *new_sd = -1;
gpg_agent_info = getenv("GPG_AGENT_INFO");
if (gpg_agent_info != NULL)
{
+ apr_array_header_t *socket_details;
+
socket_details = svn_cstring_split(gpg_agent_info, ":", TRUE,
pool);
socket_name = APR_ARRAY_IDX(socket_details, 0, const char *);
@@ -201,6 +187,8 @@ password_get_gpg_agent(svn_boolean_t *do
if (socket_name != NULL)
{
+ struct sockaddr_un addr;
+
addr.sun_family = AF_UNIX;
strncpy(addr.sun_path, socket_name, sizeof(addr.sun_path) - 1);
addr.sun_path[sizeof(addr.sun_path) - 1] = '\0';
@@ -273,6 +261,44 @@ password_get_gpg_agent(svn_boolean_t *do
return SVN_NO_ERROR;
}
+ *new_sd = sd;
+ return SVN_NO_ERROR;
+}
+
+/* Implementation of svn_auth__password_get_t that retrieves the password
+ from gpg-agent */
+static svn_error_t *
+password_get_gpg_agent(svn_boolean_t *done,
+ const char **password,
+ apr_hash_t *creds,
+ const char *realmstring,
+ const char *username,
+ apr_hash_t *parameters,
+ svn_boolean_t non_interactive,
+ apr_pool_t *pool)
+{
+ int sd;
+ const char *p = NULL;
+ char *ep = NULL;
+ char *buffer;
+ const char *request = NULL;
+ const char *cache_id = NULL;
+ const char *tty_name;
+ const char *tty_type;
+ const char *lc_ctype;
+ const char *display;
+ svn_checksum_t *digest = NULL;
+ char *password_prompt;
+ char *realm_prompt;
+
+ *done = FALSE;
+
+ SVN_ERR(find_running_gpg_agent(&sd, pool));
+ if (sd == -1)
+ return SVN_NO_ERROR;
+
+ buffer = apr_palloc(pool, BUFFER_SIZE);
+
/* Send TTY_NAME to the gpg-agent daemon. */
tty_name = getenv("GPG_TTY");
if (tty_name != NULL)
@@ -283,11 +309,6 @@ password_get_gpg_agent(svn_boolean_t *do
return SVN_NO_ERROR;
}
}
- else
- {
- close(sd);
- return SVN_NO_ERROR;
- }
/* Send TTY_TYPE to the gpg-agent daemon. */
tty_type = getenv("TERM");
@@ -299,11 +320,6 @@ password_get_gpg_agent(svn_boolean_t *do
return SVN_NO_ERROR;
}
}
- else
- {
- close(sd);
- return SVN_NO_ERROR;
- }
/* Compute LC_CTYPE. */
lc_ctype = getenv("LC_ALL");
@@ -388,8 +404,8 @@ password_get_gpg_agent(svn_boolean_t *do
password in GPG Agent if that's how this particular integration
worked. But it isn't. GPG Agent stores the password provided by
the user via the pinentry program immediately upon its provision
- (and regardless of its accuracy as passwords go), so there's
- nothing really to do here. */
+ (and regardless of its accuracy as passwords go), so we just need
+ to check if a running GPG Agent exists. */
static svn_error_t *
password_set_gpg_agent(svn_boolean_t *done,
apr_hash_t *creds,
@@ -400,6 +416,15 @@ password_set_gpg_agent(svn_boolean_t *do
svn_boolean_t non_interactive,
apr_pool_t *pool)
{
+ int sd;
+
+ *done = FALSE;
+
+ SVN_ERR(find_running_gpg_agent(&sd, pool));
+ if (sd == -1)
+ return SVN_NO_ERROR;
+
+ close(sd);
*done = TRUE;
return SVN_NO_ERROR;
Modified: subversion/branches/verify-keep-going/subversion/libsvn_subr/named_atomic.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_subr/named_atomic.c?rev=1501136&r1=1501135&r2=1501136&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_subr/named_atomic.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_subr/named_atomic.c Tue Jul 9 08:48:43 2013
@@ -251,6 +251,7 @@ struct svn_atomic_namespace__t
*/
static svn_mutex__t *thread_mutex = NULL;
+#if APR_HAS_MMAP
/* Initialization flag for the above used by svn_atomic__init_once.
*/
static volatile svn_atomic_t mutex_initialized = FALSE;
@@ -266,6 +267,7 @@ init_thread_mutex(void *baton, apr_pool_
return svn_mutex__init(&thread_mutex, USE_THREAD_MUTEX, global_pool);
}
+#endif /* APR_HAS_MMAP */
/* Utility that acquires our global mutex and converts error types.
*/
@@ -297,6 +299,7 @@ unlock(struct mutex_t *mutex, svn_error_
unlock_err));
}
+#if APR_HAS_MMAP
/* The last user to close a particular namespace should also remove the
* lock file. Failure to do so, however, does not affect further uses
* of the same namespace.
@@ -318,6 +321,7 @@ delete_lock_file(void *arg)
return status;
}
+#endif /* APR_HAS_MMAP */
/* Validate the ATOMIC parameter, i.e it's address. Correct code will
* never need this but if someone should accidentally to use a NULL or
@@ -351,7 +355,11 @@ return_atomic(svn_named_atomic__t **atom
svn_boolean_t
svn_named_atomic__is_supported(void)
{
-#ifdef _WIN32
+#if !APR_HAS_MMAP
+ return FALSE;
+#elif !defined(_WIN32)
+ return TRUE;
+#else
static svn_tristate_t result = svn_tristate_unknown;
if (result == svn_tristate_unknown)
@@ -373,9 +381,7 @@ svn_named_atomic__is_supported(void)
}
return result == svn_tristate_true;
-#else
- return TRUE;
-#endif
+#endif /* _WIN32 */
}
svn_boolean_t
@@ -389,6 +395,9 @@ svn_atomic_namespace__create(svn_atomic_
const char *name,
apr_pool_t *result_pool)
{
+#if !APR_HAS_MMAP
+ return svn_error_create(APR_ENOTIMPL, NULL, NULL);
+#else
apr_status_t apr_err;
svn_error_t *err;
apr_file_t *file;
@@ -489,6 +498,7 @@ svn_atomic_namespace__create(svn_atomic_
/* Unlock to allow other processes may access the shared memory as well.
*/
return unlock(&new_ns->mutex, err);
+#endif /* APR_HAS_MMAP */
}
svn_error_t *
Modified: subversion/branches/verify-keep-going/subversion/libsvn_subr/pool.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_subr/pool.c?rev=1501136&r1=1501135&r2=1501136&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_subr/pool.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_subr/pool.c Tue Jul 9 08:48:43 2013
@@ -51,7 +51,7 @@ abort_on_pool_failure(int retcode)
{
/* Don't translate this string! It requires memory allocation to do so!
And we don't have any of it... */
- printf("Out of memory - terminating application.\n");
+ printf("libsvn: Out of memory - terminating application.\n");
abort();
return 0; /* not reached */
}
Modified: subversion/branches/verify-keep-going/subversion/libsvn_subr/sqlite.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_subr/sqlite.c?rev=1501136&r1=1501135&r2=1501136&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_subr/sqlite.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_subr/sqlite.c Tue Jul 9 08:48:43 2013
@@ -159,9 +159,9 @@ struct svn_sqlite__value_t
int sqlite_err__temp = (x); \
if (sqlite_err__temp != SQLITE_OK) \
return svn_error_createf(SQLITE_ERROR_CODE(sqlite_err__temp), \
- NULL, "sqlite: %s (S%d)", \
- sqlite3_errmsg((db)->db3), \
- sqlite_err__temp); \
+ NULL, "sqlite[S%d]: %s", \
+ sqlite_err__temp, \
+ sqlite3_errmsg((db)->db3)); \
} while (0)
#define SQLITE_ERR_MSG(x, msg) do \
@@ -169,8 +169,8 @@ struct svn_sqlite__value_t
int sqlite_err__temp = (x); \
if (sqlite_err__temp != SQLITE_OK) \
return svn_error_createf(SQLITE_ERROR_CODE(sqlite_err__temp), \
- NULL, "sqlite: %s (S%d)", (msg), \
- sqlite_err__temp); \
+ NULL, "sqlite[S%d]: %s", \
+ sqlite_err__temp, msg); \
} while (0)
@@ -192,9 +192,9 @@ exec_sql2(svn_sqlite__db_t *db, const ch
if (sqlite_err != SQLITE_OK && sqlite_err != ignored_err)
{
svn_error_t *err = svn_error_createf(SQLITE_ERROR_CODE(sqlite_err), NULL,
- _("sqlite: %s (S%d),"
+ _("sqlite[S%d]: %s,"
" executing statement '%s'"),
- err_msg, sqlite_err, sql);
+ sqlite_err, err_msg, sql);
sqlite3_free(err_msg);
return err;
}
@@ -311,8 +311,8 @@ svn_sqlite__step(svn_boolean_t *got_row,
svn_error_t *err1, *err2;
err1 = svn_error_createf(SQLITE_ERROR_CODE(sqlite_result), NULL,
- "sqlite: %s (S%d)",
- sqlite3_errmsg(stmt->db->db3), sqlite_result);
+ "sqlite[S%d]: %s",
+ sqlite_result, sqlite3_errmsg(stmt->db->db3));
err2 = svn_sqlite__reset(stmt);
return svn_error_compose_create(err1, err2);
}
@@ -763,7 +763,7 @@ init_sqlite(void *baton, apr_pool_t *poo
int err = sqlite3_config(SQLITE_CONFIG_MULTITHREAD);
if (err != SQLITE_OK && err != SQLITE_MISUSE)
return svn_error_createf(SQLITE_ERROR_CODE(err), NULL,
- _("Could not configure SQLite (S%d)"), err);
+ _("Could not configure SQLite [S%d]"), err);
}
SQLITE_ERR_MSG(sqlite3_initialize(), _("Could not initialize SQLite"));
Modified: subversion/branches/verify-keep-going/subversion/libsvn_subr/stream.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_subr/stream.c?rev=1501136&r1=1501135&r2=1501136&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_subr/stream.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_subr/stream.c Tue Jul 9 08:48:43 2013
@@ -56,6 +56,7 @@ struct svn_stream_t {
svn_stream_mark_fn_t mark_fn;
svn_stream_seek_fn_t seek_fn;
svn_stream__is_buffered_fn_t is_buffered_fn;
+ apr_file_t *file; /* Maybe NULL */
};
@@ -81,6 +82,7 @@ svn_stream_create(void *baton, apr_pool_
stream->mark_fn = NULL;
stream->seek_fn = NULL;
stream->is_buffered_fn = NULL;
+ stream->file = NULL;
return stream;
}
@@ -913,6 +915,7 @@ svn_stream_from_aprfile2(apr_file_t *fil
svn_stream_set_mark(stream, mark_handler_apr);
svn_stream_set_seek(stream, seek_handler_apr);
svn_stream__set_is_buffered(stream, is_buffered_handler_apr);
+ stream->file = file;
if (! disown)
svn_stream_set_close(stream, close_handler_apr);
@@ -920,6 +923,12 @@ svn_stream_from_aprfile2(apr_file_t *fil
return stream;
}
+apr_file_t *
+svn_stream__aprfile(svn_stream_t *stream)
+{
+ return stream->file;
+}
+
/* Compressed stream support */
Modified: subversion/branches/verify-keep-going/subversion/libsvn_wc/conflicts.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_wc/conflicts.c?rev=1501136&r1=1501135&r2=1501136&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_wc/conflicts.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_wc/conflicts.c Tue Jul 9 08:48:43 2013
@@ -1277,7 +1277,7 @@ generate_propconflict(svn_boolean_t *con
apr_pool_t *scratch_pool)
{
svn_wc_conflict_result_t *result = NULL;
- svn_wc_conflict_description2_t *cdesc;
+ svn_wc_conflict_description3_t *cdesc;
const char *dirpath = svn_dirent_dirname(local_abspath, scratch_pool);
svn_node_kind_t kind;
const svn_string_t *new_value = NULL;
@@ -1294,7 +1294,7 @@ generate_propconflict(svn_boolean_t *con
svn_dirent_local_style(local_abspath,
scratch_pool));
- cdesc = svn_wc_conflict_description_create_prop2(
+ cdesc = svn_wc_conflict_description_create_prop3(
local_abspath,
(kind == svn_node_dir) ? svn_node_dir : svn_node_file,
propname, scratch_pool);
@@ -1332,7 +1332,6 @@ generate_propconflict(svn_boolean_t *con
base_file stay NULL as-is. Both agents are attempting to add a
new property. */
}
-
else if ((base_val && !incoming_old_val)
|| (!base_val && incoming_old_val))
{
@@ -1354,7 +1353,6 @@ generate_propconflict(svn_boolean_t *con
scratch_pool));
cdesc->base_abspath = svn_dirent_join(dirpath, file_name, scratch_pool);
}
-
else /* base and old are both non-NULL */
{
const svn_string_t *conflict_base_val;
@@ -1398,14 +1396,15 @@ generate_propconflict(svn_boolean_t *con
svn_diff_file_options_t *options =
svn_diff_file_options_create(scratch_pool);
- SVN_ERR(svn_stream_open_unique(&mergestream, &cdesc->merged_file,
+ SVN_ERR(svn_stream_open_unique(&mergestream,
+ &cdesc->prop_reject_abspath,
NULL, svn_io_file_del_on_pool_cleanup,
scratch_pool, scratch_pool));
SVN_ERR(svn_diff_mem_string_diff3(&diff, conflict_base_val,
working_val,
incoming_new_val, options, scratch_pool));
- SVN_ERR(svn_diff_mem_string_output_merge2
- (mergestream, diff, conflict_base_val, working_val,
+ SVN_ERR(svn_diff_mem_string_output_merge2(mergestream, diff,
+ conflict_base_val, working_val,
incoming_new_val, NULL, NULL, NULL, NULL,
svn_diff_conflict_display_modified_latest, scratch_pool));
SVN_ERR(svn_stream_close(mergestream));
@@ -1427,10 +1426,8 @@ generate_propconflict(svn_boolean_t *con
cdesc->reason = svn_wc_conflict_reason_edited;
/* Invoke the interactive conflict callback. */
- {
- SVN_ERR(conflict_func(&result, cdesc, conflict_baton, scratch_pool,
- scratch_pool));
- }
+ SVN_ERR(conflict_func(&result, svn_wc__cd3_to_cd2(cdesc, scratch_pool),
+ conflict_baton, scratch_pool, scratch_pool));
if (result == NULL)
{
*conflict_remains = TRUE;
@@ -1781,7 +1778,7 @@ resolve_text_conflict(svn_skel_t **work_
svn_boolean_t *was_resolved,
svn_wc__db_t *db,
const char *local_abspath,
- svn_wc_conflict_description2_t *cdesc,
+ svn_wc_conflict_description3_t *cdesc,
const apr_array_header_t *merge_options,
svn_wc_conflict_resolver_func2_t conflict_func,
void *conflict_baton,
@@ -1797,8 +1794,8 @@ resolve_text_conflict(svn_skel_t **work_
/* Give the conflict resolution callback a chance to clean
up the conflicts before we mark the file 'conflicted' */
- SVN_ERR(conflict_func(&result, cdesc, conflict_baton, scratch_pool,
- scratch_pool));
+ SVN_ERR(conflict_func(&result, svn_wc__cd3_to_cd2(cdesc, scratch_pool),
+ conflict_baton, scratch_pool, scratch_pool));
if (result == NULL)
return svn_error_create(SVN_ERR_WC_CONFLICT_RESOLVER_FAILURE, NULL,
_("Conflict callback violated API:"
@@ -1851,7 +1848,7 @@ resolve_text_conflict(svn_skel_t **work_
* Allocate results in RESULT_POOL. SCRATCH_POOL is used for temporary
* allocations. */
static svn_error_t *
-read_text_conflict_desc(svn_wc_conflict_description2_t **desc,
+read_text_conflict_desc(svn_wc_conflict_description3_t **desc,
svn_wc__db_t *db,
const char *local_abspath,
const svn_skel_t *conflict_skel,
@@ -1863,7 +1860,7 @@ read_text_conflict_desc(svn_wc_conflict_
apr_pool_t *result_pool,
apr_pool_t *scratch_pool)
{
- *desc = svn_wc_conflict_description_create_text2(local_abspath, result_pool);
+ *desc = svn_wc_conflict_description_create_text3(local_abspath, result_pool);
(*desc)->is_binary = is_binary;
(*desc)->mime_type = mime_type;
(*desc)->operation = operation;
@@ -1891,7 +1888,7 @@ read_text_conflict_desc(svn_wc_conflict_
* Allocate results in RESULT_POOL. SCRATCH_POOL is used for temporary
* allocations. */
static svn_error_t *
-read_tree_conflict_desc(svn_wc_conflict_description2_t **desc,
+read_tree_conflict_desc(svn_wc_conflict_description3_t **desc,
svn_wc__db_t *db,
const char *local_abspath,
const svn_skel_t *conflict_skel,
@@ -1916,7 +1913,7 @@ read_tree_conflict_desc(svn_wc_conflict_
else
tc_kind = svn_node_file; /* Avoid assertion */
- *desc = svn_wc_conflict_description_create_tree2(local_abspath, tc_kind,
+ *desc = svn_wc_conflict_description_create_tree3(local_abspath, tc_kind,
operation,
left_version, right_version,
result_pool);
@@ -2042,7 +2039,7 @@ svn_wc__conflict_invoke_resolver(svn_wc_
{
svn_skel_t *work_items;
svn_boolean_t was_resolved;
- svn_wc_conflict_description2_t *desc;
+ svn_wc_conflict_description3_t *desc;
apr_hash_t *props;
SVN_ERR(svn_wc__db_read_props(&props, db, local_abspath,
@@ -2079,7 +2076,7 @@ svn_wc__conflict_invoke_resolver(svn_wc_
if (tree_conflicted)
{
svn_wc_conflict_result_t *result;
- svn_wc_conflict_description2_t *desc;
+ svn_wc_conflict_description3_t *desc;
SVN_ERR(read_tree_conflict_desc(&desc,
db, local_abspath, conflict_skel,
@@ -2087,8 +2084,8 @@ svn_wc__conflict_invoke_resolver(svn_wc_
scratch_pool, scratch_pool));
/* Tell the resolver func about this conflict. */
- SVN_ERR(resolver_func(&result, desc, resolver_baton, scratch_pool,
- scratch_pool));
+ SVN_ERR(resolver_func(&result, svn_wc__cd3_to_cd2(desc, scratch_pool),
+ resolver_baton, scratch_pool, scratch_pool));
/* Ignore the result. We cannot apply it here since this code runs
* during an update or merge operation. Tree conflicts are always
@@ -2144,22 +2141,19 @@ read_prop_conflict_descs(apr_array_heade
if ((! create_tempfiles) || apr_hash_count(conflicted_props) == 0)
{
/* Legacy prop conflict with only a .reject file. */
- svn_wc_conflict_description2_t *desc;
+ svn_wc_conflict_description3_t *desc;
- desc = svn_wc_conflict_description_create_prop2(local_abspath,
+ desc = svn_wc_conflict_description_create_prop3(local_abspath,
node_kind,
"", result_pool);
- /* ### This should be changed. The prej file should be stored
- * ### separately from the other files. We need to rev the
- * ### conflict description struct for this. */
- desc->their_abspath = apr_pstrdup(result_pool, prop_reject_file);
+ desc->prop_reject_abspath = apr_pstrdup(result_pool, prop_reject_file);
desc->operation = operation;
desc->src_left_version = left_version;
desc->src_right_version = right_version;
- APR_ARRAY_PUSH(conflicts, svn_wc_conflict_description2_t*) = desc;
+ APR_ARRAY_PUSH(conflicts, svn_wc_conflict_description3_t *) = desc;
return SVN_NO_ERROR;
}
@@ -2173,14 +2167,14 @@ read_prop_conflict_descs(apr_array_heade
svn_string_t *old_value;
svn_string_t *my_value;
svn_string_t *their_value;
- svn_wc_conflict_description2_t *desc;
+ svn_wc_conflict_description3_t *desc;
svn_pool_clear(iterpool);
- desc = svn_wc_conflict_description_create_prop2(local_abspath,
- node_kind,
- propname,
- result_pool);
+ desc = svn_wc_conflict_description_create_prop3(local_abspath,
+ node_kind,
+ propname,
+ result_pool);
desc->operation = operation;
desc->src_left_version = left_version;
@@ -2208,10 +2202,7 @@ read_prop_conflict_descs(apr_array_heade
else
desc->reason = svn_wc_conflict_reason_edited;
- /* ### This should be changed. The prej file should be stored
- * ### separately from the other files. We need to rev the
- * ### conflict description struct for this. */
- desc->their_abspath = apr_pstrdup(result_pool, prop_reject_file);
+ desc->prop_reject_abspath = apr_pstrdup(result_pool, prop_reject_file);
/* ### This should be changed. The conflict description for
* ### props should contain these values as svn_string_t,
@@ -2235,10 +2226,7 @@ read_prop_conflict_descs(apr_array_heade
svn_stream_t *s;
apr_size_t len;
- /* ### Currently, their_abspath is used for the prop reject file.
- * ### Put their value into merged instead...
- * ### We need to rev the conflict description struct to fix this. */
- SVN_ERR(svn_stream_open_unique(&s, &desc->merged_file, NULL,
+ SVN_ERR(svn_stream_open_unique(&s, &desc->their_abspath, NULL,
svn_io_file_del_on_pool_cleanup,
result_pool, iterpool));
len = their_value->len;
@@ -2259,7 +2247,7 @@ read_prop_conflict_descs(apr_array_heade
SVN_ERR(svn_stream_close(s));
}
- APR_ARRAY_PUSH(conflicts, svn_wc_conflict_description2_t*) = desc;
+ APR_ARRAY_PUSH(conflicts, svn_wc_conflict_description3_t *) = desc;
}
svn_pool_destroy(iterpool);
@@ -2291,7 +2279,7 @@ svn_wc__read_conflicts(const apr_array_h
{
/* Some callers expect not NULL */
*conflicts = apr_array_make(result_pool, 0,
- sizeof(svn_wc_conflict_description2_t*));;
+ sizeof(svn_wc_conflict_description3_t *));;
return SVN_NO_ERROR;
}
@@ -2301,7 +2289,7 @@ svn_wc__read_conflicts(const apr_array_h
result_pool, scratch_pool));
cflcts = apr_array_make(result_pool, 4,
- sizeof(svn_wc_conflict_description2_t*));
+ sizeof(svn_wc_conflict_description3_t *));
if (locations && locations->nelts > 0)
left_version = APR_ARRAY_IDX(locations, 0, const svn_wc_conflict_version_t *);
@@ -2322,26 +2310,26 @@ svn_wc__read_conflicts(const apr_array_h
if (text_conflicted)
{
- svn_wc_conflict_description2_t *desc;
+ svn_wc_conflict_description3_t *desc;
SVN_ERR(read_text_conflict_desc(&desc,
db, local_abspath, conflict_skel,
FALSE /*is_binary*/, NULL /*mime_type*/,
operation, left_version, right_version,
result_pool, scratch_pool));
- APR_ARRAY_PUSH(cflcts, svn_wc_conflict_description2_t*) = desc;
+ APR_ARRAY_PUSH(cflcts, svn_wc_conflict_description3_t *) = desc;
}
if (tree_conflicted)
{
- svn_wc_conflict_description2_t *desc;
+ svn_wc_conflict_description3_t *desc;
SVN_ERR(read_tree_conflict_desc(&desc,
db, local_abspath, conflict_skel,
operation, left_version, right_version,
result_pool, scratch_pool));
- APR_ARRAY_PUSH(cflcts, const svn_wc_conflict_description2_t *) = desc;
+ APR_ARRAY_PUSH(cflcts, const svn_wc_conflict_description3_t *) = desc;
}
*conflicts = cflcts;
@@ -2929,12 +2917,12 @@ conflict_status_walker(void *baton,
for (i = 0; i < conflicts->nelts; i++)
{
- const svn_wc_conflict_description2_t *cd;
+ const svn_wc_conflict_description3_t *cd;
svn_boolean_t did_resolve;
svn_wc_conflict_choice_t my_choice = cswb->conflict_choice;
const char *merged_file = NULL;
- cd = APR_ARRAY_IDX(conflicts, i, const svn_wc_conflict_description2_t *);
+ cd = APR_ARRAY_IDX(conflicts, i, const svn_wc_conflict_description3_t *);
svn_pool_clear(iterpool);
@@ -2947,7 +2935,9 @@ conflict_status_walker(void *baton,
_("No conflict-callback and no "
"pre-defined conflict-choice provided"));
- SVN_ERR(cswb->conflict_func(&result, cd, cswb->conflict_baton,
+ SVN_ERR(cswb->conflict_func(&result,
+ svn_wc__cd3_to_cd2(cd, scratch_pool),
+ cswb->conflict_baton,
iterpool, iterpool));
my_choice = result->choice;
Modified: subversion/branches/verify-keep-going/subversion/libsvn_wc/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_wc/deprecated.c?rev=1501136&r1=1501135&r2=1501136&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_wc/deprecated.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_wc/deprecated.c Tue Jul 9 08:48:43 2013
@@ -2678,10 +2678,12 @@ svn_wc__status2_from_3(svn_wc_status2_t
if (old_status->conflicted)
{
- const svn_wc_conflict_description2_t *tree_conflict;
+ const svn_wc_conflict_description3_t *tree_conflict;
+ const svn_wc_conflict_description2_t *tree_conflict2;
SVN_ERR(svn_wc__get_tree_conflict(&tree_conflict, wc_ctx, local_abspath,
scratch_pool, scratch_pool));
- (*status)->tree_conflict = svn_wc__cd2_to_cd(tree_conflict, result_pool);
+ tree_conflict2 = svn_wc__cd3_to_cd2(tree_conflict, scratch_pool);
+ (*status)->tree_conflict = svn_wc__cd2_to_cd(tree_conflict2, result_pool);
}
(*status)->switched = old_status->switched;
Modified: subversion/branches/verify-keep-going/subversion/libsvn_wc/entries.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_wc/entries.c?rev=1501136&r1=1501135&r2=1501136&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_wc/entries.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_wc/entries.c Tue Jul 9 08:48:43 2013
@@ -464,9 +464,9 @@ read_one_entry(const svn_wc_entry_t **ne
for (j = 0; j < child_conflicts->nelts; j++)
{
- const svn_wc_conflict_description2_t *conflict =
+ const svn_wc_conflict_description3_t *conflict =
APR_ARRAY_IDX(child_conflicts, j,
- svn_wc_conflict_description2_t *);
+ svn_wc_conflict_description3_t *);
if (conflict->kind == svn_wc_conflict_kind_tree)
{
@@ -1892,15 +1892,15 @@ write_entry(struct write_baton **entry_n
scratch_pool);
tree_conflicts = apr_hash_make(result_pool);
skel = skel->children;
- while(skel)
+ while (skel)
{
- svn_wc_conflict_description2_t *conflict;
+ svn_wc_conflict_description3_t *conflict;
svn_skel_t *new_skel;
const char *key;
/* *CONFLICT is allocated so it is safe to use a non-const pointer */
SVN_ERR(svn_wc__deserialize_conflict(
- (const svn_wc_conflict_description2_t**)&conflict,
+ (const svn_wc_conflict_description3_t**)&conflict,
skel,
svn_dirent_join(root_abspath,
local_relpath,
Modified: subversion/branches/verify-keep-going/subversion/libsvn_wc/info.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_wc/info.c?rev=1501136&r1=1501135&r2=1501136&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_wc/info.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_wc/info.c Tue Jul 9 08:48:43 2013
@@ -310,10 +310,16 @@ build_info_for_node(svn_wc__info2_t **in
local_abspath, result_pool, scratch_pool));
if (conflicted)
- SVN_ERR(svn_wc__read_conflicts(&wc_info->conflicts, db,
- local_abspath,
- TRUE /* ### create tempfiles */,
- result_pool, scratch_pool));
+ {
+ const apr_array_header_t *conflicts;
+
+ SVN_ERR(svn_wc__read_conflicts(&conflicts, db,
+ local_abspath,
+ TRUE /* ### create tempfiles */,
+ result_pool, scratch_pool));
+ wc_info->conflicts = svn_wc__cd3_array_to_cd2_array(conflicts,
+ result_pool);
+ }
else
wc_info->conflicts = NULL;
@@ -373,7 +379,7 @@ struct found_entry_baton
svn_boolean_t actual_only;
svn_boolean_t first;
/* The set of tree conflicts that have been found but not (yet) visited by
- * the tree walker. Map of abspath -> svn_wc_conflict_description2_t. */
+ * the tree walker. Map of abspath -> empty string. */
apr_hash_t *tree_conflicts;
apr_pool_t *pool;
};
@@ -534,8 +540,9 @@ svn_wc__get_info(svn_wc_context_t *wc_ct
hi = apr_hash_next(hi))
{
const char *this_abspath = svn__apr_hash_index_key(hi);
- const svn_wc_conflict_description2_t *tree_conflict;
+ const svn_wc_conflict_description3_t *tree_conflict;
svn_wc__info2_t *info;
+ const apr_array_header_t *conflicts;
svn_pool_clear(iterpool);
@@ -557,21 +564,22 @@ svn_wc__get_info(svn_wc_context_t *wc_ct
info->repos_root_URL = repos_root_url;
info->repos_UUID = repos_uuid;
- SVN_ERR(svn_wc__read_conflicts(&info->wc_info->conflicts,
+ SVN_ERR(svn_wc__read_conflicts(&conflicts,
wc_ctx->db, this_abspath,
TRUE /* ### create tempfiles */,
iterpool, iterpool));
-
- if (! info->wc_info->conflicts || ! info->wc_info->conflicts->nelts)
+ if (! conflicts || ! conflicts->nelts)
continue;
- tree_conflict = APR_ARRAY_IDX(info->wc_info->conflicts, 0,
- svn_wc_conflict_description2_t *);
+ tree_conflict = APR_ARRAY_IDX(conflicts, 0,
+ const svn_wc_conflict_description3_t *);
if (!depth_includes(local_abspath, depth, tree_conflict->local_abspath,
tree_conflict->node_kind, iterpool))
continue;
+ info->wc_info->conflicts = svn_wc__cd3_array_to_cd2_array(conflicts,
+ iterpool);
SVN_ERR(receiver(receiver_baton, this_abspath, info, iterpool));
}
svn_pool_destroy(iterpool);
Modified: subversion/branches/verify-keep-going/subversion/libsvn_wc/tree_conflicts.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_wc/tree_conflicts.c?rev=1501136&r1=1501135&r2=1501136&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_wc/tree_conflicts.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_wc/tree_conflicts.c Tue Jul 9 08:48:43 2013
@@ -196,7 +196,7 @@ read_node_version_info(const svn_wc_conf
svn_error_t *
-svn_wc__deserialize_conflict(const svn_wc_conflict_description2_t **conflict,
+svn_wc__deserialize_conflict(const svn_wc_conflict_description3_t **conflict,
const svn_skel_t *skel,
const char *dir_path,
apr_pool_t *result_pool,
@@ -211,7 +211,7 @@ svn_wc__deserialize_conflict(const svn_w
const svn_wc_conflict_version_t *src_left_version;
const svn_wc_conflict_version_t *src_right_version;
int n;
- svn_wc_conflict_description2_t *new_conflict;
+ svn_wc_conflict_description3_t *new_conflict;
if (!is_valid_conflict_skel(skel))
return svn_error_createf(SVN_ERR_WC_CORRUPT, NULL,
@@ -266,7 +266,7 @@ svn_wc__deserialize_conflict(const svn_w
SVN_ERR(read_node_version_info(&src_right_version, skel->next,
result_pool, scratch_pool));
- new_conflict = svn_wc_conflict_description_create_tree2(victim_abspath,
+ new_conflict = svn_wc_conflict_description_create_tree3(victim_abspath,
node_kind, operation, src_left_version, src_right_version,
result_pool);
new_conflict->action = action;
@@ -329,7 +329,7 @@ prepend_version_info_skel(svn_skel_t *pa
svn_error_t *
svn_wc__serialize_conflict(svn_skel_t **skel,
- const svn_wc_conflict_description2_t *conflict,
+ const svn_wc_conflict_description3_t *conflict,
apr_pool_t *result_pool,
apr_pool_t *scratch_pool)
{
@@ -401,7 +401,7 @@ svn_wc__del_tree_conflict(svn_wc_context
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)
{
svn_boolean_t existing_conflict;
@@ -443,7 +443,7 @@ svn_wc__add_tree_conflict(svn_wc_context
NULL,
scratch_pool, scratch_pool));
- switch(conflict->operation)
+ switch (conflict->operation)
{
case svn_wc_operation_update:
default:
@@ -473,7 +473,7 @@ svn_wc__add_tree_conflict(svn_wc_context
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 *local_abspath,
apr_pool_t *result_pool,
@@ -495,14 +495,13 @@ svn_wc__get_tree_conflict(const svn_wc_c
for (i = 0; i < conflicts->nelts; i++)
{
- const svn_wc_conflict_description2_t *desc;
+ const svn_wc_conflict_description3_t *desc;
- desc = APR_ARRAY_IDX(conflicts, i, svn_wc_conflict_description2_t *);
+ desc = APR_ARRAY_IDX(conflicts, i, svn_wc_conflict_description3_t *);
if (desc->kind == svn_wc_conflict_kind_tree)
{
- *tree_conflict = svn_wc__conflict_description2_dup(desc,
- result_pool);
+ *tree_conflict = svn_wc__conflict_description3_dup(desc, result_pool);
return SVN_NO_ERROR;
}
}
Modified: subversion/branches/verify-keep-going/subversion/libsvn_wc/tree_conflicts.h
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_wc/tree_conflicts.h?rev=1501136&r1=1501135&r2=1501136&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_wc/tree_conflicts.h (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_wc/tree_conflicts.h Tue Jul 9 08:48:43 2013
@@ -62,18 +62,18 @@ extern "C" {
svn_error_t *
svn_wc__serialize_conflict(svn_skel_t **skel,
- const svn_wc_conflict_description2_t *conflict,
+ const svn_wc_conflict_description3_t *conflict,
apr_pool_t *result_pool,
apr_pool_t *scratch_pool);
-/* Parse a newly allocated svn_wc_conflict_description2_t object from the
+/* Parse a newly allocated svn_wc_conflict_description3_t object from the
* provided SKEL. Return the result in *CONFLICT, allocated in RESULT_POOL.
* DIR_PATH is the path to the WC directory whose conflicts are being read.
* Use SCRATCH_POOL for temporary allocations.
*/
svn_error_t *
-svn_wc__deserialize_conflict(const svn_wc_conflict_description2_t **conflict,
+svn_wc__deserialize_conflict(const svn_wc_conflict_description3_t **conflict,
const svn_skel_t *skel,
const char *dir_path,
apr_pool_t *result_pool,
Modified: subversion/branches/verify-keep-going/subversion/libsvn_wc/update_editor.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_wc/update_editor.c?rev=1501136&r1=1501135&r2=1501136&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_wc/update_editor.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_wc/update_editor.c Tue Jul 9 08:48:43 2013
@@ -924,7 +924,6 @@ mark_directory_edited(struct dir_baton *
do_notification(db->edit_baton, db->local_abspath, svn_node_dir,
svn_wc_notify_tree_conflict, scratch_pool);
db->already_notified = TRUE;
-
}
return SVN_NO_ERROR;
@@ -2928,7 +2927,7 @@ close_directory(void *dir_baton,
eb->conflict_func,
eb->conflict_baton,
eb->cancel_func,
- eb->conflict_baton,
+ eb->cancel_baton,
scratch_pool));
/* Notify of any prop changes on this directory -- but do nothing if
Modified: subversion/branches/verify-keep-going/subversion/libsvn_wc/upgrade.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_wc/upgrade.c?rev=1501136&r1=1501135&r2=1501136&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_wc/upgrade.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_wc/upgrade.c Tue Jul 9 08:48:43 2013
@@ -654,8 +654,8 @@ ensure_repos_info(svn_wc_entry_t *entry,
/*
* Read tree conflict descriptions from @a conflict_data. Set @a *conflicts
- * to a hash of pointers to svn_wc_conflict_description2_t objects indexed by
- * svn_wc_conflict_description2_t.local_abspath, all newly allocated in @a
+ * to a hash of pointers to svn_wc_conflict_description3_t objects indexed by
+ * svn_wc_conflict_description3_t.local_abspath, all newly allocated in @a
* pool. @a dir_path is the path to the working copy directory whose conflicts
* are being read. The conflicts read are the tree conflicts on the immediate
* child nodes of @a dir_path. Do all allocations in @a pool.
@@ -692,7 +692,7 @@ read_tree_conflicts(apr_hash_t **conflic
iterpool = svn_pool_create(pool);
for (skel = skel->children; skel != NULL; skel = skel->next)
{
- const svn_wc_conflict_description2_t *conflict;
+ const svn_wc_conflict_description3_t *conflict;
svn_pool_clear(iterpool);
SVN_ERR(svn_wc__deserialize_conflict(&conflict, skel, dir_path,
@@ -727,7 +727,7 @@ migrate_single_tree_conflict_data(svn_sq
hi;
hi = apr_hash_next(hi))
{
- const svn_wc_conflict_description2_t *conflict =
+ const svn_wc_conflict_description3_t *conflict =
svn__apr_hash_index_val(hi);
const char *conflict_relpath;
const char *conflict_data;
@@ -1431,7 +1431,7 @@ svn_wc__upgrade_conflict_skel_from_raw(s
if (tree_conflict_data)
{
svn_skel_t *tc_skel;
- const svn_wc_conflict_description2_t *tc;
+ const svn_wc_conflict_description3_t *tc;
const char *local_abspath;
if (!conflict_data)
Modified: subversion/branches/verify-keep-going/subversion/libsvn_wc/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_wc/util.c?rev=1501136&r1=1501135&r2=1501136&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_wc/util.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_wc/util.c Tue Jul 9 08:48:43 2013
@@ -339,6 +339,90 @@ svn_wc_conflict_version_dup(const svn_wc
return new_version;
}
+apr_array_header_t *
+svn_wc__cd3_array_to_cd2_array(const apr_array_header_t *conflicts,
+ apr_pool_t *result_pool)
+{
+ apr_array_header_t *new_conflicts;
+ int i;
+
+ new_conflicts = apr_array_make(result_pool, conflicts->nelts,
+ sizeof (svn_wc_conflict_description2_t *));
+
+ for (i = 0; i < conflicts->nelts; i++)
+ {
+ svn_wc_conflict_description3_t *cd;
+ svn_wc_conflict_description2_t *cd2;
+
+ cd = APR_ARRAY_IDX(conflicts, i, svn_wc_conflict_description3_t *);
+ cd2 = svn_wc__cd3_to_cd2(cd, result_pool);
+ APR_ARRAY_PUSH(new_conflicts, svn_wc_conflict_description2_t *) = cd2;
+ }
+
+ return new_conflicts;
+}
+
+svn_wc_conflict_description2_t *
+svn_wc__cd3_to_cd2(const svn_wc_conflict_description3_t *conflict,
+ apr_pool_t *result_pool)
+{
+ svn_wc_conflict_description2_t *new_conflict;
+
+ if (conflict == NULL)
+ return NULL;
+
+ new_conflict = apr_pcalloc(result_pool, sizeof(*new_conflict));
+
+ if (conflict->local_abspath)
+ new_conflict->local_abspath = apr_pstrdup(result_pool,
+ conflict->local_abspath);
+ new_conflict->node_kind = conflict->node_kind;
+ new_conflict->kind = conflict->kind;
+ if (conflict->property_name)
+ new_conflict->property_name = apr_pstrdup(result_pool,
+ conflict->property_name);
+ new_conflict->is_binary = conflict->is_binary;
+ if (conflict->mime_type)
+ new_conflict->mime_type = apr_pstrdup(result_pool, conflict->mime_type);
+ new_conflict->action = conflict->action;
+ new_conflict->reason = conflict->reason;
+ if (conflict->base_abspath)
+ new_conflict->base_abspath = apr_pstrdup(result_pool,
+ conflict->base_abspath);
+
+ if (conflict->kind == svn_wc_conflict_kind_property)
+ {
+ /* For property conflicts, cd2 stored prop_reject_abspath in
+ * their_abspath, and stored theirs_abspath in merged_file. */
+ if (conflict->prop_reject_abspath)
+ new_conflict->their_abspath = apr_pstrdup(result_pool,
+ conflict->prop_reject_abspath);
+ if (conflict->their_abspath)
+ new_conflict->merged_file = apr_pstrdup(result_pool,
+ conflict->their_abspath);
+ }
+ else
+ {
+ if (conflict->their_abspath)
+ new_conflict->their_abspath = apr_pstrdup(result_pool,
+ conflict->their_abspath);
+
+ if (conflict->merged_file)
+ new_conflict->merged_file = apr_pstrdup(result_pool,
+ conflict->merged_file);
+ }
+ if (conflict->my_abspath)
+ new_conflict->my_abspath = apr_pstrdup(result_pool, conflict->my_abspath);
+ new_conflict->operation = conflict->operation;
+ if (conflict->src_left_version)
+ new_conflict->src_left_version =
+ svn_wc_conflict_version_dup(conflict->src_left_version, result_pool);
+ if (conflict->src_right_version)
+ new_conflict->src_right_version =
+ svn_wc_conflict_version_dup(conflict->src_right_version, result_pool);
+
+ return new_conflict;
+}
svn_wc_conflict_description_t *
svn_wc__cd2_to_cd(const svn_wc_conflict_description2_t *conflict,
Modified: subversion/branches/verify-keep-going/subversion/libsvn_wc/wc.h
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_wc/wc.h?rev=1501136&r1=1501135&r2=1501136&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_wc/wc.h (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_wc/wc.h Tue Jul 9 08:48:43 2013
@@ -681,7 +681,7 @@ svn_wc__write_check(svn_wc__db_t *db,
const char *local_abspath,
apr_pool_t *scratch_pool);
-/* Read into CONFLICTS svn_wc_conflict_description2_t* structs
+/* Read into CONFLICTS svn_wc_conflict_description3_t* structs
* for all conflicts that have LOCAL_ABSPATH as victim.
*
* Victim must be versioned or be part of a tree conflict.
Modified: subversion/branches/verify-keep-going/subversion/libsvn_wc/wc_db_update_move.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_wc/wc_db_update_move.c?rev=1501136&r1=1501135&r2=1501136&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_wc/wc_db_update_move.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_wc/wc_db_update_move.c Tue Jul 9 08:48:43 2013
@@ -1988,8 +1988,12 @@ svn_wc__db_update_moved_away_conflict_vi
/* Send all queued up notifications. */
SVN_ERR(svn_wc__db_update_move_list_notify(wcroot,
- old_version->peg_rev,
- new_version->peg_rev,
+ (old_version
+ ? old_version->peg_rev
+ : SVN_INVALID_REVNUM),
+ (new_version
+ ? new_version->peg_rev
+ : SVN_INVALID_REVNUM),
notify_func, notify_baton,
scratch_pool));
if (notify_func)
@@ -2395,7 +2399,9 @@ svn_wc__db_resolve_delete_raise_moved_aw
wcroot);
SVN_ERR(svn_wc__db_update_move_list_notify(wcroot,
- old_version->peg_rev,
+ (old_version
+ ? old_version->peg_rev
+ : SVN_INVALID_REVNUM),
(new_version
? new_version->peg_rev
: SVN_INVALID_REVNUM),
Modified: subversion/branches/verify-keep-going/subversion/libsvn_wc/wc_db_wcroot.c
URL: http://svn.apache.org/viewvc/subversion/branches/verify-keep-going/subversion/libsvn_wc/wc_db_wcroot.c?rev=1501136&r1=1501135&r2=1501136&view=diff
==============================================================================
--- subversion/branches/verify-keep-going/subversion/libsvn_wc/wc_db_wcroot.c (original)
+++ subversion/branches/verify-keep-going/subversion/libsvn_wc/wc_db_wcroot.c Tue Jul 9 08:48:43 2013
@@ -434,6 +434,8 @@ svn_wc__db_wcroot_parse_local_abspath(sv
svn_boolean_t always_check = FALSE;
int wc_format = 0;
const char *adm_relpath;
+ /* Non-NULL if WCROOT is found through a symlink: */
+ const char *symlink_wcroot_abspath = NULL;
/* ### we need more logic for finding the database (if it is located
### outside of the wcroot) and then managing all of that within DB.
@@ -611,6 +613,7 @@ svn_wc__db_wcroot_parse_local_abspath(sv
if (found_wcroot)
break;
+ symlink_wcroot_abspath = local_abspath;
SVN_ERR(read_link_target(&local_abspath, local_abspath,
scratch_pool));
try_symlink_as_dir:
@@ -632,6 +635,7 @@ try_symlink_as_dir:
local_abspath = svn_dirent_dirname(local_abspath, scratch_pool);
moved_upwards = TRUE;
+ symlink_wcroot_abspath = NULL;
/* Is the parent directory recorded in our hash? */
found_wcroot = svn_hash_gets(db->dir_data, local_abspath);
@@ -669,7 +673,10 @@ try_symlink_as_dir:
(ie. where we found it). */
err = svn_wc__db_pdh_create_wcroot(wcroot,
- apr_pstrdup(db->state_pool, local_abspath),
+ apr_pstrdup(db->state_pool,
+ symlink_wcroot_abspath
+ ? symlink_wcroot_abspath
+ : local_abspath),
sdb, wc_id, FORMAT_FROM_SDB,
db->verify_format, db->enforce_empty_wq,
db->state_pool, scratch_pool);
@@ -737,7 +744,10 @@ try_symlink_as_dir:
}
SVN_ERR(svn_wc__db_pdh_create_wcroot(wcroot,
- apr_pstrdup(db->state_pool, local_abspath),
+ apr_pstrdup(db->state_pool,
+ symlink_wcroot_abspath
+ ? symlink_wcroot_abspath
+ : local_abspath),
NULL, UNKNOWN_WC_ID, wc_format,
db->verify_format, db->enforce_empty_wq,
db->state_pool, scratch_pool));
@@ -747,6 +757,13 @@ try_symlink_as_dir:
{
const char *dir_relpath;
+ if (symlink_wcroot_abspath)
+ {
+ /* The WCROOT was found through a symlink pointing at the root of
+ * the WC. Cache the WCROOT under the symlink's path. */
+ local_dir_abspath = symlink_wcroot_abspath;
+ }
+
/* The subdirectory's relpath is easily computed relative to the
wcroot that we just found. */
dir_relpath = compute_relpath(*wcroot, local_dir_abspath, NULL);
@@ -809,6 +826,7 @@ try_symlink_as_dir:
scratch_pool));
if (resolved_kind == svn_node_dir)
{
+ symlink_wcroot_abspath = original_abspath;
SVN_ERR(read_link_target(&local_abspath, original_abspath,
scratch_pool));
/* This handle was opened in this function but is not going