87
91
return SVN_NO_ERROR;
94
/* Utility for log_receiver opening a new XML element in LRB's brigade
95
for LOG_ITEM and return the element's name in *ELEMENT. Use POOL for
96
temporary allocations.
98
Call this function for items that may have a copy-from */
100
start_path_with_copy_from(const char **element,
101
struct log_receiver_baton *lrb,
102
svn_log_changed_path2_t *log_item,
105
switch (log_item->action)
107
case 'A': *element = "S:added-path";
109
case 'R': *element = "S:replaced-path";
111
default: /* Caller, you did wrong! */
112
SVN_ERR_MALFUNCTION();
115
if (log_item->copyfrom_path
116
&& SVN_IS_VALID_REVNUM(log_item->copyfrom_rev))
117
SVN_ERR(dav_svn__brigade_printf
118
(lrb->bb, lrb->output,
119
"<%s copyfrom-path=\"%s\" copyfrom-rev=\"%ld\"",
121
apr_xml_quote_string(pool,
122
log_item->copyfrom_path,
123
1), /* escape quotes */
124
log_item->copyfrom_rev));
126
SVN_ERR(dav_svn__brigade_printf(lrb->bb, lrb->output, "<%s", *element));
91
132
/* This implements `svn_log_entry_receiver_t'.
92
133
BATON is a `struct log_receiver_baton *'. */
203
244
switch (log_item->action)
206
if (log_item->copyfrom_path
207
&& SVN_IS_VALID_REVNUM(log_item->copyfrom_rev))
208
SVN_ERR(dav_svn__brigade_printf
209
(lrb->bb, lrb->output,
210
"<S:added-path copyfrom-path=\"%s\""
211
" copyfrom-rev=\"%ld\"",
212
apr_xml_quote_string(iterpool,
213
log_item->copyfrom_path,
214
1), /* escape quotes */
215
log_item->copyfrom_rev));
217
SVN_ERR(dav_svn__brigade_puts(lrb->bb, lrb->output,
220
close_element = "S:added-path";
224
if (log_item->copyfrom_path
225
&& SVN_IS_VALID_REVNUM(log_item->copyfrom_rev))
226
SVN_ERR(dav_svn__brigade_printf
227
(lrb->bb, lrb->output,
228
"<S:replaced-path copyfrom-path=\"%s\""
229
" copyfrom-rev=\"%ld\"",
230
apr_xml_quote_string(iterpool,
231
log_item->copyfrom_path,
232
1), /* escape quotes */
233
log_item->copyfrom_rev));
235
SVN_ERR(dav_svn__brigade_puts(lrb->bb, lrb->output,
236
"<S:replaced-path"));
238
close_element = "S:replaced-path";
248
SVN_ERR(start_path_with_copy_from(&close_element, lrb,
249
log_item, iterpool));
275
286
SVN_ERR(dav_svn__brigade_puts(lrb->bb, lrb->output,
276
287
"</S:log-item>" DEBUG_CR));
289
/* In general APR will flush the brigade every 8000 bytes through the filter
290
stack, but log items may not be generated that fast, especially in
291
combination with authz and busy servers. We now explictly flush after
292
log-item 4, 16, 64 and 256 to produce a few results fast.
294
This introduces 4 full flushes of our brigade and the installed output
295
filters at growing intervals and then falls back to the standard
296
buffering of 8000 bytes + whatever buffers are added in output filters. */
298
if (lrb->result_count == lrb->next_forced_flush)
300
apr_status_t apr_err;
302
/* This flush is similar to that in dav_svn__final_flush_or_error().
304
Compared to using ap_filter_flush(), which we use in other place
305
this adds a flush frame before flushing the brigade, to make output
306
filters perform a flush as well */
308
/* No brigade empty check. We want output filters to flush anyway */
309
apr_err = ap_fflush(lrb->output, lrb->bb);
311
return svn_error_create(apr_err, NULL, NULL);
313
/* Check for an aborted connection, just like our brigade write
314
helper functions, since the brigade functions don't appear to
315
be return useful errors when the connection is dropped. */
316
if (lrb->output->c->aborted)
317
return svn_error_create(SVN_ERR_APMOD_CONNECTION_ABORTED,
320
if (lrb->result_count < 256)
321
lrb->next_forced_flush = lrb->next_forced_flush * 4;
278
324
return SVN_NO_ERROR;
301
347
svn_boolean_t discover_changed_paths = FALSE; /* off by default */
302
348
svn_boolean_t strict_node_history = FALSE; /* off by default */
303
349
svn_boolean_t include_merged_revisions = FALSE; /* off by default */
304
351
apr_array_header_t *revprops = apr_array_make(resource->pool, 3,
305
352
sizeof(const char *));
306
353
apr_array_header_t *paths
313
360
ns = dav_svn__find_ns(doc->namespaces, SVN_XML_NAMESPACE);
316
return dav_svn__new_error_tag(resource->pool, HTTP_BAD_REQUEST, 0,
363
return dav_svn__new_error_svn(resource->pool, HTTP_BAD_REQUEST, 0,
317
364
"The request does not contain the 'svn:' "
318
365
"namespace, so it is not going to have "
319
"certain required elements.",
320
SVN_DAV_ERROR_NAMESPACE,
366
"certain required elements");
324
369
/* If this is still FALSE after the loop, we haven't seen either of
421
466
lrb.stack_depth = 0;
422
467
/* lrb.requested_custom_revprops set above */
469
lrb.result_count = 0;
470
lrb.next_forced_flush = 4;
424
472
/* Our svn_log_entry_receiver_t sends the <S:log-report> header in
425
473
a lazy fashion. Before writing the first log message, it assures
426
474
that the header has already been sent (checking the needs_header
446
derr = dav_svn__convert_err(serr, HTTP_BAD_REQUEST, serr->message,
494
derr = dav_svn__convert_err(serr, HTTP_BAD_REQUEST, NULL,