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

Re: svn commit: r940111 - in /subversion/trunk/subversion: include/private/svn_wc_private.h include/svn_wc.h libsvn_wc/node.c libsvn_wc/status.c svn/cl.h svn/status-cmd.c svn/status.c

From: Neels J Hofmeyr <neels_at_elego.de>
Date: Mon, 03 May 2010 15:07:49 +0200

dannas_at_apache.org wrote:
> Author: dannas
> Date: Sat May 1 21:06:36 2010
> New Revision: 940111
>
[...]

> (svn_cl__print_status_xml): Add ctx parameter.
>
> * subversion/svn/status.c
> (print_status): Add ctx parameter. Check status->conflicted and use wc
> funcs for fetching further information.
> svn_cl__print_status_xml,

log message error ^

> (svn_cl__print_status): Do an explicit check for tree conflicts
> instead of relying on fields in svn_wc_status3_t.
>
> * subversion/svn/status-cmd.c
> (print_status_normal_or_xml): Update callers to pass a ctx parameter.
>
> * subversion/include/svn_wc.h
> (svn_wc_status3_t): Add conflicted field.
>
> * subversion/include/private/svn_wc_private.h
> (svn_wc__node_check_conflicts): New.
>
> * subversion/libsvn_wc/status.c
> (assemble_status): Initialize status->conflicted.
>
> * subversion/libsvn_wc/node.c
> (svn_wc__node_check_conflicts): New.
>
> Modified:
> subversion/trunk/subversion/include/private/svn_wc_private.h
> subversion/trunk/subversion/include/svn_wc.h
> subversion/trunk/subversion/libsvn_wc/node.c
> subversion/trunk/subversion/libsvn_wc/status.c
> subversion/trunk/subversion/svn/cl.h
> subversion/trunk/subversion/svn/status-cmd.c
> subversion/trunk/subversion/svn/status.c
>
> Modified: subversion/trunk/subversion/include/private/svn_wc_private.h
> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/private/svn_wc_private.h?rev=940111&r1=940110&r2=940111&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/include/private/svn_wc_private.h (original)
> +++ subversion/trunk/subversion/include/private/svn_wc_private.h Sat May 1 21:06:36 2010
> @@ -598,6 +598,25 @@ svn_wc__node_is_file_external(svn_boolea
> const char *local_abspath,
> apr_pool_t *scratch_pool);
>
> +/**
> + * Check what kinds of conflicts we have on @a local_abspath.
> + *
> + * We could have returned the conflicts at once if it wasn't for the fact
> + * that there can be multiple prop conflicts.
> + *
> + * One or two of @a prop_conflicted, @a text_conflicted and @a
> + * tree_conflicted can be NULL if we're not interrested in that particular
> + * value.
> + */
> +svn_error_t *
> +svn_wc__node_check_conflicts(svn_boolean_t *prop_conflicted,
> + svn_boolean_t *text_conflicted,
> + svn_boolean_t *tree_conflicted,
> + svn_wc_context_t *wc_ctx,
> + const char *local_abspath,
> + apr_pool_t *result_pool,
> + apr_pool_t *scratch_pool);
> +
>
> /**
> * Recursively acquire write locks for @a local_abspath if
>
> Modified: subversion/trunk/subversion/include/svn_wc.h
> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_wc.h?rev=940111&r1=940110&r2=940111&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/include/svn_wc.h (original)
> +++ subversion/trunk/subversion/include/svn_wc.h Sat May 1 21:06:36 2010
> @@ -3645,6 +3645,8 @@ typedef struct svn_wc_status3_t
> /** The locally present lock creation date.
> */
> apr_time_t lock_creation_date;
> +
> + svn_boolean_t conflicted;

How about a short comment? ^
something like "TRUE if tree-, prop- and/or text-conflicted"

>
> /* NOTE! Please update svn_wc_dup_status3() when adding new fields here. */

I think you did not heed this note. ^

> } svn_wc_status3_t;
>
> Modified: subversion/trunk/subversion/libsvn_wc/node.c
> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/node.c?rev=940111&r1=940110&r2=940111&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/libsvn_wc/node.c (original)
> +++ subversion/trunk/subversion/libsvn_wc/node.c Sat May 1 21:06:36 2010
> @@ -1049,3 +1049,32 @@ svn_wc__node_is_file_external(svn_boolea
> local_abspath,
> scratch_pool));
> }
> +
> +svn_error_t *
> +svn_wc__node_check_conflicts(svn_boolean_t *prop_conflicted,
> + svn_boolean_t *text_conflicted,
> + svn_boolean_t *tree_conflicted,
> + svn_wc_context_t *wc_ctx,
> + const char *local_abspath,
> + apr_pool_t *result_pool,
> + apr_pool_t *scratch_pool)
> +{
> + const apr_array_header_t *conflicts;
> + int i;
> +
> + SVN_ERR(svn_wc__db_read_conflicts(&conflicts, wc_ctx->db, local_abspath,
> + result_pool, scratch_pool));
> +
> + for (i = 0; i < conflicts->nelts; i++)
> + {
> + svn_wc_conflict_description2_t *cd;
> + cd = APR_ARRAY_IDX(conflicts, i, svn_wc_conflict_description2_t *);
> + if (prop_conflicted && cd->kind == svn_wc_conflict_kind_property)
> + *prop_conflicted = TRUE;
> + else if (text_conflicted && cd->kind == svn_wc_conflict_kind_text)
> + *text_conflicted = TRUE;
> + else if (tree_conflicted && cd->kind == svn_wc_conflict_kind_tree)
> + *tree_conflicted = TRUE;
> + }
> + return SVN_NO_ERROR;
> +}

nice :)

>
> Modified: subversion/trunk/subversion/libsvn_wc/status.c
> URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/status.c?rev=940111&r1=940110&r2=940111&view=diff
> ==============================================================================
> --- subversion/trunk/subversion/libsvn_wc/status.c (original)
> +++ subversion/trunk/subversion/libsvn_wc/status.c Sat May 1 21:06:36 2010
> @@ -302,6 +302,7 @@ assemble_status(svn_wc_status3_t **statu
> svn_revnum_t changed_rev;
> const char *changed_author;
> apr_time_t changed_date;
> + svn_boolean_t conflicted;
> #ifdef HAVE_SYMLINK
> svn_boolean_t wc_special;
> #endif /* HAVE_SYMLINK */
> @@ -393,6 +394,7 @@ assemble_status(svn_wc_status3_t **statu
> stat->lock_owner = NULL;
> stat->lock_comment = NULL;
> stat->lock_creation_date = 0;
> + stat->conflicted = (tree_conflict != NULL);

I don't understand -- what about prop and text conflicts? Below,
->conflicted stand for all three of them.
(If this is correct, I guess it needs a comment)

[...diff truncated]

Nice cleanup!
~Neels

Received on 2010-05-03 15:08:29 CEST

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.