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

need feedback (was: Re: svn commit: rev 872 - trunk/subversion/libsvn_wc)

From: Greg Stein <gstein_at_lyra.org>
Date: 2002-01-14 15:46:06 CET

That change to wcprop_list needs some comment. When fetching properties, do
we want to be strict about the file existing or not? In other words, should
it be an error condition, or should a property "just not exist"? Should we
even look for the WC file, or just go straight to the props?

In my change below, I just nuked the tests for the WC file and went straight
to props. If those don't exist, it isn't an error -- the function exits
gracefully with an empty prop list.

But what behavior do we _really_ want here?

Cheers,
-g

On Mon, Jan 14, 2002 at 08:30:30AM -0600, gstein@tigris.org wrote:
> Author: gstein
> Date: 2002-01-14 14:30 GMT
> New Revision: 872
>
> Modified:
> trunk/subversion/libsvn_wc/props.c
> Log:
> Fix some problems in the wcprop fetching code.
>
> * libsvn_wc/props.c (wcprop_list): the prop fetching code should not care
> whether the working copy file truly exists or not. or, at a minimum,
> should just state that "no properties" exist if the WC file isn't
> there.
> [some design/intent input needed here]
> (svn_wc__wcprop_get): watch out for undefined properties. set the output
> to NULL for these.
>
>
> Modified: trunk/subversion/libsvn_wc/props.c
> ==============================================================================
> --- OLD/trunk/subversion/libsvn_wc/props.c Mon Jan 14 08:30:29 2002
> +++ NEW/trunk/subversion/libsvn_wc/props.c Mon Jan 14 08:30:29 2002
> @@ -766,6 +766,7 @@
> /* Check validity of PATH */
> SVN_ERR( svn_io_check_path (pathbuf, &kind, pool) );
>
> +#if 0
> if (kind == svn_node_none)
> return svn_error_createf (SVN_ERR_BAD_FILENAME, 0, NULL, pool,
> "wcprop_list: non-existent path '%s'.",
> @@ -775,6 +776,7 @@
> return svn_error_createf (SVN_ERR_UNKNOWN_NODE_KIND, 0, NULL, pool,
> "wcprop_list: unknown node kind: '%s'.",
> path);
> +#endif
>
> /* Construct a path to the relevant property file */
> SVN_ERR( svn_wc__wcprop_path (&prop_path, pathbuf, 0, pool) );
> @@ -815,9 +817,16 @@
>
> /* ### it would be nice if the hash contained svn_string_t values */
> pvaluebuf = apr_hash_get (prophash, name, APR_HASH_KEY_STRING);
> - *value = pvalue = apr_palloc(pool, sizeof(*pvalue));
> - pvalue->data = pvaluebuf->data;
> - pvalue->len = pvaluebuf->len;
> + if (pvaluebuf == NULL)
> + {
> + *value = NULL;
> + }
> + else
> + {
> + *value = pvalue = apr_palloc(pool, sizeof(*pvalue));
> + pvalue->data = pvaluebuf->data;
> + pvalue->len = pvaluebuf->len;
> + }
>
> return SVN_NO_ERROR;
> }
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: svn-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: svn-help@subversion.tigris.org

-- 
Greg Stein, http://www.lyra.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:36:56 2006

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.