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

Re: [PATCH] Expand using the correct Revision for cat and update

From: Ben Collins-Sussman <sussman_at_collab.net>
Date: 2003-06-24 00:32:32 CEST

Hi Chris,

"Chris Foote" <Chris.Foote@xtra.co.nz> writes:

> Correct keyword expansion for update and cat.
>
> * subversion/libsvn_wc/translate.c
> (svn_wc__get_keywords): Use the entry's cmt_rev.

This looks correct; you spotted a real bug. I'll apply this part, thanks!

> * subversion/libsvn_client/cat.c:
> (svn_client_cat): Get the keyword values from the entry props.

This is not so good. See below.

>
> Index: subversion/libsvn_client/cat.c
> ===================================================================
> --- subversion/libsvn_client/cat.c (revision 6309)
> +++ subversion/libsvn_client/cat.c (working copy)
> @@ -128,25 +128,24 @@
>
> if (keywords)
> {
> - svn_string_t *date, *author;
> - apr_hash_t *revprops;
> + svn_string_t *cmt_rev, *cmt_date, *cmt_author;
> apr_time_t when = 0;
>
> - SVN_ERR (ra_lib->rev_proplist(session, rev, &revprops, pool));
> -
> - date = apr_hash_get (revprops, SVN_PROP_REVISION_DATE,
> - APR_HASH_KEY_STRING);
> - author = apr_hash_get (revprops, SVN_PROP_REVISION_AUTHOR,
> - APR_HASH_KEY_STRING);
> - if (date)
> - SVN_ERR (svn_time_from_cstring (&when, date->data, pool));
> + cmt_rev = apr_hash_get (props, SVN_PROP_ENTRY_COMMITTED_REV,
> + APR_HASH_KEY_STRING);
> + cmt_date = apr_hash_get (props, SVN_PROP_ENTRY_COMMITTED_DATE,
> + APR_HASH_KEY_STRING);
> + cmt_author = apr_hash_get (props, SVN_PROP_ENTRY_LAST_AUTHOR,

Yeah.... so... 'svn cat' operates on a URL. If you pass it a wc path,
it just converts it into a URL. There's no guarantee that a working
copy is present, and thus no guarantee that entry-props will exist.

So we *always* need to do get the revision's proplist from the server,
which is what the code was doing.

What bug are you seeing with 'svn cat'? You never explain in your
email. The code in cat.c looks correct to me.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Jun 24 02:34:29 2003

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.