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

Re: [PATCH] Keywords as Hash 3 - libsvn_client

From: John Peacock <jpeacock_at_rowman.com>
Date: 2005-09-21 17:58:06 CEST

John Peacock wrote:
> --- subversion/libsvn_client/cat.c (/local/kwhash2) (revision 15749)
> +++ subversion/libsvn_client/cat.c (/local/kwhash3) (revision 15749)
...
> @@ -146,8 +146,11 @@
> APR_READ, APR_OS_DEFAULT, pool));
> input = svn_stream_from_aprfile (input_file, pool);
>
> - SVN_ERR (svn_subst_translate_stream2 (input, output, eol, FALSE, &kw, TRUE,
> - pool));
> + if ( eol || kw )
> + SVN_ERR (svn_subst_translate_stream3 (input, output, eol, FALSE, kw,
> + TRUE, pool));
> + else
> + SVN_ERR (svn_stream_copy (input, output, pool));

I forgot to point out the above block. The docstring for
svn_subst_translate_stream3() requires that some translation must be
done (either EOL or keywords), and there is an assert() to test that,
but this was not apparently working correctly before. If there are no
keywords present, the kw variable above will be an empty hash, which
would fail the assert test. However, the old svn_keywords_t struct
would apparently succeed here in exactly the same circumstances. In
fact, svn_subst_translate_stream3() will work correctly, even if kw is
an empty hash (in defiance of the docstring), since I could comment out
the assert() line to no effect.

I put the test above so that svn_subst_translate_stream3() would not be
called in a situation where it's docstring says it should fail. If it
is more appropriate to document that svn_subst_translate_stream3() is
more forgiving, the above block could be simplified.

John

-- 
John Peacock
Director of Information Research and Technology
Rowman & Littlefield Publishing Group
4501 Forbes Boulevard
Suite H
Lanham, MD  20706
301-459-3366 x.5010
fax 301-429-5748
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Sep 21 17:59:00 2005

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