You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rh...@apache.org on 2012/06/27 14:46:35 UTC
svn commit: r1354470 - in /subversion/trunk/subversion: include/svn_wc.h
libsvn_wc/deprecated.c libsvn_wc/update_editor.c libsvn_wc/util.c
Author: rhuijben
Date: Wed Jun 27 12:46:34 2012
New Revision: 1354470
URL: http://svn.apache.org/viewvc?rev=1354470&view=rev
Log:
Extend svn_wc_conflict_version_t with a repos_uuid.
I would have liked to extend the tree conflict skel, but we explicitly disable
the extensibility of skels in the current tree conflict skel code. Force it to
NULL for now.
* subversion/include/svn_wc.h
(svn_wc_conflict_version_t): Store uuid and remove todo.
(svn_wc_conflict_version_create2): New function.
(svn_wc_conflict_version_create): Deprecate function.
* subversion/libsvn_wc/deprecated.c
(svn_wc_conflict_version_create): New function.
* subversion/libsvn_wc/update_editor.c
(create_tree_conflict): Provide uuid.
* subversion/libsvn_wc/util.c
(svn_wc_conflict_version_create): Rename to...
(svn_wc_conflict_version_create2): ... this and set uuid.
Modified:
subversion/trunk/subversion/include/svn_wc.h
subversion/trunk/subversion/libsvn_wc/deprecated.c
subversion/trunk/subversion/libsvn_wc/update_editor.c
subversion/trunk/subversion/libsvn_wc/util.c
Modified: subversion/trunk/subversion/include/svn_wc.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_wc.h?rev=1354470&r1=1354469&r2=1354470&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_wc.h (original)
+++ subversion/trunk/subversion/include/svn_wc.h Wed Jun 27 12:46:34 2012
@@ -1649,14 +1649,17 @@ typedef struct svn_wc_conflict_version_t
svn_revnum_t peg_rev;
/** path within repos; must not start with '/' */
+ /* ### should have been called repos_relpath, but we can't change this. */
const char *path_in_repos;
- /* @todo We may decide to add the repository UUID, to handle conflicts
- * properly during a repository move. */
/** @} */
/** Info about this node */
svn_node_kind_t node_kind; /* note that 'none' is a legitimate value */
+ /** UUID of the repository
+ * @since New in 1.8. */
+ const char *repos_uuid;
+
/* @todo Add metadata about a local copy of the node, if and when
* we store one. */
@@ -1673,8 +1676,23 @@ typedef struct svn_wc_conflict_version_t
* @a peg_rev and the the @c node_kind to @c node_kind. Make only shallow
* copies of the pointer arguments.
*
+ * @since New in 1.8.
+ */
+svn_wc_conflict_version_t *
+svn_wc_conflict_version_create2(const char *repos_root_url,
+ const char *repos_uuid,
+ const char *repos_relpath,
+ svn_revnum_t revision,
+ svn_node_kind_t kind,
+ apr_pool_t *result_pool);
+
+/** Similar to svn_wc_conflict_version_create2(), but doesn't set all
+ * required values.
+ *
* @since New in 1.6.
+ * @deprecated Provided for backward compatibility with the 1.7 API.
*/
+SVN_DEPRECATED
svn_wc_conflict_version_t *
svn_wc_conflict_version_create(const char *repos_url,
const char *path_in_repos,
Modified: subversion/trunk/subversion/libsvn_wc/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/deprecated.c?rev=1354470&r1=1354469&r2=1354470&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/deprecated.c (original)
+++ subversion/trunk/subversion/libsvn_wc/deprecated.c Wed Jun 27 12:46:34 2012
@@ -4329,6 +4329,17 @@ svn_wc_merge(const char *left,
/*** From util.c ***/
+svn_wc_conflict_version_t *
+svn_wc_conflict_version_create(const char *repos_url,
+ const char *path_in_repos,
+ svn_revnum_t peg_rev,
+ svn_node_kind_t node_kind,
+ apr_pool_t *pool)
+{
+ return svn_wc_conflict_version_create2(repos_url, NULL, path_in_repos,
+ peg_rev, node_kind, pool);
+}
+
svn_wc_conflict_description_t *
svn_wc_conflict_description_create_text(const char *path,
svn_wc_adm_access_t *adm_access,
Modified: subversion/trunk/subversion/libsvn_wc/update_editor.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/update_editor.c?rev=1354470&r1=1354469&r2=1354470&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/update_editor.c (original)
+++ subversion/trunk/subversion/libsvn_wc/update_editor.c Wed Jun 27 12:46:34 2012
@@ -1302,6 +1302,7 @@ create_tree_conflict(svn_wc_conflict_des
apr_pool_t *result_pool, apr_pool_t *scratch_pool)
{
const char *repos_root_url = NULL;
+ const char *repos_uuid = NULL;
const char *left_repos_relpath;
svn_revnum_t left_revision;
svn_node_kind_t left_kind;
@@ -1348,7 +1349,8 @@ create_tree_conflict(svn_wc_conflict_des
SVN_ERR(svn_wc__db_scan_addition(&added_status, NULL,
&added_repos_relpath,
&repos_root_url,
- NULL, NULL, NULL, NULL, NULL, NULL,
+ &repos_uuid,
+ NULL, NULL, NULL, NULL, NULL,
NULL, eb->db, local_abspath,
result_pool, scratch_pool));
@@ -1365,6 +1367,7 @@ create_tree_conflict(svn_wc_conflict_des
left_revision = SVN_INVALID_REVNUM;
left_repos_relpath = NULL;
repos_root_url = eb->repos_root;
+ repos_uuid = eb->repos_uuid;
}
else
{
@@ -1384,12 +1387,11 @@ create_tree_conflict(svn_wc_conflict_des
&left_revision,
&left_repos_relpath,
&repos_root_url,
- NULL, NULL, NULL, NULL, NULL, NULL,
+ &repos_uuid,
+ NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL,
- eb->db,
- local_abspath,
- result_pool,
- scratch_pool));
+ eb->db, local_abspath,
+ result_pool, scratch_pool));
/* Translate the node kind. */
if (base_kind == svn_kind_file
|| base_kind == svn_kind_symlink)
@@ -1441,18 +1443,20 @@ create_tree_conflict(svn_wc_conflict_des
* Send an 'empty' left revision. */
src_left_version = NULL;
else
- src_left_version = svn_wc_conflict_version_create(repos_root_url,
- left_repos_relpath,
- left_revision,
- left_kind,
+ src_left_version = svn_wc_conflict_version_create2(repos_root_url,
+ repos_uuid,
+ left_repos_relpath,
+ left_revision,
+ left_kind,
+ result_pool);
+
+ src_right_version = svn_wc_conflict_version_create2(repos_root_url,
+ repos_uuid,
+ right_repos_relpath,
+ *eb->target_revision,
+ their_node_kind,
result_pool);
- src_right_version = svn_wc_conflict_version_create(repos_root_url,
- right_repos_relpath,
- *eb->target_revision,
- their_node_kind,
- result_pool);
-
*pconflict = svn_wc_conflict_description_create_tree2(
local_abspath, conflict_node_kind,
eb->switch_relpath ?
Modified: subversion/trunk/subversion/libsvn_wc/util.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/util.c?rev=1354470&r1=1354469&r2=1354470&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/util.c (original)
+++ subversion/trunk/subversion/libsvn_wc/util.c Wed Jun 27 12:46:34 2012
@@ -285,24 +285,27 @@ svn_wc__conflict_description2_dup(const
}
svn_wc_conflict_version_t *
-svn_wc_conflict_version_create(const char *repos_url,
- const char *path_in_repos,
- svn_revnum_t peg_rev,
- svn_node_kind_t node_kind,
- apr_pool_t *pool)
+svn_wc_conflict_version_create2(const char *repos_url,
+ const char *repos_uuid,
+ const char *repos_relpath,
+ svn_revnum_t revision,
+ svn_node_kind_t kind,
+ apr_pool_t *result_pool)
{
svn_wc_conflict_version_t *version;
- version = apr_pcalloc(pool, sizeof(*version));
+ version = apr_pcalloc(result_pool, sizeof(*version));
- SVN_ERR_ASSERT_NO_RETURN(svn_uri_is_canonical(repos_url, pool) &&
- svn_relpath_is_canonical(path_in_repos) &&
- SVN_IS_VALID_REVNUM(peg_rev));
+ SVN_ERR_ASSERT_NO_RETURN(svn_uri_is_canonical(repos_url, result_pool)
+ && svn_relpath_is_canonical(repos_relpath)
+ && SVN_IS_VALID_REVNUM(revision)
+ /* ### repos_uuid can be NULL :( */);
version->repos_url = repos_url;
- version->peg_rev = peg_rev;
- version->path_in_repos = path_in_repos;
- version->node_kind = node_kind;
+ version->peg_rev = revision;
+ version->path_in_repos = repos_relpath;
+ version->node_kind = kind;
+ version->repos_uuid = repos_uuid;
return version;
}
@@ -310,7 +313,7 @@ svn_wc_conflict_version_create(const cha
svn_wc_conflict_version_t *
svn_wc_conflict_version_dup(const svn_wc_conflict_version_t *version,
- apr_pool_t *pool)
+ apr_pool_t *result_pool)
{
svn_wc_conflict_version_t *new_version;
@@ -318,16 +321,20 @@ svn_wc_conflict_version_dup(const svn_wc
if (version == NULL)
return NULL;
- new_version = apr_pcalloc(pool, sizeof(*new_version));
+ new_version = apr_pcalloc(result_pool, sizeof(*new_version));
/* Shallow copy all members. */
*new_version = *version;
if (version->repos_url)
- new_version->repos_url = apr_pstrdup(pool, version->repos_url);
+ new_version->repos_url = apr_pstrdup(result_pool, version->repos_url);
if (version->path_in_repos)
- new_version->path_in_repos = apr_pstrdup(pool, version->path_in_repos);
+ new_version->path_in_repos = apr_pstrdup(result_pool,
+ version->path_in_repos);
+
+ if (version->repos_uuid)
+ new_version->repos_uuid = apr_pstrdup(result_pool, version->repos_uuid);
return new_version;
}