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

[PATCH + RFC]: Fixed length keywords

From: Jani Averbach <jaa_at_jaa.iki.fi>
Date: 2004-10-16 01:08:42 CEST

On 2004-10-14 18:44+0100, Tom Molesworth wrote:
>
> I'd recommend "$Keyword:: " as a minimum, and leave all characters after
> the initial space for filler.

I think we have a consensus, the syntax is following at the moment:

   "$keyword:: " <value> (" $" | "#$")

where <value> is at least one character, value could contain anything
except '$' chars, and "#$" indicates that the value is truncated.

> The fixed-size keyword code does not differentiate between original text
> and "expanded" (substituted) text - the text will be replaced every time
> no matter what.

Well, in fact it must be different, think about following recipe:

echo '$Rev:: $' >> file.txt
svn ci -m 'rev 1' file.txt

echo 'a line' >> file.txt
svn ci -m 'rev 2' file.txt

svn diff -r 1:2 file.txt

You don't like to see keywords line in the diff, so they have to be
unexpanded. At the moment this means filling with spaces.

RFC:

If someone handles these keywords with old client, it is possible to
inject to the server "dirty" keywords (keyword strings with value data).
This causes that these fixed length keywords show up on diffs when
they shouldn't. How bad is that? I think we can live with it, but
could we?

I have planned to commit this sometime next week, if nobody objects.

BR, Jani

A Log entry for patch, patch is an attachment:

This patch implements fixed size keywords for Subversion, see issue
#2095 for more details.
Patch provided by Tom Molesworth <tom at molesworth name>, regression
tests by Jani Averbach <jaa at jaa iki fi>.

* subversion/libsvn_subr/subst.c
    (translate_keyword_subst): Added fixed length keyword handling

* subversion/tests/clients/cmdline/diff_tests.py
    (verify_exluded_output): New helper function
    (diff_keywords): New test, check that keywords won't show up on
        diff, and that they show when they should.
    
* subversion/tests/clients/cmdline/trans_tests.py
    (keywords_from_birth): Added testing of fixed length keywords.
    (setup_working_copy): Signature changed, it now takes second
      argument: length of value field (value_len) for fixed keywords.
    (check_keywords): New helper function
    (fixed_length_keywords_path): New test path

* subversion/tests/clients/cmdline/svntest/main.py
    (canonize_url): New helper function

* doc/book/TODO
    Added entry for fixed length keywords.

-- 
Jani Averbach 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Received on Sat Oct 16 01:09:01 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.