[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r34326 - in branches/tc_url_rev/subversion: include include/private libsvn_client libsvn_wc svn

From: Neels J Hofmeyr <neels_at_elego.de>
Date: Sun, 23 Nov 2008 03:44:21 +0100

Hey Stefan,

you broke use of your own change in
svn_wc_conflict_description_create_tree() with this commit, causing a
segfault. See inline...

stsp_at_tigris.org wrote:
> Author: stsp
> Date: Fri Nov 21 15:45:55 2008
> New Revision: 34326
>
> Log:
> On the tc_url_rev branch:
>
> Resolve conflicts from merge with trunk.
> This commit is rather large for a 'resolve' commit, but catching
> up with progress made on trunk made quite a few changes neccessary.
>
> * subversion/svn/cl.h
> (svn_cl__node_description): Declare.
>
> * subversion/svn/util.c
> (svn_cl__node_description): Moved here from ....
>
> * subversion/svn/tree-conflicts.c
> (node_description): ... here and unstaticed, so we can
> call it from another file. No functional changes.
>
> (svn_cl__get_human_readable_tree_conflict_description):
> Resolve conflicts with trunk. This function cannot add the
> URL_at_rev information directly to the description anymore,
> because the description is now also used in 'svn status'.
>
> * subversion/svn/info-cmd.c
> (print_info): Print URL_at_rev information here.
>
> * subversion/include/svn_wc.h
> (svn_wc_conflict_version_t): Sync typedef with actual
> struct name (this was probably a typo). Add comment
> reminding people to update svn_wc__conflict_version_dup()
> when adding members to this struct.
> Make older_version and their_version membes pointers,
> for more straightforward handling in svn_wc__conflict_description_dup().
> (svn_wc_conflict_description_create_tree): Adjust docstring for new
> parameters (see below).
>
> * subversion/include/private/svn_wc_private.h
> (svn_wc__conflict_version_dup): Declare.
>
> * subversion/libsvn_wc/util.c
> (svn_wc_conflict_description_create_tree): Add older_version and
> their_version parameters, allowing callers to initialise these
> members when calling this function.
> (svn_wc__conflict_description_dup): Make a deep copy of older_version
> and their_version members.
> (svn_wc__conflict_version_dup): New function to make a deep copy of
> an svn_wc_conflict_version_t object.
>
> * subversion/libsvn_wc/update_editor.c
> (check_tree_conflict): Track above changes.
>
> * subversion/libsvn_wc/tree_conflicts.c
> (read_one_tree_conflict): Track above changes.
>
> * subversion/libsvn_client/merge.c
> (tree_conflict): Track above changes.
>
> Modified:
> branches/tc_url_rev/subversion/include/private/svn_wc_private.h
> branches/tc_url_rev/subversion/include/svn_wc.h
> branches/tc_url_rev/subversion/libsvn_client/merge.c
> branches/tc_url_rev/subversion/libsvn_wc/tree_conflicts.c
> branches/tc_url_rev/subversion/libsvn_wc/update_editor.c
> branches/tc_url_rev/subversion/libsvn_wc/util.c
> branches/tc_url_rev/subversion/svn/cl.h
> branches/tc_url_rev/subversion/svn/info-cmd.c
> branches/tc_url_rev/subversion/svn/tree-conflicts.c
> branches/tc_url_rev/subversion/svn/util.c
>
> Modified: branches/tc_url_rev/subversion/include/private/svn_wc_private.h
> URL: http://svn.collab.net/viewvc/svn/branches/tc_url_rev/subversion/include/private/svn_wc_private.h?pathrev=34326&r1=34325&r2=34326
> ==============================================================================
> --- branches/tc_url_rev/subversion/include/private/svn_wc_private.h Fri Nov 21 14:25:54 2008 (r34325)
> +++ branches/tc_url_rev/subversion/include/private/svn_wc_private.h Fri Nov 21 15:45:55 2008 (r34326)
> @@ -227,6 +227,15 @@ svn_wc_conflict_description_t *
> svn_wc__conflict_description_dup(const svn_wc_conflict_description_t *conflict,
> apr_pool_t *pool);
>
> +/** Return a duplicate of @a version, allocated in @a pool.
> + * No part of the new version will be shared with @a version.
> + *
> + * @since New in 1.6.
> + */
> +svn_wc_conflict_version_t *
> +svn_wc__conflict_version_dup(const svn_wc_conflict_version_t *version,
> + apr_pool_t *pool);
> +
> #ifdef __cplusplus
> }
> #endif /* __cplusplus */
>
> Modified: branches/tc_url_rev/subversion/include/svn_wc.h
> URL: http://svn.collab.net/viewvc/svn/branches/tc_url_rev/subversion/include/svn_wc.h?pathrev=34326&r1=34325&r2=34326
> ==============================================================================
> --- branches/tc_url_rev/subversion/include/svn_wc.h Fri Nov 21 14:25:54 2008 (r34325)
> +++ branches/tc_url_rev/subversion/include/svn_wc.h Fri Nov 21 15:45:55 2008 (r34326)
> @@ -1171,7 +1171,7 @@ typedef enum svn_wc_operation_t
> /** Info about one of the conflicting versions of a node. Each field may
> * have its respective null/invalid/unknown value if the corresponding
> * information is not relevant or not available. */
> -typedef struct svn_wc_conflict_node_version_t
> +typedef struct svn_wc_conflict_version_t
> {
> /* Where to find this node version in a repository */
> const char *repos_url; /* URL of repository root */
> @@ -1186,6 +1186,9 @@ typedef struct svn_wc_conflict_node_vers
> /* Where to find a local copy of the node */
> /* const char *content_cache_path; */
> /* const char *props_cache_path; */
> +
> + /* Remember to update svn_wc__conflict_version_dup()
> + * in case you add fields to this struct. */
> } svn_wc_conflict_version_t;
>
>
> @@ -1280,19 +1283,16 @@ typedef struct svn_wc_conflict_descripti
> */
> svn_wc_operation_t operation;
>
> -<<<<<<< .working
> /** Info on the "merge-left source" or "older" version of incoming change.
> * @since New in 1.6. */
> - svn_wc_conflict_version_t older_version;
> + svn_wc_conflict_version_t *older_version;
>
> /** Info on the "merge-right source" or "their" version of incoming change.
> * @since New in 1.6. */
> - svn_wc_conflict_version_t their_version;
> + svn_wc_conflict_version_t *their_version;
>
> -=======
> /* Remember to adjust svn_wc__conflict_description_dup()
> * if you add new fields to this struct. */
> ->>>>>>> .merge-right.r34324
> } svn_wc_conflict_description_t;
>
> /**
> @@ -1344,9 +1344,10 @@ svn_wc_conflict_description_create_prop(
> *
> * Set the @c path field of the created struct to @a path, the @c access
> * field to @a adm_access, the @c kind field to @c
> - * svn_wc_conflict_kind_tree, the @c node_kind to @a node_kind, and the @c
> - * operation to @a operation. Make only shallow copies of the pointer
> - * arguments.
> + * svn_wc_conflict_kind_tree, the @c node_kind to @a node_kind, the @c
> + * operation to @a operation, the @c older_version field to @a older_version,
> + * and the @c their_version field to @a their_version.
> + * Make only shallow copies of the pointer arguments.
> *
> * @note: It is the caller's responsibility to set the other required fields
> * (such as the four file names and @c action and @c reason).
> @@ -1358,6 +1359,8 @@ svn_wc_conflict_description_create_tree(
> svn_wc_adm_access_t *adm_access,
> svn_node_kind_t node_kind,
> svn_wc_operation_t operation,
> + svn_wc_conflict_version_t *older_version,
> + svn_wc_conflict_version_t *their_version,
> apr_pool_t *pool);
>
>
>
> Modified: branches/tc_url_rev/subversion/libsvn_client/merge.c
> URL: http://svn.collab.net/viewvc/svn/branches/tc_url_rev/subversion/libsvn_client/merge.c?pathrev=34326&r1=34325&r2=34326
> ==============================================================================
> --- branches/tc_url_rev/subversion/libsvn_client/merge.c Fri Nov 21 14:25:54 2008 (r34325)
> +++ branches/tc_url_rev/subversion/libsvn_client/merge.c Fri Nov 21 15:45:55 2008 (r34326)
> @@ -350,26 +350,27 @@ tree_conflict(merge_cmd_baton_t *merge_b
> return SVN_NO_ERROR;
>
> conflict = svn_wc_conflict_description_create_tree(
> - victim_path, adm_access, node_kind, svn_wc_operation_merge, merge_b->pool);
> + victim_path, adm_access, node_kind, svn_wc_operation_merge,
> + NULL, NULL, merge_b->pool);

See, here you pass NULL for both OLDER_VERSION and THEIR_VERSION...

> conflict->action = action;
> conflict->reason = reason;
>
> SVN_ERR(svn_ra_get_repos_root2(merge_b->ra_session1, &src_repos_url,
> merge_b->pool));
>
> - conflict->older_version.repos_url = src_repos_url;
> - conflict->older_version.peg_rev = merge_b->merge_source.rev1;
> - conflict->older_version.path_in_repos
> + conflict->older_version->repos_url = src_repos_url;
> + conflict->older_version->peg_rev = merge_b->merge_source.rev1;
> + conflict->older_version->path_in_repos
> = svn_path_is_child(src_repos_url, merge_b->merge_source.url1,
> merge_b->pool);
> - conflict->older_version.node_kind = node_kind;
> + conflict->older_version->node_kind = node_kind;
>
> - conflict->their_version.repos_url = src_repos_url;
> - conflict->their_version.peg_rev = merge_b->merge_source.rev2;
> - conflict->their_version.path_in_repos
> + conflict->their_version->repos_url = src_repos_url;
> + conflict->their_version->peg_rev = merge_b->merge_source.rev2;
> + conflict->their_version->path_in_repos
> = svn_path_is_child(src_repos_url, merge_b->merge_source.url2,
> merge_b->pool);
> - conflict->their_version.node_kind = node_kind;
> + conflict->their_version->node_kind = node_kind;

...and here you're setting values in them without creating the struct memory.

Say, why is it necessary to

 1. be able to set OLDER_ and THEIR_VERSION during
svn_wc_conflict_description_create_tree()?

 2. have them as pointers in the conflict description? I think this
introduces new errors that aren't necessary, like this one :P

Bert Hujiben already sets these to NULL in a new patch, when none of the
handling code can cope with them being NULL. If you want to keep it this
way, we need to go around and add checking for NULL everywhere. :(

I think having this as a pointer adds loads of ugly checking to the code
while yielding only tiny benefits. +1 for changing back to inlining the
svn_wc_version_t into the svn_wc_conflict_t struct.

I'll try fix this segfault for now so I can use the branch.

~Neels

>
> SVN_ERR(svn_wc__add_tree_conflict(conflict, adm_access, merge_b->pool));
> return SVN_NO_ERROR;
>
> Modified: branches/tc_url_rev/subversion/libsvn_wc/tree_conflicts.c
> URL: http://svn.collab.net/viewvc/svn/branches/tc_url_rev/subversion/libsvn_wc/tree_conflicts.c?pathrev=34326&r1=34325&r2=34326
> ==============================================================================
> --- branches/tc_url_rev/subversion/libsvn_wc/tree_conflicts.c Fri Nov 21 14:25:54 2008 (r34325)
> +++ branches/tc_url_rev/subversion/libsvn_wc/tree_conflicts.c Fri Nov 21 15:45:55 2008 (r34326)
> @@ -270,6 +270,8 @@ read_one_tree_conflict(svn_wc_conflict_d
> const char *victim_basename;
> svn_node_kind_t node_kind;
> svn_wc_operation_t operation;
> + svn_wc_conflict_version_t *older_version;
> + svn_wc_conflict_version_t *their_version;
> int n;
>
> SVN_ERR_ASSERT(*start < end);
> @@ -298,9 +300,11 @@ read_one_tree_conflict(svn_wc_conflict_d
> SVN_ERR(read_field_separator(start, end));
>
> /* Construct the description object */
> + older_version = apr_pcalloc(pool, sizeof(*older_version));
> + their_version = apr_pcalloc(pool, sizeof(*their_version));
> *conflict = svn_wc_conflict_description_create_tree(
> svn_path_join(dir_path, victim_basename, pool),
> - NULL, node_kind, operation, pool);
> + NULL, node_kind, operation, older_version, their_version, pool);
>
> /* action */
> SVN_ERR(read_enum_field(&n, action_map, start, end, pool));
> @@ -313,12 +317,12 @@ read_one_tree_conflict(svn_wc_conflict_d
> SVN_ERR(read_field_separator(start, end));
>
> /* older_version */
> - SVN_ERR(read_node_version_info(&(*conflict)->older_version, start, end,
> + SVN_ERR(read_node_version_info((*conflict)->older_version, start, end,
> pool));
> SVN_ERR(read_field_separator(start, end));
>
> /* their_version */
> - SVN_ERR(read_node_version_info(&(*conflict)->their_version, start, end,
> + SVN_ERR(read_node_version_info((*conflict)->their_version, start, end,
> pool));
>
> return SVN_NO_ERROR;
> @@ -478,12 +482,12 @@ svn_wc__write_tree_conflicts(char **conf
> svn_stringbuf_appendbytes(buf, &field_separator, 1);
>
> /* older_version */
> - SVN_ERR(write_node_version_info(buf, &conflict->older_version, pool));
> + SVN_ERR(write_node_version_info(buf, conflict->older_version, pool));
>
> svn_stringbuf_appendbytes(buf, &field_separator, 1);
>
> /* their_version */
> - SVN_ERR(write_node_version_info(buf, &conflict->their_version, pool));
> + SVN_ERR(write_node_version_info(buf, conflict->their_version, pool));
>
> if (i < (conflicts->nelts - 1))
> svn_stringbuf_appendbytes(buf, &desc_separator, 1);
>
> Modified: branches/tc_url_rev/subversion/libsvn_wc/update_editor.c
> URL: http://svn.collab.net/viewvc/svn/branches/tc_url_rev/subversion/libsvn_wc/update_editor.c?pathrev=34326&r1=34325&r2=34326
> ==============================================================================
> --- branches/tc_url_rev/subversion/libsvn_wc/update_editor.c Fri Nov 21 14:25:54 2008 (r34325)
> +++ branches/tc_url_rev/subversion/libsvn_wc/update_editor.c Fri Nov 21 15:45:55 2008 (r34326)
> @@ -1463,32 +1463,15 @@ check_tree_conflict(svn_wc_conflict_desc
> if (reason != (svn_wc_conflict_reason_t)(-1))
> {
> svn_wc_conflict_description_t *conflict;
> + svn_wc_conflict_version_t *older_version;
> + svn_wc_conflict_version_t *their_version;
> const char *repos_url = NULL;
> const char *path_in_repos = NULL;
>
> - conflict = svn_wc_conflict_description_create_tree(
> - full_path, parent_adm_access, entry->kind,
> - eb->switch_url ? svn_wc_operation_switch : svn_wc_operation_update,
> - pool);
> - conflict->action = action;
> - conflict->reason = reason;
> -
> repos_url = entry->repos;
> path_in_repos = svn_path_is_child(repos_url, entry->url, pool);
> if (path_in_repos == NULL)
> path_in_repos = ".";
> -
> - conflict->older_version.repos_url = repos_url;
> - conflict->older_version.peg_rev = entry->revision;
> - conflict->older_version.path_in_repos = path_in_repos;
> - conflict->older_version.node_kind =
> - (entry->schedule == svn_wc_schedule_delete) ? svn_node_none
> - : entry->kind;
> - /* entry->kind is both base kind and working kind, because schedule
> - * replace-by-different-kind is not supported. */
> - /* ### TODO: but in case the entry is locally removed, entry->kind
> - * is svn_node_none and doesn't reflect the older kind. */
> -
> /* "Their" repos_url (repository root URL) will be the same. */
>
> if (eb->switch_url != NULL)
> @@ -1508,10 +1491,30 @@ check_tree_conflict(svn_wc_conflict_desc
> }
> }
>
> - conflict->their_version.repos_url = repos_url;
> - conflict->their_version.peg_rev = *eb->target_revision;
> - conflict->their_version.path_in_repos = path_in_repos;
> - conflict->their_version.node_kind = their_node_kind;
> + older_version = apr_pcalloc(pool, sizeof(*older_version));
> + older_version->repos_url = repos_url;
> + older_version->peg_rev = entry->revision;
> + older_version->path_in_repos = path_in_repos;
> + older_version->node_kind =
> + (entry->schedule == svn_wc_schedule_delete) ? svn_node_none
> + : entry->kind;
> + /* entry->kind is both base kind and working kind, because schedule
> + * replace-by-different-kind is not supported. */
> + /* ### TODO: but in case the entry is locally removed, entry->kind
> + * is svn_node_none and doesn't reflect the older kind. */
> +
> + their_version = apr_pcalloc(pool, sizeof(*older_version));
> + their_version->repos_url = repos_url;
> + their_version->peg_rev = *eb->target_revision;
> + their_version->path_in_repos = path_in_repos;
> + their_version->node_kind = their_node_kind;
> +
> + conflict = svn_wc_conflict_description_create_tree(
> + full_path, parent_adm_access, entry->kind,
> + eb->switch_url ? svn_wc_operation_switch : svn_wc_operation_update,
> + older_version, their_version, pool);
> + conflict->action = action;
> + conflict->reason = reason;
>
> /* Ensure 'log_accum' is non-null. svn_wc__loggy_add_tree_conflict()
> * would otherwise quietly set it to point to a newly allocated buffer
>
> Modified: branches/tc_url_rev/subversion/libsvn_wc/util.c
> URL: http://svn.collab.net/viewvc/svn/branches/tc_url_rev/subversion/libsvn_wc/util.c?pathrev=34326&r1=34325&r2=34326
> ==============================================================================
> --- branches/tc_url_rev/subversion/libsvn_wc/util.c Fri Nov 21 14:25:54 2008 (r34325)
> +++ branches/tc_url_rev/subversion/libsvn_wc/util.c Fri Nov 21 15:45:55 2008 (r34326)
> @@ -333,6 +333,8 @@ svn_wc_conflict_description_create_tree(
> svn_wc_adm_access_t *adm_access,
> svn_node_kind_t node_kind,
> svn_wc_operation_t operation,
> + svn_wc_conflict_version_t *older_version,
> + svn_wc_conflict_version_t *their_version,
> apr_pool_t *pool)
> {
> svn_wc_conflict_description_t *conflict;
> @@ -343,6 +345,8 @@ svn_wc_conflict_description_create_tree(
> conflict->kind = svn_wc_conflict_kind_tree;
> conflict->access = adm_access;
> conflict->operation = operation;
> + conflict->older_version = older_version;
> + conflict->their_version = their_version;
> return conflict;
> }
>
> @@ -372,6 +376,33 @@ svn_wc__conflict_description_dup(const s
> new_conflict->my_file = apr_pstrdup(pool, conflict->my_file);
> if (conflict->merged_file)
> new_conflict->merged_file = apr_pstrdup(pool, conflict->merged_file);
> + if (conflict->older_version)
> + new_conflict->older_version =
> + svn_wc__conflict_version_dup(conflict->older_version, pool);
> + if (conflict->their_version)
> + new_conflict->their_version =
> + svn_wc__conflict_version_dup(conflict->their_version, pool);
>
> return new_conflict;
> }
> +
> +svn_wc_conflict_version_t *
> +svn_wc__conflict_version_dup(const svn_wc_conflict_version_t *version,
> + apr_pool_t *pool)
> +{
> +
> + svn_wc_conflict_version_t *new_version;
> +
> + new_version = apr_pcalloc(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);
> +
> + if (version->path_in_repos)
> + new_version->path_in_repos = apr_pstrdup(pool, version->path_in_repos);
> +
> + return new_version;
> +}
>
> Modified: branches/tc_url_rev/subversion/svn/cl.h
> URL: http://svn.collab.net/viewvc/svn/branches/tc_url_rev/subversion/svn/cl.h?pathrev=34326&r1=34325&r2=34326
> ==============================================================================
> --- branches/tc_url_rev/subversion/svn/cl.h Fri Nov 21 14:25:54 2008 (r34325)
> +++ branches/tc_url_rev/subversion/svn/cl.h Fri Nov 21 15:45:55 2008 (r34326)
> @@ -638,6 +638,13 @@ svn_cl__indent_string(const char *str,
> const char *indent,
> apr_pool_t *pool);
>
> +
> +/* Return a string showing NODE's kind, URL and revision, to the extent that
> + * that information is available in NODE. */
> +const char *
> +svn_cl__node_description(const svn_wc_conflict_version_t *node,
> + apr_pool_t *pool);
> +
> #ifdef __cplusplus
> }
> #endif /* __cplusplus */
>
> Modified: branches/tc_url_rev/subversion/svn/info-cmd.c
> URL: http://svn.collab.net/viewvc/svn/branches/tc_url_rev/subversion/svn/info-cmd.c?pathrev=34326&r1=34325&r2=34326
> ==============================================================================
> --- branches/tc_url_rev/subversion/svn/info-cmd.c Fri Nov 21 14:25:54 2008 (r34325)
> +++ branches/tc_url_rev/subversion/svn/info-cmd.c Fri Nov 21 15:45:55 2008 (r34326)
> @@ -431,10 +431,20 @@ print_info(void *baton,
>
> if (info->tree_conflict)
> {
> - const char *desc;
> + const char *desc, *incoming_version, *local_version;
> +
> SVN_ERR(svn_cl__get_human_readable_tree_conflict_description(
> &desc, info->tree_conflict, pool));
> - svn_cmdline_printf(pool, _("Tree conflict: %s"), desc);
> + incoming_version =
> + svn_cl__node_description(info->tree_conflict->their_version, pool);
> + local_version =
> + svn_cl__node_description(info->tree_conflict->older_version, pool);
> +
> + svn_cmdline_printf(pool,
> + _("Tree conflict: %s\n"
> + " incoming version: %s\n"
> + " local version: %s"),
> + desc, incoming_version, local_version);
> }
>
> /* Print extra newline separator. */
>
> Modified: branches/tc_url_rev/subversion/svn/tree-conflicts.c
> URL: http://svn.collab.net/viewvc/svn/branches/tc_url_rev/subversion/svn/tree-conflicts.c?pathrev=34326&r1=34325&r2=34326
> ==============================================================================
> --- branches/tc_url_rev/subversion/svn/tree-conflicts.c Fri Nov 21 14:25:54 2008 (r34325)
> +++ branches/tc_url_rev/subversion/svn/tree-conflicts.c Fri Nov 21 15:45:55 2008 (r34326)
> @@ -62,74 +62,18 @@ select_reason(const svn_wc_conflict_desc
> return NULL;
> }
>
> -/* Return a string showing NODE's kind, URL and revision, to the extent that
> - * that information is available in NODE. */
> -static const char *
> -node_description(const svn_wc_conflict_version_t *node,
> - apr_pool_t *pool)
> -{
> - const char *url_str;
> -
> - /* Construct the whole URL if we can, else use whatever we have. */
> - if (node->repos_url && node->path_in_repos)
> - url_str = svn_path_url_add_component(node->repos_url,
> - node->path_in_repos, pool);
> - else if (node->repos_url)
> - url_str = svn_path_url_add_component(node->repos_url, "...", pool);
> - else if (node->path_in_repos)
> - url_str = node->path_in_repos;
> - else
> - url_str = "...";
> -
> - return apr_psprintf(pool, "(%s) %s@%ld",
> - svn_cl__node_kind_str(node->node_kind),
> - url_str, node->peg_rev);
> -}
> -
> svn_error_t *
> svn_cl__get_human_readable_tree_conflict_description(
> const char **desc,
> const svn_wc_conflict_description_t *conflict,
> apr_pool_t *pool)
> {
> -<<<<<<< .working
> - const char *victim_name, *their_phrase, *our_phrase;
> - svn_stringbuf_t *their_phrase_with_victim, *our_phrase_with_victim;
> - struct tree_conflict_phrases *phrases = new_tree_conflict_phrases(pool);
> - const char *str;
> -
> -=======
> const char *victim_name, *action, *reason;
> ->>>>>>> .merge-right.r34324
> victim_name = svn_path_basename(conflict->path, pool);
> -<<<<<<< .working
> - their_phrase = select_their_phrase(conflict, phrases);
> - our_phrase = select_our_phrase(conflict, phrases);
> - SVN_ERR_ASSERT(our_phrase && their_phrase);
> -
> - /* Substitute the '%s' format in the phrases with the victim path. */
> - their_phrase_with_victim = svn_stringbuf_createf(pool, their_phrase,
> - victim_name);
> - our_phrase_with_victim = svn_stringbuf_createf(pool, our_phrase,
> - victim_name);
> -
> - svn_stringbuf_appendstr(descriptions, their_phrase_with_victim);
> - svn_stringbuf_appendstr(descriptions, our_phrase_with_victim);
> -
> -=======
> action = select_action(conflict);
> reason = select_reason(conflict);
> SVN_ERR_ASSERT(action && reason);
> *desc = apr_psprintf(pool, _("incoming %s, local %s"), action, reason);
> ->>>>>>> .merge-right.r34324
> - str = apr_psprintf(pool, _(" Older version: %s\n"),
> - node_description(&conflict->older_version, pool));
> - svn_stringbuf_appendcstr(descriptions, str);
> -
> - str = apr_psprintf(pool, _(" Their version: %s\n"),
> - node_description(&conflict->their_version, pool));
> - svn_stringbuf_appendcstr(descriptions, str);
> -
> return SVN_NO_ERROR;
> }
>
>
> Modified: branches/tc_url_rev/subversion/svn/util.c
> URL: http://svn.collab.net/viewvc/svn/branches/tc_url_rev/subversion/svn/util.c?pathrev=34326&r1=34325&r2=34326
> ==============================================================================
> --- branches/tc_url_rev/subversion/svn/util.c Fri Nov 21 14:25:54 2008 (r34325)
> +++ branches/tc_url_rev/subversion/svn/util.c Fri Nov 21 15:45:55 2008 (r34326)
> @@ -1173,3 +1173,26 @@ svn_cl__indent_string(const char *str,
> }
> return out->data;
> }
> +
> +const char *
> +svn_cl__node_description(const svn_wc_conflict_version_t *node,
> + apr_pool_t *pool)
> +{
> + const char *url_str;
> +
> + /* Construct the whole URL if we can, else use whatever we have. */
> + if (node->repos_url && node->path_in_repos)
> + url_str = svn_path_url_add_component(node->repos_url,
> + node->path_in_repos, pool);
> + else if (node->repos_url)
> + url_str = svn_path_url_add_component(node->repos_url, "...", pool);
> + else if (node->path_in_repos)
> + url_str = node->path_in_repos;
> + else
> + url_str = "...";
> +
> + return apr_psprintf(pool, "(%s) %s@%ld",
> + svn_cl__node_kind_str(node->node_kind),
> + url_str, node->peg_rev);
> +}
> +
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: svn-unsubscribe_at_subversion.tigris.org
> For additional commands, e-mail: svn-help_at_subversion.tigris.org
>

Received on 2008-11-23 03:44:50 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.