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

Custom Keywords (1.1-consider )

From: John Peacock <jpeacock_at_rowman.com>
Date: 2004-06-09 20:15:40 CEST

Now that Sussman has kindly placed this in the 1.1-consider pile:

http://subversion.tigris.org/issues/show_bug.cgi?id=890

I'd like to document again where we currently stand. The two patches I
associated with the issue make keywords into a hash (as opposed to a
struct) in a 100% API neutral fashion. Only the existing keywords are
handled.

The third patch, which was posted only to the list:

http://www.contactor.se/~dast/svn/archive-2004-04/1184.shtml

makes it possible to make any random property into a keyword. There are
two problems with this method (apart from the philosophical difficult of
whether this is wise):

1) Property values can be multiline
2) Property values can be of indefinite length

Since keywords are currently limited on both those fronts, the patch I
originally proffered threw a warning if either of those constraints was
violated, but then went ahead and chopped the property value at the
first newline or at SVN_KEYWORD_MAX_LEN. The problem is that there is
no callback method to handle the warning (and printing to STDERR from a
library is considered bad ;).

For the benefit of those who haven't dealt with this part of the code,
the reason we cannot throw an error is that the keyword expansion only
occurs in the client after the commit/checkout has completed. Any error
thrown here would emit a long and tortuous series of callbacks (which
would be more than a little confusing) and would ultimately leave the WC
in an inconsistent state (minor though it might be).

There are two ways to deal with this, AFAICT:

1) Continue chopping the property based on the limitations of keywords,
but don't throw any warnings;

2) Abandon this particular feature and simply apply the first two
patches (which provide no new functionality, but also do no harm).

It doesn't look to me like there is any good way to shoehorn a warning
callback into the current codebase (certainly in a 1.1 timeframe), but
then I could be wrong. I can be fairly certain that _I_ don't know how
to do it. ;)

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 Jun 9 20:16:14 2004

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.