Author: rhuijben
Date: Wed Jul 4 19:48:26 2012
New Revision: 1357378
URL: http://svn.apache.org/viewvc?rev=1357378&view=rev
Log:
Following up on r1357362, fix more errors in the retrieval of all marker
paths.
* subversion/libsvn_wc/conflicts.c
(svn_wc__conflict_read_markers): Propertly use pstrmemdup().
* subversion/libsvn_wc/wc_db.c
(revert_list_read_baton): Add db variable.
(revert_list_read): Fix compilation of the skel mode code.
(svn_wc__db_revert_list_read): Update caller.
* subversion/tests/libsvn_wc/conflict-data-test.c
(test_serialize_text_conflict): Extend test a bit to really verify the
paths.
Modified:
subversion/trunk/subversion/libsvn_wc/conflicts.c
subversion/trunk/subversion/libsvn_wc/wc_db.c
subversion/trunk/subversion/tests/libsvn_wc/conflict-data-test.c
Modified: subversion/trunk/subversion/libsvn_wc/conflicts.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/conflicts.c?rev=1357378&r1=1357377&r2=1357378&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/conflicts.c (original)
+++ subversion/trunk/subversion/libsvn_wc/conflicts.c Wed Jul 4 19:48:26 2012
@@ -990,7 +990,8 @@ svn_wc__conflict_read_markers(const apr_
SVN_ERR(svn_wc__db_from_relpath(
&APR_ARRAY_PUSH(list, const char*),
db, wri_abspath,
- apr_pmemdup(scratch_pool, marker->data, marker->len),
+ apr_pstrmemdup(scratch_pool, marker->data,
+ marker->len),
result_pool, scratch_pool));
}
}
Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1357378&r1=1357377&r2=1357378&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Wed Jul 4 19:48:26 2012
@@ -5955,6 +5955,9 @@ struct revert_list_read_baton {
svn_boolean_t *copied_here;
svn_kind_t *kind;
apr_pool_t *result_pool;
+#if SVN_WC__VERSION >= SVN_WC__USES_CONFLICT_SKELS
+ svn_wc__db_t *db;
+#endif
};
static svn_error_t *
@@ -6004,10 +6007,12 @@ revert_list_read(void *baton,
apr_size_t conflict_len;
const void *conflict_data;
- conflict_data = svn_sqlite__column_blob(stmt, 5, &conflict_len);
+ conflict_data = svn_sqlite__column_blob(stmt, 5, &conflict_len,
+ scratch_pool);
if (conflict_data)
{
svn_boolean_t tree_conflicted;
+
svn_skel_t *conflicts = svn_skel__parse(conflict_data,
conflict_len,
scratch_pool);
@@ -6015,14 +6020,15 @@ revert_list_read(void *baton,
SVN_ERR(svn_wc__conflict_read_markers(&b->marker_paths,
b->db, wcroot->abspath,
conflicts,
- result_pool,
+ b->result_pool,
scratch_pool));
SVN_ERR(svn_wc__conflict_read_info(NULL, NULL,
NULL, NULL, &tree_conflicted,
b->db, wcroot->abspath,
conflicts,
- result_pool, scratch_pool));
+ b->result_pool,
+ scratch_pool));
if (tree_conflicted)
*(b->reverted) = TRUE;
@@ -6078,6 +6084,9 @@ svn_wc__db_revert_list_read(svn_boolean_
b.copied_here = copied_here;
b.kind = kind;
b.result_pool = result_pool;
+#if SVN_WC__VERSION >= SVN_WC__USES_CONFLICT_SKELS
+ b.db = db;
+#endif
SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath,
db, local_abspath, scratch_pool, scratch_pool));
Modified: subversion/trunk/subversion/tests/libsvn_wc/conflict-data-test.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/libsvn_wc/conflict-data-test.c?rev=1357378&r1=1357377&r2=1357378&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/libsvn_wc/conflict-data-test.c (original)
+++ subversion/trunk/subversion/tests/libsvn_wc/conflict-data-test.c Wed Jul 4
19:48:26 2012
@@ -452,6 +452,9 @@ test_serialize_text_conflict(const svn_t
{
const apr_array_header_t *markers;
+ const char *old_their_abspath;
+ const char *their_abspath;
+ const char *mine_abspath;
SVN_ERR(svn_wc__conflict_read_markers(&markers,
sbox.wc_ctx->db, sbox.wc_abspath,
@@ -459,6 +462,22 @@ test_serialize_text_conflict(const svn_t
SVN_TEST_ASSERT(markers != NULL);
SVN_TEST_ASSERT(markers->nelts == 3);
+
+ old_their_abspath = APR_ARRAY_IDX(markers, 0, const char *);
+ mine_abspath = APR_ARRAY_IDX(markers, 1, const char *);
+ their_abspath = APR_ARRAY_IDX(markers, 2, const char *);
+
+ SVN_TEST_STRING_ASSERT(
+ svn_dirent_skip_ancestor(sbox.wc_abspath, mine_abspath),
+ "mine");
+
+ SVN_TEST_STRING_ASSERT(
+ svn_dirent_skip_ancestor(sbox.wc_abspath, old_their_abspath),
+ "old-theirs");
+
+ SVN_TEST_STRING_ASSERT(
+ svn_dirent_skip_ancestor(sbox.wc_abspath, their_abspath),
+ "theirs");
}
return SVN_NO_ERROR;