You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Madan U Sreenivasan <ma...@collab.net> on 2005/04/06 11:24:35 UTC

[PATCH] Issue #2219: Canonicalize values in svn:keywords

Modified to not *drop* unidentifiable strings in svn:keywords as per Max
Bowsher's mail at...am resending the whole patch with fix and test cases
modified to test this new condition.
http://svn.haxx.se/dev/archive-2005-04/0397.shtml

[[[
   Fixed Issue #2219: Canonicalize values in svn:keywords.

   * subversion/libsvn_wc/props.c
     (canonicalize_keywords): New function  to
     canonicalize the input based on the canonical
     values defined for svn:keywords.
     (svn_wc_prop_set2): Changed function to call
     canonicalize_keywords().

   * subversion/tests/clients/cmdline/prop_tests.py
     (prop_value_conversions): Modified function to
     reflect output changes now caused by canonicalization.

   * subversion/tests/clients/cmdline/trans_tests.py
     (canonicalize_keywords_prop): New function for
     testing canonicalization of svn:keywords.
     (canonicalized_and_keywords_expanded): New function
     for testing canonicalization of svn:keywords
     and expansion of keywords inside the file.
]]]

Re: [PATCH] Issue #2219: Canonicalize values in svn:keywords

Posted by John Peacock <jp...@rowman.com>.
Madan U Sreenivasan wrote:
> Modified to not *drop* unidentifiable strings in svn:keywords as per Max
> Bowsher's mail at...am resending the whole patch with fix and test cases
> modified to test this new condition.

That's almost exactly what I was trying to get working last night, but I 
got distracted by e-mail server problems and wasn't able to finish it up...

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

Re: [PATCH] Issue #2219: Canonicalize values in svn:keywords

Posted by Julian Foad <ju...@btopenworld.com>.
John Peacock wrote:
>> svn propset svn:keywords 'Author Date Revision MyCustomKeyword="%D 
>> %U"' foo
[...]
> patch that Madan submitted would still be completely transparent to that 
> notation.  The only thing the proposed patch does is fix the known 
> keywords (I hate to keep repeating that); unknown values are copied 
> unaltered, so we are free to extend the notation however seems fit.

Careful.  The patch would be completely transparent to that particular example 
of a string, but not necessarily to that notation, depending on how that 
notation is defined (and the notation isn't defined in this example).  For 
example, it would reduce multiple spaces to a single space, and would destroy 
any occurrence of " Date " etc. that might appear inside the 
MyCustomKeyword="%D %U" sub-string, because it doesn't recognise that that is a 
quoted sub-string.

   'Author Date Revision MyCustomKeyword="The date is %D.   The author is %A"'
=>
   'Author Date Revision MyCustomKeyword="The is %D. The is %A"'

Now, I'm not saying that the patch isn't good enough, just that it still 
restricts syntax extensions in certain ways.

I would favour having this canonicalization and accepting that the 
"svn:keywords" string will always only consist of simple keywords or strings 
without embedded spaces at all.  (If we need some stronger syntax in future, 
there are other solutions - e.g. it could live in a different property such as 
"svn:user-keywords".)

So, I think I'm happy with the concept of the current patch that passes through 
unrecognised "words".  I haven't reviewed the code yet.

- Julian

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

Re: [PATCH] Issue #2219: Canonicalize values in svn:keywords

Posted by John Peacock <jp...@rowman.com>.
Max Bowsher wrote:
>>> svn propset svn:keywords 'Author Date Revision MyCustomKeyword="%D %U"'
>>> foo 
> 
> Nope, no it doesn't, it still munges whitespace.

Duh, yes of course.  Nevermind...

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

Re: [PATCH] Issue #2219: Canonicalize values in svn:keywords

Posted by Max Bowsher <ma...@ukf.net>.
John Peacock wrote:
> Max Bowsher wrote:
>> Server side config seems to be far in the future, perhaps even 2.0.
>> Maybe we should discuss whether an interim implementation of custom
>> keywords, using svn:keywords, might be appropriate?
>> 
>> Something like:
>> 
>> svn propset svn:keywords 'Author Date Revision MyCustomKeyword="%D %U"'
>> foo 
> 
> As ugly ;-) as that notation may be (limited to existing keyword
> primitives assuming that the kwhash code gets committed eventually), the
> patch that Madan submitted would still be completely transparent to that
> notation.  The only thing the proposed patch does is fix the known
> keywords (I hate to keep repeating that); unknown values are copied
> unaltered, so we are free to extend the notation however seems fit.

Nope, no it doesn't, it still munges whitespace.

Max.



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

Re: [PATCH] Issue #2219: Canonicalize values in svn:keywords

Posted by John Peacock <jp...@rowman.com>.
Max Bowsher wrote:
> Server side config seems to be far in the future, perhaps even 2.0.
> Maybe we should discuss whether an interim implementation of custom 
> keywords, using svn:keywords, might be appropriate?
> 
> Something like:
> 
> svn propset svn:keywords 'Author Date Revision MyCustomKeyword="%D %U"' foo

As ugly ;-) as that notation may be (limited to existing keyword 
primitives assuming that the kwhash code gets committed eventually), the 
patch that Madan submitted would still be completely transparent to that 
notation.  The only thing the proposed patch does is fix the known 
keywords (I hate to keep repeating that); unknown values are copied 
unaltered, so we are free to extend the notation however seems fit.

> I'm not saying that it is an ideal way to proceed, but it might be a
> viable way of having custom keywords before server-side
> path-inheriting configuration becomes a reality - which might be
> quite some way into the future.

And just because the full server-side configuration is hard, doesn't 
mean we couldn't design and implement an interim solution there as well. 
  I'm thinking specifically of making files inherit properties from the 
containing directory as a first step; this only (!) involves libsvn_wc 
code.  The more difficult task of having tree inheritance pushed out 
from the server, with multiple inheritance, blocking, locking, etc. can 
be added later, and won't conflict with the containing directory 
inheritance either.

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

Re: [PATCH] Issue #2219: Canonicalize values in svn:keywords

Posted by Max Bowsher <ma...@ukf.net>.
John Peacock wrote:
> Max Bowsher wrote:
>> I propose that we need to sort out whether issue 890 (custom keywords)
>> requires any extended syntax in svn:keywords before we proceed with
>> keyword canonicalisation.
>
> Having spent a lot of time thinking about custom keywords over the past
> year, this patch in no way interferes with anything we do about custom
> keywords (IMHO).  It is strictly about fixing the misfeature that the
> contents of svn:keywords aren't case-sensitive and the keywords inside
> files are.
> Any custom keyword handling should be overlayed on top of the existing
> keywords, not relying on specialized syntax within svn:keywords.  Custom
> keywords are almost certainly going be deeply involved with issue #1974
> (and the others similar server side config issues).
>
> As long as the revised patch ignores all keywords that are not "core"
> then we are set for future expansion.  At some point, the else{} that
> Madan added can be extended with a call to validate repository-defined
> keywords in addition to the builtin keywords, and old clients will not
> break (but they also won't get the custom keyword expansion).

Server side config seems to be far in the future, perhaps even 2.0.
Maybe we should discuss whether an interim implementation of custom 
keywords, using svn:keywords, might be appropriate?

Something like:

svn propset svn:keywords 'Author Date Revision MyCustomKeyword="%D %U"' foo

?

I'm not saying that it is an ideal way to proceed, but it might be a viable 
way of having custom keywords before server-side path-inheriting 
configuration becomes a reality - which might be quite some way into the 
future.

Max.


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

Re: [PATCH] Issue #2219: Canonicalize values in svn:keywords

Posted by Madan U Sreenivasan <ma...@collab.net>.
On Thu, 2005-04-07 at 05:42, John Peacock wrote:
> Max Bowsher wrote:
> > I propose that we need to sort out whether issue 890 (custom keywords) 
> > requires any extended syntax in svn:keywords before we proceed with 
> > keyword canonicalisation.
[...]
> Any custom keyword handling should be overlayed on top of the existing keywords, 
> not relying on specialized syntax within svn:keywords.
I agree... this patch would not affect however #890 is going to be
addressed.

Regards,
Madan.


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

Re: [PATCH] Issue #2219: Canonicalize values in svn:keywords

Posted by John Peacock <jp...@rowman.com>.
Max Bowsher wrote:
> I propose that we need to sort out whether issue 890 (custom keywords) 
> requires any extended syntax in svn:keywords before we proceed with 
> keyword canonicalisation.

Having spent a lot of time thinking about custom keywords over the past year, 
this patch in no way interferes with anything we do about custom keywords 
(IMHO).  It is strictly about fixing the misfeature that the contents of 
svn:keywords aren't case-sensitive and the keywords inside files are.

Any custom keyword handling should be overlayed on top of the existing keywords, 
not relying on specialized syntax within svn:keywords.  Custom keywords are 
almost certainly going be deeply involved with issue #1974 (and the others 
similar server side config issues).

As long as the revised patch ignores all keywords that are not "core" then we 
are set for future expansion.  At some point, the else{} that Madan added can be 
extended with a call to validate repository-defined keywords in addition to the 
builtin keywords, and old clients will not break (but they also won't get the 
custom keyword expansion).

My 2 cents

John

-- 
John Peacock
Director of Information Research and Technology
Rowman & Littlefield Publishing Group
4720 Boston Way
Lanham, MD 20706
301-459-3366 x.5010
fax 301-429-5747

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

Re: [PATCH] Issue #2219: Canonicalize values in svn:keywords

Posted by Max Bowsher <ma...@ukf.net>.
Madan U Sreenivasan wrote:
>> Modified to not *drop* unidentifiable strings in svn:keywords as per Max
>> Bowsher's mail at...am resending the whole patch with fix and test cases
>> modified to test this new condition.

Please put a link in the issue.

I propose that we need to sort out whether issue 890 (custom keywords) 
requires any extended syntax in svn:keywords before we proceed with keyword 
canonicalisation.

Max.


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