Modified: subversion/branches/remove-log-addressing/subversion/libsvn_client/merge.c URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_client/merge.c?rev=1620589&r1=1620588&r2=1620589&view=diff ============================================================================== --- subversion/branches/remove-log-addressing/subversion/libsvn_client/merge.c (original) +++ subversion/branches/remove-log-addressing/subversion/libsvn_client/merge.c Tue Aug 26 13:00:03 2014 @@ -569,14 +569,16 @@ perform_obstruction_check(svn_wc_notify_ } /* Create *LEFT and *RIGHT conflict versions for conflict victim - * at VICTIM_ABSPATH, with kind NODE_KIND, using information obtained - * from MERGE_SOURCE and TARGET. + * at VICTIM_ABSPATH, with merge-left node kind MERGE_LEFT_NODE_KIND + * and merge-right node kind MERGE_RIGHT_NODE_KIND, using information + * obtained from MERGE_SOURCE and TARGET. * Allocate returned conflict versions in RESULT_POOL. */ static svn_error_t * make_conflict_versions(const svn_wc_conflict_version_t **left, const svn_wc_conflict_version_t **right, const char *victim_abspath, - svn_node_kind_t node_kind, + svn_node_kind_t merge_left_node_kind, + svn_node_kind_t merge_right_node_kind, const merge_source_t *merge_source, const merge_target_t *target, apr_pool_t *result_pool, @@ -596,13 +598,15 @@ make_conflict_versions(const svn_wc_conf merge_source->loc1->repos_root_url, merge_source->loc1->repos_uuid, svn_relpath_join(left_relpath, child, scratch_pool), - merge_source->loc1->rev, node_kind, result_pool); + merge_source->loc1->rev, + merge_left_node_kind, result_pool); *right = svn_wc_conflict_version_create2( merge_source->loc2->repos_root_url, merge_source->loc2->repos_uuid, svn_relpath_join(right_relpath, child, scratch_pool), - merge_source->loc2->rev, node_kind, result_pool); + merge_source->loc2->rev, + merge_right_node_kind, result_pool); return SVN_NO_ERROR; } @@ -1181,6 +1185,9 @@ struct merge_dir_baton_t */ svn_wc_conflict_reason_t tree_conflict_reason; svn_wc_conflict_action_t tree_conflict_action; + svn_node_kind_t tree_conflict_local_node_kind; + svn_node_kind_t tree_conflict_merge_left_node_kind; + svn_node_kind_t tree_conflict_merge_right_node_kind; /* When TREE_CONFLICT_REASON is CONFLICT_REASON_SKIP, the skip state to add to the notification */ @@ -1201,7 +1208,7 @@ struct merge_dir_baton_t apr_hash_t *pending_deletes; /* NULL, or an hashtable mapping const char * LOCAL_ABSPATHs to - a const svn_wc_conflict_description3_t * instance, describing the just + a const svn_wc_conflict_description2_t * instance, describing the just installed conflict */ apr_hash_t *new_tree_conflicts; @@ -1232,6 +1239,9 @@ struct merge_file_baton_t merge_tree_baton_t for an explanation. */ svn_wc_conflict_reason_t tree_conflict_reason; svn_wc_conflict_action_t tree_conflict_action; + svn_node_kind_t tree_conflict_local_node_kind; + svn_node_kind_t tree_conflict_merge_left_node_kind; + svn_node_kind_t tree_conflict_merge_right_node_kind; /* When TREE_CONFLICT_REASON is CONFLICT_REASON_SKIP, the skip state to add to the notification */ @@ -1292,8 +1302,6 @@ record_skip(merge_cmd_baton_t *merge_b, * The tree conflict, with its victim specified by VICTIM_PATH, is * assumed to have happened during a merge using merge baton MERGE_B. * - * NODE_KIND must be the node kind of "old" and "theirs" and "mine"; - * this function cannot cope with node kind clashes. * ACTION and REASON correspond to the fields * of the same names in svn_wc_tree_conflict_description_t. */ @@ -1301,10 +1309,12 @@ static svn_error_t * record_tree_conflict(merge_cmd_baton_t *merge_b, const char *local_abspath, struct merge_dir_baton_t *parent_baton, - svn_node_kind_t node_kind, + svn_node_kind_t local_node_kind, + svn_node_kind_t merge_left_node_kind, + svn_node_kind_t merge_right_node_kind, svn_wc_conflict_action_t action, svn_wc_conflict_reason_t reason, - const svn_wc_conflict_description3_t *existing_conflict, + const svn_wc_conflict_description2_t *existing_conflict, svn_boolean_t notify_tc, apr_pool_t *scratch_pool) { @@ -1324,7 +1334,7 @@ record_tree_conflict(merge_cmd_baton_t * if (!merge_b->dry_run) { - svn_wc_conflict_description3_t *conflict; + svn_wc_conflict_description2_t *conflict; const svn_wc_conflict_version_t *left; const svn_wc_conflict_version_t *right; apr_pool_t *result_pool = parent_baton ? parent_baton->pool @@ -1355,7 +1365,9 @@ record_tree_conflict(merge_cmd_baton_t * reason = svn_wc_conflict_reason_moved_here; } - SVN_ERR(make_conflict_versions(&left, &right, local_abspath, node_kind, + SVN_ERR(make_conflict_versions(&left, &right, local_abspath, + merge_left_node_kind, + merge_right_node_kind, &merge_b->merge_source, merge_b->target, result_pool, scratch_pool)); @@ -1363,8 +1375,9 @@ record_tree_conflict(merge_cmd_baton_t * if (existing_conflict != NULL && existing_conflict->src_left_version) left = existing_conflict->src_left_version; - conflict = svn_wc_conflict_description_create_tree3( - local_abspath, node_kind, svn_wc_operation_merge, + conflict = svn_wc_conflict_description_create_tree2( + local_abspath, local_node_kind, + svn_wc_operation_merge, left, right, result_pool); conflict->action = action; @@ -1400,7 +1413,7 @@ record_tree_conflict(merge_cmd_baton_t * notify = svn_wc_create_notify(local_abspath, svn_wc_notify_tree_conflict, scratch_pool); - notify->kind = node_kind; + notify->kind = local_node_kind; (*merge_b->ctx->notify_func2)(merge_b->ctx->notify_baton2, notify, scratch_pool); @@ -1621,7 +1634,10 @@ mark_dir_edited(merge_cmd_baton_t *merge /* open_directory() decided that a tree conflict should be raised */ SVN_ERR(record_tree_conflict(merge_b, local_abspath, db->parent_baton, - svn_node_dir, db->tree_conflict_action, + db->tree_conflict_local_node_kind, + db->tree_conflict_merge_left_node_kind, + db->tree_conflict_merge_right_node_kind, + db->tree_conflict_action, db->tree_conflict_reason, NULL, TRUE, scratch_pool)); @@ -1700,7 +1716,10 @@ mark_file_edited(merge_cmd_baton_t *merg /* open_file() decided that a tree conflict should be raised */ SVN_ERR(record_tree_conflict(merge_b, local_abspath, fb->parent_baton, - svn_node_file, fb->tree_conflict_action, + fb->tree_conflict_local_node_kind, + fb->tree_conflict_merge_left_node_kind, + fb->tree_conflict_merge_right_node_kind, + fb->tree_conflict_action, fb->tree_conflict_reason, NULL, TRUE, scratch_pool)); @@ -1740,6 +1759,16 @@ merge_file_opened(void **new_file_baton, fb->tree_conflict_action = svn_wc_conflict_action_edit; fb->skip_reason = svn_wc_notify_state_unknown; + if (left_source) + fb->tree_conflict_merge_left_node_kind = svn_node_file; + else + fb->tree_conflict_merge_left_node_kind = svn_node_none; + + if (right_source) + fb->tree_conflict_merge_right_node_kind = svn_node_file; + else + fb->tree_conflict_merge_right_node_kind = svn_node_none; + *new_file_baton = fb; if (pdb) @@ -1756,7 +1785,6 @@ merge_file_opened(void **new_file_baton, else if (left_source != NULL) { /* Node is expected to be a file, which will be changed or deleted. */ - svn_node_kind_t kind; svn_boolean_t is_deleted; svn_boolean_t excluded; svn_depth_t parent_depth; @@ -1768,7 +1796,8 @@ merge_file_opened(void **new_file_baton, svn_wc_notify_state_t obstr_state; SVN_ERR(perform_obstruction_check(&obstr_state, &is_deleted, &excluded, - &kind, &parent_depth, + &fb->tree_conflict_local_node_kind, + &parent_depth, merge_b, local_abspath, scratch_pool)); @@ -1781,10 +1810,10 @@ merge_file_opened(void **new_file_baton, } if (is_deleted) - kind = svn_node_none; + fb->tree_conflict_local_node_kind = svn_node_none; } - if (kind == svn_node_none) + if (fb->tree_conflict_local_node_kind == svn_node_none) { fb->shadowed = TRUE; @@ -1818,7 +1847,7 @@ merge_file_opened(void **new_file_baton, return SVN_NO_ERROR; /* ### /Similar */ } - else if (kind != svn_node_file) + else if (fb->tree_conflict_local_node_kind != svn_node_file) { fb->shadowed = TRUE; @@ -1853,7 +1882,7 @@ merge_file_opened(void **new_file_baton, } else { - const svn_wc_conflict_description3_t *old_tc = NULL; + const svn_wc_conflict_description2_t *old_tc = NULL; /* The node doesn't exist pre-merge: We have an addition */ fb->added = TRUE; @@ -1877,6 +1906,8 @@ merge_file_opened(void **new_file_baton, /* Update the tree conflict to store that this is a replace */ SVN_ERR(record_tree_conflict(merge_b, local_abspath, pdb, + old_tc->node_kind, + old_tc->src_left_version->node_kind, svn_node_file, fb->tree_conflict_action, fb->tree_conflict_reason, @@ -1903,12 +1934,11 @@ merge_file_opened(void **new_file_baton, && ((pdb && pdb->added) || fb->add_is_replace))) { svn_wc_notify_state_t obstr_state; - svn_node_kind_t kind; svn_boolean_t is_deleted; SVN_ERR(perform_obstruction_check(&obstr_state, &is_deleted, NULL, - &kind, NULL, - merge_b, local_abspath, + &fb->tree_conflict_local_node_kind, + NULL, merge_b, local_abspath, scratch_pool)); if (obstr_state != svn_wc_notify_state_inapplicable) @@ -1918,7 +1948,8 @@ merge_file_opened(void **new_file_baton, fb->tree_conflict_reason = CONFLICT_REASON_SKIP; fb->skip_reason = obstr_state; } - else if (kind != svn_node_none && !is_deleted) + else if (fb->tree_conflict_local_node_kind != svn_node_none + && !is_deleted) { /* Set a tree conflict */ fb->shadowed = TRUE; @@ -1997,7 +2028,8 @@ merge_file_changed(const char *relpath, scratch_pool, scratch_pool)); SVN_ERR(make_conflict_versions(&left, &right, local_abspath, - svn_node_file, &merge_b->merge_source, merge_b->target, + svn_node_file, svn_node_file, + &merge_b->merge_source, merge_b->target, scratch_pool, scratch_pool)); /* Do property merge now, if we are not going to perform a text merge */ @@ -2422,6 +2454,8 @@ merge_file_deleted(const char *relpath, */ SVN_ERR(record_tree_conflict(merge_b, local_abspath, fb->parent_baton, svn_node_file, + svn_node_file, + svn_node_none, svn_wc_conflict_action_delete, svn_wc_conflict_reason_edited, NULL, TRUE, @@ -2472,6 +2506,16 @@ merge_dir_opened(void **new_dir_baton, *new_dir_baton = db; + if (left_source) + db->tree_conflict_merge_left_node_kind = svn_node_dir; + else + db->tree_conflict_merge_left_node_kind = svn_node_none; + + if (right_source) + db->tree_conflict_merge_right_node_kind = svn_node_dir; + else + db->tree_conflict_merge_right_node_kind = svn_node_none; + if (pdb) { db->parent_baton = pdb; @@ -2488,7 +2532,6 @@ merge_dir_opened(void **new_dir_baton, else if (left_source != NULL) { /* Node is expected to be a directory. */ - svn_node_kind_t kind; svn_boolean_t is_deleted; svn_boolean_t excluded; svn_depth_t parent_depth; @@ -2500,9 +2543,9 @@ merge_dir_opened(void **new_dir_baton, { svn_wc_notify_state_t obstr_state; SVN_ERR(perform_obstruction_check(&obstr_state, &is_deleted, &excluded, - &kind, &parent_depth, - merge_b, local_abspath, - scratch_pool)); + &db->tree_conflict_local_node_kind, + &parent_depth, merge_b, + local_abspath, scratch_pool)); if (obstr_state != svn_wc_notify_state_inapplicable) { @@ -2537,10 +2580,10 @@ merge_dir_opened(void **new_dir_baton, } if (is_deleted) - kind = svn_node_none; + db->tree_conflict_local_node_kind = svn_node_none; } - if (kind == svn_node_none) + if (db->tree_conflict_local_node_kind == svn_node_none) { db->shadowed = TRUE; @@ -2576,7 +2619,7 @@ merge_dir_opened(void **new_dir_baton, return SVN_NO_ERROR; /* ### /avoid breaking tests */ } - else if (kind != svn_node_dir) + else if (db->tree_conflict_local_node_kind != svn_node_dir) { db->shadowed = TRUE; @@ -2629,7 +2672,7 @@ merge_dir_opened(void **new_dir_baton, } else { - const svn_wc_conflict_description3_t *old_tc = NULL; + const svn_wc_conflict_description2_t *old_tc = NULL; /* The node doesn't exist pre-merge: We have an addition */ db->added = TRUE; @@ -2667,6 +2710,8 @@ merge_dir_opened(void **new_dir_baton, /* Update the tree conflict to store that this is a replace */ SVN_ERR(record_tree_conflict(merge_b, local_abspath, pdb, + old_tc->node_kind, + old_tc->src_left_version->node_kind, svn_node_dir, db->tree_conflict_action, db->tree_conflict_reason, @@ -2681,12 +2726,11 @@ merge_dir_opened(void **new_dir_baton, && ((pdb && pdb->added) || db->add_is_replace))) { svn_wc_notify_state_t obstr_state; - svn_node_kind_t kind; svn_boolean_t is_deleted; SVN_ERR(perform_obstruction_check(&obstr_state, &is_deleted, NULL, - &kind, NULL, - merge_b, local_abspath, + &db->tree_conflict_local_node_kind, + NULL, merge_b, local_abspath, scratch_pool)); /* In this case of adding a directory, we have an exception to the @@ -2696,7 +2740,8 @@ merge_dir_opened(void **new_dir_baton, * versioned but unexpectedly missing from disk, or is unversioned * but obstructed by a node of the wrong kind. */ if (obstr_state == svn_wc_notify_state_obstructed - && (is_deleted || kind == svn_node_none)) + && (is_deleted || + db->tree_conflict_local_node_kind == svn_node_none)) { svn_node_kind_t disk_kind; @@ -2717,7 +2762,8 @@ merge_dir_opened(void **new_dir_baton, db->tree_conflict_reason = CONFLICT_REASON_SKIP; db->skip_reason = obstr_state; } - else if (kind != svn_node_none && !is_deleted) + else if (db->tree_conflict_local_node_kind != svn_node_none + && !is_deleted) { /* Set a tree conflict */ db->shadowed = TRUE; @@ -2796,6 +2842,8 @@ merge_dir_opened(void **new_dir_baton, { /* ### Should be atomic with svn_wc_add(4|_from_disk2)() */ SVN_ERR(record_tree_conflict(merge_b, local_abspath, pdb, + old_tc->node_kind, + svn_node_none, svn_node_dir, db->tree_conflict_action, db->tree_conflict_reason, @@ -2864,7 +2912,8 @@ merge_dir_changed(const char *relpath, svn_wc_notify_state_t prop_state; SVN_ERR(make_conflict_versions(&left, &right, local_abspath, - svn_node_dir, &merge_b->merge_source, + svn_node_dir, svn_node_dir, + &merge_b->merge_source, merge_b->target, scratch_pool, scratch_pool)); @@ -3212,6 +3261,8 @@ merge_dir_deleted(const char *relpath, */ SVN_ERR(record_tree_conflict(merge_b, local_abspath, db->parent_baton, svn_node_dir, + svn_node_dir, + svn_node_none, svn_wc_conflict_action_delete, svn_wc_conflict_reason_edited, NULL, TRUE,
Modified: subversion/branches/remove-log-addressing/subversion/libsvn_client/mtcc.c URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_client/mtcc.c?rev=1620589&r1=1620588&r2=1620589&view=diff ============================================================================== --- subversion/branches/remove-log-addressing/subversion/libsvn_client/mtcc.c (original) +++ subversion/branches/remove-log-addressing/subversion/libsvn_client/mtcc.c Tue Aug 26 13:00:03 2014 @@ -47,7 +47,7 @@ typedef enum mtcc_kind_t OP_OPEN_FILE, OP_ADD_DIR, OP_ADD_FILE, - OP_DELETE, + OP_DELETE } mtcc_kind_t; typedef struct mtcc_op_t Modified: subversion/branches/remove-log-addressing/subversion/libsvn_delta/svndiff.c URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_delta/svndiff.c?rev=1620589&r1=1620588&r2=1620589&view=diff ============================================================================== --- subversion/branches/remove-log-addressing/subversion/libsvn_delta/svndiff.c (original) +++ subversion/branches/remove-log-addressing/subversion/libsvn_delta/svndiff.c Tue Aug 26 13:00:03 2014 @@ -578,6 +578,10 @@ decode_window(svn_txdelta_window_t *wind return SVN_NO_ERROR; } +static const char SVNDIFF_V0[] = { 'S', 'V', 'N', 0 }; +static const char SVNDIFF_V1[] = { 'S', 'V', 'N', 1 }; +#define SVNDIFF_HEADER_SIZE (sizeof(SVNDIFF_V0)) + static svn_error_t * write_handler(void *baton, const char *buffer, @@ -590,14 +594,14 @@ write_handler(void *baton, apr_size_t buflen = *len; /* Chew up four bytes at the beginning for the header. */ - if (db->header_bytes < 4) + if (db->header_bytes < SVNDIFF_HEADER_SIZE) { - apr_size_t nheader = 4 - db->header_bytes; + apr_size_t nheader = SVNDIFF_HEADER_SIZE - db->header_bytes; if (nheader > buflen) nheader = buflen; - if (memcmp(buffer, "SVN\0" + db->header_bytes, nheader) == 0) + if (memcmp(buffer, SVNDIFF_V0 + db->header_bytes, nheader) == 0) db->version = 0; - else if (memcmp(buffer, "SVN\1" + db->header_bytes, nheader) == 0) + else if (memcmp(buffer, SVNDIFF_V1 + db->header_bytes, nheader) == 0) db->version = 1; else return svn_error_create(SVN_ERR_SVNDIFF_INVALID_HEADER, NULL, Modified: subversion/branches/remove-log-addressing/subversion/libsvn_delta/text_delta.c URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_delta/text_delta.c?rev=1620589&r1=1620588&r2=1620589&view=diff ============================================================================== --- subversion/branches/remove-log-addressing/subversion/libsvn_delta/text_delta.c (original) +++ subversion/branches/remove-log-addressing/subversion/libsvn_delta/text_delta.c Tue Aug 26 13:00:03 2014 @@ -623,68 +623,27 @@ size_buffer(char **buf, apr_size_t *buf_ return SVN_NO_ERROR; } -/* Copy LEN bytes from SOURCE to TARGET, optimizing for the case where LEN - * is often very small. Return a pointer to the first byte after the copied - * target range, unlike standard memcpy(), as a potential further - * optimization for the caller. - * - * memcpy() is hard to tune for a wide range of buffer lengths. Therefore, - * it is often tuned for high throughput on large buffers and relatively - * low latency for mid-sized buffers (tens of bytes). However, the overhead - * for very small buffers (<10 bytes) is still high. Even passing the - * parameters, for instance, may take as long as copying 3 bytes. - * - * Because short copy sequences seem to be a common case, at least in - * "format 2" FSFS repositories, we copy them directly. Larger buffer sizes - * aren't hurt measurably by the exta 'if' clause. */ -static APR_INLINE char * -fast_memcpy(char *target, const char *source, apr_size_t len) -{ - if (len > 7) - { - memcpy(target, source, len); - target += len; - } - else - { - /* memcpy is not exactly fast for small block sizes. - * Since they are common, let's run optimized code for them. */ - const char *end = source + len; - for (; source != end; source++) - *(target++) = *source; - } - - return target; -} - /* Copy LEN bytes from SOURCE to TARGET. Unlike memmove() or memcpy(), * create repeating patterns if the source and target ranges overlap. * Return a pointer to the first byte after the copied target range. */ static APR_INLINE char * patterning_copy(char *target, const char *source, apr_size_t len) { - const char *end = source + len; - - /* On many machines, we can do "chunky" copies. */ - -#if SVN_UNALIGNED_ACCESS_IS_OK - - if (source + sizeof(apr_uint32_t) <= target) - { - /* Source and target are at least 4 bytes apart, so we can copy in - * 4-byte chunks. */ - for (; source + sizeof(apr_uint32_t) <= end; - source += sizeof(apr_uint32_t), - target += sizeof(apr_uint32_t)) - *(apr_uint32_t *)(target) = *(apr_uint32_t *)(source); + /* If the source and target overlap, repeat the overlapping pattern + in the target buffer. Always copy from the source buffer because + presumably it will be in the L1 cache after the first iteration + and doing this should avoid pipeline stalls due to write/read + dependencies. */ + const apr_size_t overlap = target - source; + while (len > overlap) + { + target = memcpy(target, source, overlap); + len -= overlap; } -#endif - - /* fall through to byte-wise copy (either for the below-chunk-size tail - * or the whole copy) */ - for (; source != end; source++) - *(target++) = *source; + /* Copy any remaining source pattern. */ + if (len) + target = memcpy(target, source, len); return target; } @@ -711,7 +670,7 @@ svn_txdelta_apply_instructions(svn_txdel /* Copy from source area. */ assert(sbuf); assert(op->offset + op->length <= window->sview_len); - fast_memcpy(tbuf + tpos, sbuf + op->offset, buf_len); + memcpy(tbuf + tpos, sbuf + op->offset, buf_len); break; case svn_txdelta_target: @@ -728,9 +687,9 @@ svn_txdelta_apply_instructions(svn_txdel case svn_txdelta_new: /* Copy from window new area. */ assert(op->offset + op->length <= window->new_data->len); - fast_memcpy(tbuf + tpos, - window->new_data->data + op->offset, - buf_len); + memcpy(tbuf + tpos, + window->new_data->data + op->offset, + buf_len); break; default: @@ -747,20 +706,6 @@ svn_txdelta_apply_instructions(svn_txdel *tlen = tpos; } -/* This is a private interlibrary compatibility wrapper. */ -void -svn_txdelta__apply_instructions(svn_txdelta_window_t *window, - const char *sbuf, char *tbuf, - apr_size_t *tlen); -void -svn_txdelta__apply_instructions(svn_txdelta_window_t *window, - const char *sbuf, char *tbuf, - apr_size_t *tlen) -{ - svn_txdelta_apply_instructions(window, sbuf, tbuf, tlen); -} - - /* Apply WINDOW to the streams given by APPL. */ static svn_error_t * apply_window(svn_txdelta_window_t *window, void *baton) Modified: subversion/branches/remove-log-addressing/subversion/libsvn_diff/deprecated.c URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_diff/deprecated.c?rev=1620589&r1=1620588&r2=1620589&view=diff ============================================================================== --- subversion/branches/remove-log-addressing/subversion/libsvn_diff/deprecated.c (original) +++ subversion/branches/remove-log-addressing/subversion/libsvn_diff/deprecated.c Tue Aug 26 13:00:03 2014 @@ -271,6 +271,31 @@ svn_diff_file_output_merge(svn_stream_t pool); } +svn_error_t * +svn_diff_file_output_merge2(svn_stream_t *output_stream, + svn_diff_t *diff, + const char *original_path, + const char *modified_path, + const char *latest_path, + const char *conflict_original, + const char *conflict_modified, + const char *conflict_latest, + const char *conflict_separator, + svn_diff_conflict_display_style_t conflict_style, + apr_pool_t *pool) +{ + return svn_error_trace(svn_diff_file_output_merge3(output_stream, + diff, original_path, + modified_path, + latest_path, + conflict_original, + conflict_modified, + conflict_latest, + conflict_separator, + conflict_style, + NULL, NULL, /* cancel */ + pool)); +} /*** From diff.c ***/ svn_error_t * @@ -326,3 +351,114 @@ svn_diff_output(svn_diff_t *diff, NULL, NULL /* cancel */)); } +/*** From diff_memory.c ***/ +svn_error_t * +svn_diff_mem_string_output_merge(svn_stream_t *output_stream, + svn_diff_t *diff, + const svn_string_t *original, + const svn_string_t *modified, + const svn_string_t *latest, + const char *conflict_original, + const char *conflict_modified, + const char *conflict_latest, + const char *conflict_separator, + svn_boolean_t display_original_in_conflict, + svn_boolean_t display_resolved_conflicts, + apr_pool_t *pool) +{ + svn_diff_conflict_display_style_t style = + svn_diff_conflict_display_modified_latest; + + if (display_resolved_conflicts) + style = svn_diff_conflict_display_resolved_modified_latest; + + if (display_original_in_conflict) + style = svn_diff_conflict_display_modified_original_latest; + + return svn_diff_mem_string_output_merge2(output_stream, + diff, + original, + modified, + latest, + conflict_original, + conflict_modified, + conflict_latest, + conflict_separator, + style, + pool); +} + +svn_error_t * +svn_diff_mem_string_output_merge2(svn_stream_t *output_stream, + svn_diff_t *diff, + const svn_string_t *original, + const svn_string_t *modified, + const svn_string_t *latest, + const char *conflict_original, + const char *conflict_modified, + const char *conflict_latest, + const char *conflict_separator, + svn_diff_conflict_display_style_t style, + apr_pool_t *pool) +{ + return svn_error_trace(svn_diff_mem_string_output_merge3(output_stream, diff, + original, + modified, latest, + conflict_original, + conflict_modified, + conflict_latest, + conflict_separator, + style, + /* no cancelation */ + NULL, NULL, + pool)); +} + +svn_error_t * +svn_diff_mem_string_output_unified(svn_stream_t *output_stream, + svn_diff_t *diff, + const char *original_header, + const char *modified_header, + const char *header_encoding, + const svn_string_t *original, + const svn_string_t *modified, + apr_pool_t *pool) +{ + return svn_error_trace(svn_diff_mem_string_output_unified2(output_stream, + diff, + TRUE, + NULL, + original_header, + modified_header, + header_encoding, + original, + modified, + pool)); +} + +svn_error_t * +svn_diff_mem_string_output_unified2(svn_stream_t *output_stream, + svn_diff_t *diff, + svn_boolean_t with_diff_header, + const char *hunk_delimiter, + const char *original_header, + const char *modified_header, + const char *header_encoding, + const svn_string_t *original, + const svn_string_t *modified, + apr_pool_t *pool) +{ + return svn_error_trace(svn_diff_mem_string_output_unified3(output_stream, + diff, + with_diff_header, + hunk_delimiter, + original_header, + modified_header, + header_encoding, + original, + modified, + -1 /* context */, + /* cancel */ + NULL, NULL, + pool)); +} Modified: subversion/branches/remove-log-addressing/subversion/libsvn_diff/diff_file.c URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_diff/diff_file.c?rev=1620589&r1=1620588&r2=1620589&view=diff ============================================================================== --- subversion/branches/remove-log-addressing/subversion/libsvn_diff/diff_file.c (original) +++ subversion/branches/remove-log-addressing/subversion/libsvn_diff/diff_file.c Tue Aug 26 13:00:03 2014 @@ -1852,7 +1852,7 @@ svn_diff_file_output_unified4(svn_stream baton.hunk = svn_stringbuf_create_empty(pool); baton.show_c_function = show_c_function; baton.extra_context = svn_stringbuf_create_empty(pool); - baton.context_size = (context_size > 0) ? context_size + baton.context_size = (context_size >= 0) ? context_size : SVN_DIFF__UNIFIED_CONTEXT_SIZE; if (show_c_function) @@ -1968,10 +1968,14 @@ context_saver_stream_write(void *baton, apr_size_t *len) { context_saver_t *cs = baton; - cs->data[cs->next_slot] = data; - cs->len[cs->next_slot] = *len; - cs->next_slot = (cs->next_slot + 1) % cs->context_size; - cs->total_written++; + + if (cs->context_size > 0) + { + cs->data[cs->next_slot] = data; + cs->len[cs->next_slot] = *len; + cs->next_slot = (cs->next_slot + 1) % cs->context_size; + cs->total_written++; + } return SVN_NO_ERROR; } @@ -1998,6 +2002,10 @@ typedef struct svn_diff3__file_output_ba svn_diff_conflict_display_style_t conflict_style; int context_size; + /* cancel support */ + svn_cancel_func_t cancel_func; + void *cancel_baton; + /* The rest of the fields are for svn_diff_conflict_display_only_conflicts only. Note that for these batons, OUTPUT_STREAM is either CONTEXT_SAVER->STREAM or @@ -2296,8 +2304,10 @@ output_conflict(void *baton, if (style == svn_diff_conflict_display_resolved_modified_latest) { if (diff) - return svn_diff_output(diff, baton, - &svn_diff3__file_output_vtable); + return svn_diff_output2(diff, baton, + &svn_diff3__file_output_vtable, + file_baton->cancel_func, + file_baton->cancel_baton); else style = svn_diff_conflict_display_modified_latest; } @@ -2340,7 +2350,7 @@ output_conflict(void *baton, } svn_error_t * -svn_diff_file_output_merge2(svn_stream_t *output_stream, +svn_diff_file_output_merge3(svn_stream_t *output_stream, svn_diff_t *diff, const char *original_path, const char *modified_path, @@ -2350,6 +2360,8 @@ svn_diff_file_output_merge2(svn_stream_t const char *conflict_latest, const char *conflict_separator, svn_diff_conflict_display_style_t style, + svn_cancel_func_t cancel_func, + void *cancel_baton, apr_pool_t *pool) { svn_diff3__file_output_baton_t baton; @@ -2421,8 +2433,12 @@ svn_diff_file_output_merge2(svn_stream_t eol = APR_EOL_STR; baton.marker_eol = eol; - SVN_ERR(svn_diff_output(diff, &baton, - &svn_diff3__file_output_vtable)); + baton.cancel_func = cancel_func; + baton.cancel_baton = cancel_baton; + + SVN_ERR(svn_diff_output2(diff, &baton, + &svn_diff3__file_output_vtable, + cancel_func, cancel_baton)); for (idx = 0; idx < 3; idx++) { Modified: subversion/branches/remove-log-addressing/subversion/libsvn_diff/diff_memory.c URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_diff/diff_memory.c?rev=1620589&r1=1620588&r2=1620589&view=diff ============================================================================== --- subversion/branches/remove-log-addressing/subversion/libsvn_diff/diff_memory.c (original) +++ subversion/branches/remove-log-addressing/subversion/libsvn_diff/diff_memory.c Tue Aug 26 13:00:03 2014 @@ -610,7 +610,7 @@ static const svn_diff_output_fns_t mem_o svn_error_t * -svn_diff_mem_string_output_unified2(svn_stream_t *output_stream, +svn_diff_mem_string_output_unified3(svn_stream_t *output_stream, svn_diff_t *diff, svn_boolean_t with_diff_header, const char *hunk_delimiter, @@ -619,6 +619,9 @@ svn_diff_mem_string_output_unified2(svn_ const char *header_encoding, const svn_string_t *original, const svn_string_t *modified, + int context_size, + svn_cancel_func_t cancel_func, + void *cancel_baton, apr_pool_t *pool) { @@ -636,7 +639,8 @@ svn_diff_mem_string_output_unified2(svn_ = (hunk_delimiter == NULL || strcmp(hunk_delimiter, "##") != 0) ? APR_EOL_STR SVN_DIFF__NO_NEWLINE_AT_END_OF_FILE APR_EOL_STR : APR_EOL_STR SVN_DIFF__NO_NEWLINE_AT_END_OF_PROPERTY APR_EOL_STR; - baton.context_size = SVN_DIFF__UNIFIED_CONTEXT_SIZE; + baton.context_size = context_size >= 0 ? context_size + : SVN_DIFF__UNIFIED_CONTEXT_SIZE; SVN_ERR(svn_utf_cstring_from_utf8_ex2 (&(baton.prefix_str[unified_output_context]), " ", @@ -658,8 +662,9 @@ svn_diff_mem_string_output_unified2(svn_ original_header, modified_header, pool)); } - SVN_ERR(svn_diff_output(diff, &baton, - &mem_output_unified_vtable)); + SVN_ERR(svn_diff_output2(diff, &baton, + &mem_output_unified_vtable, + cancel_func, cancel_baton)); SVN_ERR(output_unified_flush_hunk(&baton, hunk_delimiter)); @@ -669,28 +674,6 @@ svn_diff_mem_string_output_unified2(svn_ return SVN_NO_ERROR; } -svn_error_t * -svn_diff_mem_string_output_unified(svn_stream_t *output_stream, - svn_diff_t *diff, - const char *original_header, - const char *modified_header, - const char *header_encoding, - const svn_string_t *original, - const svn_string_t *modified, - apr_pool_t *pool) -{ - SVN_ERR(svn_diff_mem_string_output_unified2(output_stream, - diff, - TRUE, - NULL, - original_header, - modified_header, - header_encoding, - original, - modified, - pool)); - return SVN_NO_ERROR; -} @@ -739,6 +722,10 @@ typedef struct merge_output_baton_t svn_diff_conflict_display_style_t conflict_style; int context_size; + /* cancel support */ + svn_cancel_func_t cancel_func; + void *cancel_baton; + /* The rest of the fields are for svn_diff_conflict_display_only_conflicts only. Note that for these batons, OUTPUT_STREAM is either CONTEXT_SAVER->STREAM or @@ -923,7 +910,8 @@ output_conflict(void *baton, if (style == svn_diff_conflict_display_resolved_modified_latest) { if (diff) - return svn_diff_output(diff, baton, &merge_output_vtable); + return svn_diff_output2(diff, baton, &merge_output_vtable, + btn->cancel_func, btn->cancel_baton); else style = svn_diff_conflict_display_modified_latest; } @@ -1066,7 +1054,7 @@ detect_eol(svn_string_t *token) } svn_error_t * -svn_diff_mem_string_output_merge2(svn_stream_t *output_stream, +svn_diff_mem_string_output_merge3(svn_stream_t *output_stream, svn_diff_t *diff, const svn_string_t *original, const svn_string_t *modified, @@ -1076,6 +1064,8 @@ svn_diff_mem_string_output_merge2(svn_st const char *conflict_latest, const char *conflict_separator, svn_diff_conflict_display_style_t style, + svn_cancel_func_t cancel_func, + void *cancel_baton, apr_pool_t *pool) { merge_output_baton_t btn; @@ -1113,6 +1103,8 @@ svn_diff_mem_string_output_merge2(svn_st eol = APR_EOL_STR; /* use the platform default */ btn.marker_eol = eol; + btn.cancel_func = cancel_func; + btn.cancel_baton = cancel_baton; SVN_ERR(svn_utf_cstring_from_utf8(&btn.markers[1], conflict_modified @@ -1135,45 +1127,9 @@ svn_diff_mem_string_output_merge2(svn_st : ">>>>>>> (latest)", pool)); - SVN_ERR(svn_diff_output(diff, &btn, vtable)); + SVN_ERR(svn_diff_output2(diff, &btn, vtable, cancel_func, cancel_baton)); if (conflicts_only) svn_pool_destroy(btn.pool); return SVN_NO_ERROR; } - -svn_error_t * -svn_diff_mem_string_output_merge(svn_stream_t *output_stream, - svn_diff_t *diff, - const svn_string_t *original, - const svn_string_t *modified, - const svn_string_t *latest, - const char *conflict_original, - const char *conflict_modified, - const char *conflict_latest, - const char *conflict_separator, - svn_boolean_t display_original_in_conflict, - svn_boolean_t display_resolved_conflicts, - apr_pool_t *pool) -{ - svn_diff_conflict_display_style_t style = - svn_diff_conflict_display_modified_latest; - - if (display_resolved_conflicts) - style = svn_diff_conflict_display_resolved_modified_latest; - - if (display_original_in_conflict) - style = svn_diff_conflict_display_modified_original_latest; - - return svn_diff_mem_string_output_merge2(output_stream, - diff, - original, - modified, - latest, - conflict_original, - conflict_modified, - conflict_latest, - conflict_separator, - style, - pool); -} Modified: subversion/branches/remove-log-addressing/subversion/libsvn_diff/util.c URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_diff/util.c?rev=1620589&r1=1620588&r2=1620589&view=diff ============================================================================== --- subversion/branches/remove-log-addressing/subversion/libsvn_diff/util.c (original) +++ subversion/branches/remove-log-addressing/subversion/libsvn_diff/util.c Tue Aug 26 13:00:03 2014 @@ -516,6 +516,9 @@ svn_diff__display_prop_diffs(svn_stream_ const apr_array_header_t *propchanges, apr_hash_t *original_props, svn_boolean_t pretty_print_mergeinfo, + int context_size, + svn_cancel_func_t cancel_func, + void *cancel_baton, apr_pool_t *scratch_pool) { apr_pool_t *pool = scratch_pool; @@ -600,9 +603,10 @@ svn_diff__display_prop_diffs(svn_stream_ * UNIX patch could apply the property diff to, so we use "##" * instead of "@@" as the default hunk delimiter for property diffs. * We also suppress the diff header. */ - SVN_ERR(svn_diff_mem_string_output_unified2( + SVN_ERR(svn_diff_mem_string_output_unified3( outstream, diff, FALSE /* no header */, "##", NULL, NULL, - encoding, orig, val, iterpool)); + encoding, orig, val, context_size, + cancel_func, cancel_baton, iterpool)); } } svn_pool_destroy(iterpool); Modified: subversion/branches/remove-log-addressing/subversion/libsvn_fs/fs-loader.c URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_fs/fs-loader.c?rev=1620589&r1=1620588&r2=1620589&view=diff ============================================================================== --- subversion/branches/remove-log-addressing/subversion/libsvn_fs/fs-loader.c (original) +++ subversion/branches/remove-log-addressing/subversion/libsvn_fs/fs-loader.c Tue Aug 26 13:00:03 2014 @@ -393,7 +393,7 @@ synchronized_initialize(void *baton, apr { common_pool = svn_pool_create(pool); base_defn.next = NULL; - SVN_ERR(svn_mutex__init(&common_pool_lock, TRUE, TRUE, common_pool)); + SVN_ERR(svn_mutex__init(&common_pool_lock, TRUE, common_pool)); /* ### This won't work if POOL is NULL and libsvn_fs is loaded as a DSO ### (via libsvn_ra_local say) since the global common_pool will live Modified: subversion/branches/remove-log-addressing/subversion/libsvn_fs_base/bdb/env.c URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_fs_base/bdb/env.c?rev=1620589&r1=1620588&r2=1620589&view=diff ============================================================================== --- subversion/branches/remove-log-addressing/subversion/libsvn_fs_base/bdb/env.c (original) +++ subversion/branches/remove-log-addressing/subversion/libsvn_fs_base/bdb/env.c Tue Aug 26 13:00:03 2014 @@ -380,7 +380,7 @@ bdb_init_cb(void *baton, apr_pool_t *poo bdb_cache_pool = svn_pool_create(pool); bdb_cache = apr_hash_make(bdb_cache_pool); - SVN_ERR(svn_mutex__init(&bdb_cache_lock, TRUE, TRUE, bdb_cache_pool)); + SVN_ERR(svn_mutex__init(&bdb_cache_lock, TRUE, bdb_cache_pool)); apr_pool_cleanup_register(bdb_cache_pool, NULL, clear_cache, apr_pool_cleanup_null); Modified: subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/caching.c URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/caching.c?rev=1620589&r1=1620588&r2=1620589&view=diff ============================================================================== --- subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/caching.c (original) +++ subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/caching.c Tue Aug 26 13:00:03 2014 @@ -118,23 +118,9 @@ read_config(const char **cache_namespace SVN_FS_CONFIG_FSFS_CACHE_FULLTEXTS, TRUE); - /* don't cache revprops by default. - * Revprop caching significantly speeds up operations like - * svn ls -v. However, it requires synchronization that may - * not be available or efficient in the current server setup. - * - * If the caller chose option "2", enable revprop caching if - * the required API support is there to make it efficient. + /* For now, always disable revprop caching. */ - if (strcmp(svn_hash__get_cstring(fs->config, - SVN_FS_CONFIG_FSFS_CACHE_REVPROPS, - ""), "2")) - *cache_revprops - = svn_hash__get_bool(fs->config, - SVN_FS_CONFIG_FSFS_CACHE_REVPROPS, - FALSE); - else - *cache_revprops = svn_named_atomic__is_efficient(); + *cache_revprops = FALSE; return SVN_NO_ERROR; } @@ -360,6 +346,7 @@ svn_fs_fs__initialize_caches(svn_fs_t *f fs_fs_data_t *ffd = fs->fsap_data; const char *prefix = apr_pstrcat(pool, "fsfs:", fs->uuid, + ":", ffd->instance_id, "/", normalize_key_part(fs->path, pool), ":", SVN_VA_NULL); @@ -721,6 +708,7 @@ svn_fs_fs__initialize_txn_caches(svn_fs_ Therefore, throw in a uuid as well - just to be sure. */ const char *prefix = apr_pstrcat(pool, "fsfs:", fs->uuid, + ":", ffd->instance_id, "/", fs->path, ":", txn_id, ":", svn_uuid_generate(pool), ":", Modified: subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/fs.c URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/fs.c?rev=1620589&r1=1620588&r2=1620589&view=diff ============================================================================== --- subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/fs.c (original) +++ subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/fs.c Tue Aug 26 13:00:03 2014 @@ -73,11 +73,28 @@ fs_serialized_init(svn_fs_t *fs, apr_poo svn_fs_initialize pool. It's unlikely that anyone will notice the modest expenditure; the alternative is to allocate each structure in a subpool, add a reference-count, and add a serialized destructor - to the FS vtable. That's more machinery than it's worth. */ + to the FS vtable. That's more machinery than it's worth. + + Picking an appropriate key for the shared data is tricky, because, + unfortunately, a filesystem UUID is not really unique. It is implicitly + shared between hotcopied (1), dump / loaded (2) or naively copied (3) + filesystems. We tackle this problem by using a combination of the UUID + and an instance ID as the key. This allows us to avoid key clashing + in (1) and (2) for formats >= SVN_FS_FS__MIN_INSTANCE_ID_FORMAT, which + do support instance IDs. For old formats the shared data (locks, shared + transaction data, ...) will still clash. + + Speaking of (3), there is not so much we can do about it, except maybe + provide a convenient way of fixing things. Naively copied filesystems + have identical filesystem UUIDs *and* instance IDs. With the key being + a combination of these two, clashes can be fixed by changing either of + them (or both), e.g. with svn_fs_set_uuid(). */ SVN_ERR_ASSERT(fs->uuid); - key = apr_pstrcat(pool, SVN_FSFS_SHARED_USERDATA_PREFIX, fs->uuid, - SVN_VA_NULL); + SVN_ERR_ASSERT(ffd->instance_id); + + key = apr_pstrcat(pool, SVN_FSFS_SHARED_USERDATA_PREFIX, + fs->uuid, ":", ffd->instance_id, SVN_VA_NULL); status = apr_pool_userdata_get(&val, key, common_pool); if (status) return svn_error_wrap_apr(status, _("Can't fetch FSFS shared data")); @@ -91,22 +108,17 @@ fs_serialized_init(svn_fs_t *fs, apr_poo /* POSIX fcntl locks are per-process, so we need a mutex for intra-process synchronization when grabbing the repository write lock. */ - SVN_ERR(svn_mutex__init(&ffsd->fs_write_lock, - TRUE, TRUE, common_pool)); + SVN_ERR(svn_mutex__init(&ffsd->fs_write_lock, TRUE, common_pool)); /* ... the pack lock ... */ - SVN_ERR(svn_mutex__init(&ffsd->fs_pack_lock, - TRUE, TRUE, common_pool)); + SVN_ERR(svn_mutex__init(&ffsd->fs_pack_lock, TRUE, common_pool)); /* ... not to mention locking the txn-current file. */ - SVN_ERR(svn_mutex__init(&ffsd->txn_current_lock, - TRUE, TRUE, common_pool)); + SVN_ERR(svn_mutex__init(&ffsd->txn_current_lock, TRUE, common_pool)); /* We also need a mutex for synchronizing access to the active - transaction list and free transaction pointer. This one is - enabled unconditionally. */ - SVN_ERR(svn_mutex__init(&ffsd->txn_list_lock, - TRUE, TRUE, common_pool)); + transaction list and free transaction pointer. */ + SVN_ERR(svn_mutex__init(&ffsd->txn_list_lock, TRUE, common_pool)); key = apr_pstrdup(common_pool, key); status = apr_pool_userdata_set(ffsd, key, NULL, common_pool); @@ -202,6 +214,18 @@ fs_info(const void **fsfs_info, return SVN_NO_ERROR; } +/* Wrapper around svn_fs_fs__set_uuid() adapting between function + signatures. */ +static svn_error_t * +fs_set_uuid(svn_fs_t *fs, + const char *uuid, + apr_pool_t *pool) +{ + /* Whenever we set a new UUID, imply that FS will also be a different + * instance (on formats that support this). */ + return svn_error_trace(svn_fs_fs__set_uuid(fs, uuid, NULL, pool)); +} + /* The vtable associated with a specific open filesystem. */ @@ -210,7 +234,7 @@ static fs_vtable_t fs_vtable = { svn_fs_fs__revision_prop, svn_fs_fs__get_revision_proplist, svn_fs_fs__change_rev_prop, - svn_fs_fs__set_uuid, + fs_set_uuid, svn_fs_fs__revision_root, svn_fs_fs__begin_txn, svn_fs_fs__open_txn, @@ -246,12 +270,11 @@ initialize_fs_struct(svn_fs_t *fs) /* Reset vtable and fsap_data fields in FS such that the FS is basically * closed now. Note that FS must not hold locks when you call this. */ -static svn_error_t * +static void uninitialize_fs_struct(svn_fs_t *fs) { fs->vtable = NULL; fs->fsap_data = NULL; - return SVN_NO_ERROR; } /* This implements the fs_library_vtable_t.create() API. Create a new @@ -428,7 +451,7 @@ fs_hotcopy(svn_fs_t *src_fs, SVN_ERR(initialize_fs_struct(dst_fs)); SVN_ERR(svn_fs_fs__hotcopy_prepare_target(src_fs, dst_fs, dst_path, incremental, pool)); - SVN_ERR(uninitialize_fs_struct(dst_fs)); + uninitialize_fs_struct(dst_fs); /* Now, the destination repo should open just fine. */ SVN_ERR(fs_open(dst_fs, dst_path, common_pool_lock, pool, common_pool)); Modified: subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/fs.h URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/fs.h?rev=1620589&r1=1620588&r2=1620589&view=diff ============================================================================== --- subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/fs.h (original) +++ subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/fs.h Tue Aug 26 13:00:03 2014 @@ -167,6 +167,9 @@ extern "C" { /* Minimum format number that stores mergeinfo-mode flag in changed paths */ #define SVN_FS_FS__MIN_MERGEINFO_IN_CHANGES_FORMAT 7 +/* Minimum format number that supports per-instance filesystem IDs. */ +#define SVN_FS_FS__MIN_INSTANCE_ID_FORMAT 7 + /* The minimum format number that supports a configuration file (fsfs.conf) */ #define SVN_FS_FS__MIN_CONFIG_FILE 4 @@ -421,6 +424,12 @@ typedef struct fs_fs_data_t /* Pack after every commit. */ svn_boolean_t pack_after_commit; + /* Per-instance filesystem ID, which provides an additional level of + uniqueness for filesystems that share the same UUID, but should + still be distinguishable (e.g. backups produced by svn_fs_hotcopy() + or dump / load cycles). */ + const char *instance_id; + /* Pointer to svn_fs_open. */ svn_error_t *(*svn_fs_open_)(svn_fs_t **, const char *, apr_hash_t *, apr_pool_t *, apr_pool_t *); Modified: subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/fs_fs.c URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/fs_fs.c?rev=1620589&r1=1620588&r2=1620589&view=diff ============================================================================== --- subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/fs_fs.c (original) +++ subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/fs_fs.c Tue Aug 26 13:00:03 2014 @@ -896,15 +896,49 @@ read_global_config(svn_fs_t *fs) return SVN_NO_ERROR; } -svn_error_t * -svn_fs_fs__open(svn_fs_t *fs, const char *path, apr_pool_t *pool) +/* Read FS's UUID file and store the data in the FS struct. */ +static svn_error_t * +read_uuid(svn_fs_t *fs, + apr_pool_t *scratch_pool) { fs_fs_data_t *ffd = fs->fsap_data; apr_file_t *uuid_file; - int format, max_files_per_dir; char buf[APR_UUID_FORMATTED_LENGTH + 2]; apr_size_t limit; + /* Read the repository uuid. */ + SVN_ERR(svn_io_file_open(&uuid_file, path_uuid(fs, scratch_pool), + APR_READ | APR_BUFFERED, APR_OS_DEFAULT, + scratch_pool)); + + limit = sizeof(buf); + SVN_ERR(svn_io_read_length_line(uuid_file, buf, &limit, scratch_pool)); + fs->uuid = apr_pstrdup(fs->pool, buf); + + /* Read the instance ID. */ + if (ffd->format >= SVN_FS_FS__MIN_INSTANCE_ID_FORMAT) + { + limit = sizeof(buf); + SVN_ERR(svn_io_read_length_line(uuid_file, buf, &limit, + scratch_pool)); + ffd->instance_id = apr_pstrdup(fs->pool, buf); + } + else + { + ffd->instance_id = fs->uuid; + } + + SVN_ERR(svn_io_file_close(uuid_file, scratch_pool)); + + return SVN_NO_ERROR; +} + +svn_error_t * +svn_fs_fs__open(svn_fs_t *fs, const char *path, apr_pool_t *pool) +{ + fs_fs_data_t *ffd = fs->fsap_data; + int format, max_files_per_dir; + fs->path = apr_pstrdup(fs->pool, path); /* Read the FS format number. */ @@ -916,14 +950,7 @@ svn_fs_fs__open(svn_fs_t *fs, const char ffd->max_files_per_dir = max_files_per_dir; /* Read in and cache the repository uuid. */ - SVN_ERR(svn_io_file_open(&uuid_file, path_uuid(fs, pool), - APR_READ | APR_BUFFERED, APR_OS_DEFAULT, pool)); - - limit = sizeof(buf); - SVN_ERR(svn_io_read_length_line(uuid_file, buf, &limit, pool)); - fs->uuid = apr_pstrdup(fs->pool, buf); - - SVN_ERR(svn_io_file_close(uuid_file, pool)); + SVN_ERR(read_uuid(fs, pool)); /* Read the min unpacked revision. */ if (ffd->format >= SVN_FS_FS__MIN_PACKED_FORMAT) @@ -1045,10 +1072,21 @@ upgrade_body(void *baton, apr_pool_t *po pool)); } - /* Bump the format file. */ + /* We will need the UUID info shortly ... + Read it before the format bump as the UUID file still uses the old + format. */ + SVN_ERR(read_uuid(fs, pool)); + + /* Update the format info in the FS struct. Upgrade steps further + down will use the format from FS to create missing info. */ ffd->format = SVN_FS_FS__FORMAT_NUMBER; ffd->max_files_per_dir = max_files_per_dir; + /* Always add / bump the instance ID such that no form of caching + accidentally uses outdated information. Keep the UUID. */ + SVN_ERR(svn_fs_fs__set_uuid(fs, fs->uuid, NULL, pool)); + + /* Bump the format file. */ SVN_ERR(svn_fs_fs__write_format(fs, TRUE, pool)); if (upgrade_baton->notify_func) SVN_ERR(upgrade_baton->notify_func(upgrade_baton->notify_baton, @@ -1453,7 +1491,7 @@ svn_fs_fs__create(svn_fs_t *fs, ? "0\n" : "0 1 1\n"), pool)); SVN_ERR(svn_io_file_create_empty(svn_fs_fs__path_lock(fs, pool), pool)); - SVN_ERR(svn_fs_fs__set_uuid(fs, NULL, pool)); + SVN_ERR(svn_fs_fs__set_uuid(fs, NULL, NULL, pool)); /* Create the fsfs.conf file if supported. Older server versions would simply ignore the file but that might result in a different behavior @@ -1496,28 +1534,40 @@ svn_fs_fs__create(svn_fs_t *fs, svn_error_t * svn_fs_fs__set_uuid(svn_fs_t *fs, const char *uuid, + const char *instance_id, apr_pool_t *pool) { - char *my_uuid; - apr_size_t my_uuid_len; + fs_fs_data_t *ffd = fs->fsap_data; const char *uuid_path = path_uuid(fs, pool); + svn_stringbuf_t *contents = svn_stringbuf_create_empty(pool); if (! uuid) uuid = svn_uuid_generate(pool); - /* Make sure we have a copy in FS->POOL, and append a newline. */ - my_uuid = apr_pstrcat(fs->pool, uuid, "\n", SVN_VA_NULL); - my_uuid_len = strlen(my_uuid); + if (! instance_id) + instance_id = svn_uuid_generate(pool); + + svn_stringbuf_appendcstr(contents, uuid); + svn_stringbuf_appendcstr(contents, "\n"); + + if (ffd->format >= SVN_FS_FS__MIN_INSTANCE_ID_FORMAT) + { + svn_stringbuf_appendcstr(contents, instance_id); + svn_stringbuf_appendcstr(contents, "\n"); + } /* We use the permissions of the 'current' file, because the 'uuid' file does not exist during repository creation. */ - SVN_ERR(svn_io_write_atomic(uuid_path, my_uuid, my_uuid_len, + SVN_ERR(svn_io_write_atomic(uuid_path, contents->data, contents->len, svn_fs_fs__path_current(fs, pool) /* perms */, pool)); - /* Remove the newline we added, and stash the UUID. */ - my_uuid[my_uuid_len - 1] = '\0'; - fs->uuid = my_uuid; + fs->uuid = apr_pstrdup(fs->pool, uuid); + + if (ffd->format >= SVN_FS_FS__MIN_INSTANCE_ID_FORMAT) + ffd->instance_id = apr_pstrdup(fs->pool, instance_id); + else + ffd->instance_id = fs->uuid; return SVN_NO_ERROR; } Modified: subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/fs_fs.h URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/fs_fs.h?rev=1620589&r1=1620588&r2=1620589&view=diff ============================================================================== --- subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/fs_fs.h (original) +++ subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/fs_fs.h Tue Aug 26 13:00:03 2014 @@ -115,11 +115,13 @@ svn_error_t *svn_fs_fs__create(svn_fs_t const char *path, apr_pool_t *pool); -/* Set the uuid of repository FS to UUID, if UUID is not NULL; - otherwise, set the uuid of FS to a newly generated UUID. Perform - temporary allocations in POOL. */ +/* Set the uuid of repository FS to UUID and the instance ID to INSTANCE_ID. + If any of them is NULL, use a newly generated UUID / ID instead. Ignore + INSTANCE_ID whenever instance IDs are not supported by the FS format. + Perform temporary allocations in POOL. */ svn_error_t *svn_fs_fs__set_uuid(svn_fs_t *fs, const char *uuid, + const char *instance_id, apr_pool_t *pool); /* Return the path to the 'current' file in FS. Modified: subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/hotcopy.c URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/hotcopy.c?rev=1620589&r1=1620588&r2=1620589&view=diff ============================================================================== --- subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/hotcopy.c (original) +++ subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/hotcopy.c Tue Aug 26 13:00:03 2014 @@ -1080,9 +1080,10 @@ hotcopy_create_empty_dest(svn_fs_t *src_ ? "0\n" : "0 1 1\n"), pool)); - /* Create lock file and UUID. */ + /* Create the lock and 'uuid' files. Hotcopy destination receives a + new instance ID, but has the same filesystem UUID as the source. */ SVN_ERR(svn_io_file_create_empty(svn_fs_fs__path_lock(dst_fs, pool), pool)); - SVN_ERR(svn_fs_fs__set_uuid(dst_fs, src_fs->uuid, pool)); + SVN_ERR(svn_fs_fs__set_uuid(dst_fs, src_fs->uuid, NULL, pool)); /* Create the min unpacked rev file. */ if (dst_ffd->format >= SVN_FS_FS__MIN_PACKED_FORMAT) Modified: subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/id.c URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/id.c?rev=1620589&r1=1620588&r2=1620589&view=diff ============================================================================== --- subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/id.c (original) +++ subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/id.c Tue Aug 26 13:00:03 2014 @@ -48,12 +48,67 @@ typedef struct fs_fs__id_t +/** Like strtol but with a fixed base of 10, locale independent and limited + * to non-negative values. Overflows are indicated by a FALSE return value + * in which case *RESULT_P will not be modified. + * + * This allows the compiler to generate massively faster code. + * (E.g. Avoiding locale specific processing). ID parsing is one of the + * most CPU consuming parts of FSFS data access. Better be quick. + */ +static svn_boolean_t +locale_independent_strtol(long *result_p, + const char* buffer, + const char** end) +{ + /* We allow positive values only. We use unsigned arithmetics to get + * well-defined overflow behavior. It also happens to allow for a wider + * range of compiler-side optimizations. */ + unsigned long result = 0; + while (1) + { + unsigned long c = (unsigned char)*buffer - (unsigned char)'0'; + unsigned long next; + + /* This implies the NUL check. */ + if (c > 9) + break; + + /* Overflow check. Passing this, NEXT can be no more than ULONG_MAX+9 + * before being truncated to ULONG but it still covers 0 .. ULONG_MAX. + */ + if (result > ULONG_MAX / 10) + return FALSE; + + next = result * 10 + c; + + /* Overflow check. In case of an overflow, NEXT is 0..9. + * In the non-overflow case, RESULT is either >= 10 or RESULT and NEXT + * are both 0. */ + if (next < result) + return FALSE; + + result = next; + ++buffer; + } + + *end = buffer; + if (result > LONG_MAX) + return FALSE; + + *result_p = (long)result; + + return TRUE; +} + /* Parse the NUL-terminated ID part at DATA and write the result into *PART. * Return TRUE if no errors were detected. */ static svn_boolean_t part_parse(svn_fs_fs__id_part_t *part, const char *data) { + const char *end; + /* special case: ID inside some transaction */ if (data[0] == '_') { @@ -78,12 +133,7 @@ part_parse(svn_fs_fs__id_part_t *part, return *data == '\0'; } - { - const char *end; - part->revision = svn__strtol(data+1, &end); - } - - return TRUE; + return locale_independent_strtol(&part->revision, data+1, &end); } /* Parse the transaction id in DATA and store the result in *TXN_ID. @@ -94,7 +144,9 @@ txn_id_parse(svn_fs_fs__id_part_t *txn_i const char *data) { const char *end; - txn_id->revision = svn__strtol(data, &end); + if (!locale_independent_strtol(&txn_id->revision, data, &end)) + return FALSE; + data = strchr(end, '-'); if (data == NULL) return FALSE; @@ -429,9 +481,8 @@ svn_fs_id_t * svn_fs_fs__id_copy(const svn_fs_id_t *source, apr_pool_t *pool) { const fs_fs__id_t *id = (const fs_fs__id_t *)source; - fs_fs__id_t *new_id = apr_palloc(pool, sizeof(*new_id)); + fs_fs__id_t *new_id = apr_pmemdup(pool, id, sizeof(*new_id)); - *new_id = *id; new_id->generic_id.fsap_data = new_id; return (svn_fs_id_t *)new_id; @@ -489,7 +540,9 @@ svn_fs_fs__id_parse(char *data, str = svn_cstring_tokenize("/", &data); if (str == NULL) return NULL; - id->private_id.rev_item.revision = svn__strtol(str, &tmp); + if (!locale_independent_strtol(&id->private_id.rev_item.revision, + str, &tmp)) + return NULL; err = svn_cstring_atoi64(&val, data); if (err) Modified: subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/structure URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/structure?rev=1620589&r1=1620588&r2=1620589&view=diff ============================================================================== --- subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/structure (original) +++ subversion/branches/remove-log-addressing/subversion/libsvn_fs_fs/structure Tue Aug 26 13:00:03 2014 @@ -62,7 +62,7 @@ repository) is: write-lock Empty file, locked to serialise writers pack-lock Empty file, locked to serialise 'svnadmin pack' (f. 7+) txn-current-lock Empty file, locked to serialise 'txn-current' - uuid File containing the UUID of the repository + uuid File containing the repository IDs format File containing the format number of this filesystem fsfs.conf Configuration file min-unpacked-rev File containing the oldest revision not in a pack file @@ -204,6 +204,10 @@ Addressing: Format 7+: Logical addressing; uses item index that will be translated on-the-fly to the actual rev / pack file location +Repository IDs: + Format 1+: The first line of db/uuid contains the repository UUID + Format 7+: The second line contains the instance ID (in UUID formatting) + # Incomplete list. See SVN_FS_FS__MIN_*_FORMAT Propchange: subversion/branches/remove-log-addressing/subversion/libsvn_fs_x/ ------------------------------------------------------------------------------ Merged /subversion/trunk/subversion/libsvn_fs_x:r1617439-1620574 Modified: subversion/branches/remove-log-addressing/subversion/libsvn_fs_x/fs.c URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_fs_x/fs.c?rev=1620589&r1=1620588&r2=1620589&view=diff ============================================================================== --- subversion/branches/remove-log-addressing/subversion/libsvn_fs_x/fs.c (original) +++ subversion/branches/remove-log-addressing/subversion/libsvn_fs_x/fs.c Tue Aug 26 13:00:03 2014 @@ -99,22 +99,17 @@ x_serialized_init(svn_fs_t *fs, apr_pool /* POSIX fcntl locks are per-process, so we need a mutex for intra-process synchronization when grabbing the repository write lock. */ - SVN_ERR(svn_mutex__init(&ffsd->fs_write_lock, - TRUE, TRUE, common_pool)); + SVN_ERR(svn_mutex__init(&ffsd->fs_write_lock, TRUE, common_pool)); /* ... the pack lock ... */ - SVN_ERR(svn_mutex__init(&ffsd->fs_pack_lock, - TRUE, TRUE, common_pool)); + SVN_ERR(svn_mutex__init(&ffsd->fs_pack_lock, TRUE, common_pool)); /* ... not to mention locking the txn-current file. */ - SVN_ERR(svn_mutex__init(&ffsd->txn_current_lock, - TRUE, TRUE, common_pool)); + SVN_ERR(svn_mutex__init(&ffsd->txn_current_lock, TRUE, common_pool)); /* We also need a mutex for synchronizing access to the active - transaction list and free transaction pointer. This one is - enabled unconditionally. */ - SVN_ERR(svn_mutex__init(&ffsd->txn_list_lock, - TRUE, TRUE, common_pool)); + transaction list and free transaction pointer. */ + SVN_ERR(svn_mutex__init(&ffsd->txn_list_lock, TRUE, common_pool)); key = apr_pstrdup(common_pool, key); status = apr_pool_userdata_set(ffsd, key, NULL, common_pool); Modified: subversion/branches/remove-log-addressing/subversion/libsvn_fs_x/id.c URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_fs_x/id.c?rev=1620589&r1=1620588&r2=1620589&view=diff ============================================================================== --- subversion/branches/remove-log-addressing/subversion/libsvn_fs_x/id.c (original) +++ subversion/branches/remove-log-addressing/subversion/libsvn_fs_x/id.c Tue Aug 26 13:00:03 2014 @@ -264,7 +264,7 @@ svn_fs_x__id_check_related(const svn_fs_ /* Items from different txns are unrelated. */ if ( svn_fs_x__is_txn(id_a->noderev_id.change_set) && svn_fs_x__is_txn(id_b->noderev_id.change_set) - && id_a->noderev_id.change_set != id_a->noderev_id.change_set) + && id_a->noderev_id.change_set != id_b->noderev_id.change_set) return FALSE; /* related if they trace back to the same node creation */ Modified: subversion/branches/remove-log-addressing/subversion/libsvn_fs_x/index.c URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_fs_x/index.c?rev=1620589&r1=1620588&r2=1620589&view=diff ============================================================================== --- subversion/branches/remove-log-addressing/subversion/libsvn_fs_x/index.c (original) +++ subversion/branches/remove-log-addressing/subversion/libsvn_fs_x/index.c Tue Aug 26 13:00:03 2014 @@ -638,10 +638,9 @@ encode_l2p_page(apr_array_header_t *entr } else { - apr_uintptr_t idx - = (apr_uintptr_t)apr_hash_get(containers, &entry->offset, - sizeof(entry->offset)); - if (idx == 0) + void *void_idx = apr_hash_get(containers, &entry->offset, + sizeof(entry->offset)); + if (void_idx == NULL) { apr_uint64_t value = entry->offset + container_count; SVN_ERR(svn_spillbuf__write(buffer, (const char *)encoded, @@ -649,6 +648,7 @@ encode_l2p_page(apr_array_header_t *entr } else { + apr_uintptr_t idx = (apr_uintptr_t)void_idx; apr_uint64_t value = entry->sub_item; SVN_ERR(svn_spillbuf__write(buffer, (const char *)encoded, encode_uint(encoded, idx), pool)); Modified: subversion/branches/remove-log-addressing/subversion/libsvn_fs_x/noderevs.c URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_fs_x/noderevs.c?rev=1620589&r1=1620588&r2=1620589&view=diff ============================================================================== --- subversion/branches/remove-log-addressing/subversion/libsvn_fs_x/noderevs.c (original) +++ subversion/branches/remove-log-addressing/subversion/libsvn_fs_x/noderevs.c Tue Aug 26 13:00:03 2014 @@ -210,6 +210,7 @@ store_id(apr_array_header_t *ids, { binary_id_t bin_id = { { 0 } }; int idx; + void *idx_void; if (id == NULL) return 0; @@ -218,7 +219,8 @@ store_id(apr_array_header_t *ids, bin_id.copy_id = *svn_fs_x__id_copy_id(id); bin_id.noderev_id = *svn_fs_x__id_noderev_id(id); - idx = (int)(apr_uintptr_t)apr_hash_get(dict, &bin_id, sizeof(bin_id)); + idx_void = apr_hash_get(dict, &bin_id, sizeof(bin_id)); + idx = (int)(apr_uintptr_t)idx_void; if (idx == 0) { APR_ARRAY_PUSH(ids, binary_id_t) = bin_id; @@ -240,6 +242,7 @@ store_representation(apr_array_header_t { binary_representation_t binary_rep = { 0 }; int idx; + void *idx_void; if (rep == NULL) return 0; @@ -251,8 +254,8 @@ store_representation(apr_array_header_t binary_rep.size = rep->size; binary_rep.expanded_size = rep->expanded_size; - idx = (int)(apr_uintptr_t)apr_hash_get(dict, &binary_rep, - sizeof(binary_rep)); + idx_void = apr_hash_get(dict, &binary_rep, sizeof(binary_rep)); + idx = (int)(apr_uintptr_t)idx_void; if (idx == 0) { APR_ARRAY_PUSH(reps, binary_representation_t) = binary_rep; Modified: subversion/branches/remove-log-addressing/subversion/libsvn_fs_x/string_table.c URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_fs_x/string_table.c?rev=1620589&r1=1620588&r2=1620589&view=diff ============================================================================== --- subversion/branches/remove-log-addressing/subversion/libsvn_fs_x/string_table.c (original) +++ subversion/branches/remove-log-addressing/subversion/libsvn_fs_x/string_table.c Tue Aug 26 13:00:03 2014 @@ -284,12 +284,13 @@ svn_fs_x__string_table_builder_add(strin string = apr_pstrmemdup(builder->pool, string, len); if (len > MAX_SHORT_STRING_LEN) { + void *idx_void; svn_string_t item; item.data = string; item.len = len; - - result - = (apr_uintptr_t)apr_hash_get(table->long_string_dict, string, len); + + idx_void = apr_hash_get(table->long_string_dict, string, len); + result = (apr_uintptr_t)idx_void; if (result) return result - 1 + LONG_STRING_MASK Modified: subversion/branches/remove-log-addressing/subversion/libsvn_fs_x/tree.c URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_fs_x/tree.c?rev=1620589&r1=1620588&r2=1620589&view=diff ============================================================================== --- subversion/branches/remove-log-addressing/subversion/libsvn_fs_x/tree.c (original) +++ subversion/branches/remove-log-addressing/subversion/libsvn_fs_x/tree.c Tue Aug 26 13:00:03 2014 @@ -2460,7 +2460,7 @@ typedef enum copy_type_t copy_type_plain_add, /* add with history */ - copy_type_add_with_history, + copy_type_add_with_history } copy_type_t; /* Copy the node at FROM_PATH under FROM_ROOT to TO_PATH under Modified: subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/ra_serf.h URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/ra_serf.h?rev=1620589&r1=1620588&r2=1620589&view=diff ============================================================================== --- subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/ra_serf.h (original) +++ subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/ra_serf.h Tue Aug 26 13:00:03 2014 @@ -144,6 +144,13 @@ struct svn_ra_serf__session_t { i.e. is there a (reverse) proxy that does not support them? */ svn_boolean_t detect_chunking; + /* Can serf use HTTP pipelining, or should it send requests one by one. + HTTP pipelining is enabled by default. The only known case where it should + be disabled is when the server triggers SSL renegotiations in the middle + of HTTP traffic on a connection, which OpenSSL currently doesn't handle + well. See serf issue #135. */ + svn_boolean_t http_pipelining; + /* Our Version-Controlled-Configuration; may be NULL until we know it. */ const char *vcc_url; Modified: subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/replay.c URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/replay.c?rev=1620589&r1=1620588&r2=1620589&view=diff ============================================================================== --- subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/replay.c (original) +++ subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/replay.c Tue Aug 26 13:00:03 2014 @@ -61,7 +61,7 @@ typedef enum replay_state_e { REPLAY_CLOSE_DIRECTORY, REPLAY_CHANGE_DIRECTORY_PROP, REPLAY_CHANGE_FILE_PROP, - REPLAY_APPLY_TEXTDELTA, + REPLAY_APPLY_TEXTDELTA } replay_state_e; #define S_ SVN_XML_NAMESPACE Modified: subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/serf.c URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/serf.c?rev=1620589&r1=1620588&r2=1620589&view=diff ============================================================================== --- subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/serf.c (original) +++ subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/serf.c Tue Aug 26 13:00:03 2014 @@ -244,6 +244,12 @@ load_config(svn_ra_serf__session_t *sess SVN_CONFIG_OPTION_HTTP_CHUNKED_REQUESTS, "auto", svn_tristate_unknown)); + /* Should we use HTTP pipelining. */ + SVN_ERR(svn_config_get_bool(config, &session->http_pipelining, + SVN_CONFIG_SECTION_GLOBAL, + SVN_CONFIG_OPTION_HTTP_PIPELINING, + TRUE)); + #if SERF_VERSION_AT_LEAST(1, 4, 0) && !defined(SVN_SERF_NO_LOGGING) SVN_ERR(svn_config_get_int64(config, &log_components, SVN_CONFIG_SECTION_GLOBAL, @@ -311,6 +317,12 @@ load_config(svn_ra_serf__session_t *sess SVN_CONFIG_OPTION_HTTP_CHUNKED_REQUESTS, "auto", chunked_requests)); + /* Should we use HTTP pipelining. */ + SVN_ERR(svn_config_get_bool(config, &session->http_pipelining, + server_group, + SVN_CONFIG_OPTION_HTTP_PIPELINING, + session->http_pipelining)); + #if SERF_VERSION_AT_LEAST(1, 4, 0) && !defined(SVN_SERF_NO_LOGGING) SVN_ERR(svn_config_get_int64(config, &log_components, server_group, @@ -570,6 +582,10 @@ svn_ra_serf__open(svn_ra_session_t *sess if (status) return svn_ra_serf__wrap_err(status, NULL); + if (!serf_sess->http_pipelining) { + serf_connection_set_max_outstanding_requests(serf_sess->conns[0]->conn, 1); + } + /* Set the progress callback. */ serf_context_set_progress_cb(serf_sess->context, svn_ra_serf__progress, serf_sess); @@ -771,6 +787,10 @@ ra_serf_dup_session(svn_ra_session_t *ne if (status) return svn_ra_serf__wrap_err(status, NULL); + if (!new_sess->http_pipelining) { + serf_connection_set_max_outstanding_requests(new_sess->conns[0]->conn, 1); + } + /* Set the progress callback. */ serf_context_set_progress_cb(new_sess->context, svn_ra_serf__progress, new_sess); Modified: subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/update.c URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/update.c?rev=1620589&r1=1620588&r2=1620589&view=diff ============================================================================== --- subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/update.c (original) +++ subversion/branches/remove-log-addressing/subversion/libsvn_ra_serf/update.c Tue Aug 26 13:00:03 2014 @@ -723,6 +723,11 @@ open_connection_if_needed(svn_ra_serf__s if (status) return svn_ra_serf__wrap_err(status, NULL); + if (!sess->http_pipelining) { + serf_connection_set_max_outstanding_requests(sess->conns[cur]->conn, + 1); + } + sess->num_conns++; } Modified: subversion/branches/remove-log-addressing/subversion/libsvn_ra_svn/cyrus_auth.c URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_ra_svn/cyrus_auth.c?rev=1620589&r1=1620588&r2=1620589&view=diff ============================================================================== --- subversion/branches/remove-log-addressing/subversion/libsvn_ra_svn/cyrus_auth.c (original) +++ subversion/branches/remove-log-addressing/subversion/libsvn_ra_svn/cyrus_auth.c Tue Aug 26 13:00:03 2014 @@ -93,7 +93,7 @@ static svn_error_t * sasl_mutex_alloc_cb_internal(svn_mutex__t **mutex) { if (apr_is_empty_array(free_mutexes)) - return svn_mutex__init(mutex, TRUE, FALSE, sasl_pool); + return svn_mutex__init(mutex, TRUE, sasl_pool); else *mutex = *((svn_mutex__t**)apr_array_pop(free_mutexes)); @@ -179,7 +179,7 @@ svn_ra_svn__sasl_common_init(apr_pool_t sasl_mutex_unlock_cb, sasl_mutex_free_cb); free_mutexes = apr_array_make(sasl_pool, 0, sizeof(svn_mutex__t *)); - SVN_ERR(svn_mutex__init(&array_mutex, TRUE, FALSE, sasl_pool)); + SVN_ERR(svn_mutex__init(&array_mutex, TRUE, sasl_pool)); #endif /* APR_HAS_THREADS */ Modified: subversion/branches/remove-log-addressing/subversion/libsvn_subr/cache-inprocess.c URL: http://svn.apache.org/viewvc/subversion/branches/remove-log-addressing/subversion/libsvn_subr/cache-inprocess.c?rev=1620589&r1=1620588&r2=1620589&view=diff ============================================================================== --- subversion/branches/remove-log-addressing/subversion/libsvn_subr/cache-inprocess.c (original) +++ subversion/branches/remove-log-addressing/subversion/libsvn_subr/cache-inprocess.c Tue Aug 26 13:00:03 2014 @@ -680,7 +680,7 @@ svn_cache__create_inprocess(svn_cache__t /* The sentinel doesn't need a pool. (We're happy to crash if we * accidentally try to treat it like a real page.) */ - SVN_ERR(svn_mutex__init(&cache->mutex, thread_safe, FALSE, pool)); + SVN_ERR(svn_mutex__init(&cache->mutex, thread_safe, pool)); cache->cache_pool = pool;
