You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Xevious <xe...@heavyphoton.com> on 2005/06/16 05:07:16 UTC

Spaces in Keyword Expansion

I am attempting to include the $Id keyword in
a RTF document. All is well, except that the
spaces in the filename are being escaped to %20
like so:

Mr%20Bigs%20Important%20Doc

This is unattractive and not quite the desired
result. Is this the normal behavior?

xev



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

Re: Spaces in Keyword Expansion

Posted by "Peter N. Lundblad" <pe...@famlundblad.se>.
On Thu, 16 Jun 2005, Xevious wrote:

>
> I am attempting to include the $Id keyword in
> a RTF document. All is well, except that the
> spaces in the filename are being escaped to %20
> like so:
>
> Mr%20Bigs%20Important%20Doc
>
> This is unattractive and not quite the desired
> result. Is this the normal behavior?
>
Fixed in r15073. Thanks for the report.

Regards,
//Peter

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

Re: Spaces in Keyword Expansion

Posted by Charles Bailey <ba...@gmail.com>.
On 7/6/05, John Peacock <jp...@rowman.com> wrote:
> Vincent Lefevre wrote:
> > In particular, how are control characters in filenames handled?
> 
> They aren't [currently] escaped/encoded.

Most control chars (in the less-than-0x20 set, at least) aren't legal
XML characters, so they'll probably cause you bigger problems than
illegible keyword substitution.

> > And what about the '$' character
> > in a filename, which must not appear inside a keyword expansion?
> 
> Don't do that (including '$' in a filename).

Hmm.  I'm not sure the user always has that level of control over filenames.

-- 
Regards,
Charles Bailey
Lists: bailey _dot_ charles _at_ gmail _dot_ com
Other: bailey _at_ newman _dot_ upenn _dot_ edu

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


Re: Spaces in Keyword Expansion

Posted by Vincent Lefevre <vi...@vinc17.org>.
On 2005-07-06 10:08:51 -0400, John Peacock wrote:
> Vincent Lefevre wrote:
> >In particular, how are control characters in filenames handled?
> 
> They aren't [currently] escaped/encoded.
> 
> >Are they encoded? If not, what about the end-of-line characters
> >vs the svn:eol-style property? 
> 
> All keywords must be a single line (and placing a EOL character in a 
> file name, while technically legal, is a really poor choice).

I know that, but users shouldn't be able to screw up their repository.
One could also say that placing space characters in filenames is a
poor choice (at least, under Unix), though some people do that.

> >And what about the '$' character in a filename, which must not
> >appear inside a keyword expansion?
> 
> Don't do that (including '$' in a filename).

There may be valid reasons to have '$' in a filename (like any other
printable character).

> >Also, when are locales considered for keyword expansion?
> 
> They aren't [currently].

I thought the Date keyword used the locales, or has this changed?

> >How do Subversion developers suggest to parse keywords (in
> >particular, Id)?
> 
> Don't parse it.

AFAIK, this is the only way to get the UTC date (if one wants to avoid
a conversion). Moreover it is easier to use Id than the other keywords
when one wants to get several metadata.

-- 
Vincent Lefèvre <vi...@vinc17.org> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / SPACES project at LORIA

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

Re: Spaces in Keyword Expansion

Posted by Vincent Lefevre <vi...@vinc17.org>.
On 2005-07-06 10:08:51 -0400, John Peacock wrote:
> Vincent Lefevre wrote:
> >In particular, how are control characters in filenames handled?
> 
> They aren't [currently] escaped/encoded.
> 
> >Are they encoded? If not, what about the end-of-line characters
> >vs the svn:eol-style property? 
> 
> All keywords must be a single line (and placing a EOL character in a 
> file name, while technically legal, is a really poor choice).

I know that, but users shouldn't be able to screw up their repository.
One could also say that placing space characters in filenames is a
poor choice (at least, under Unix), though some people do that.

> >And what about the '$' character in a filename, which must not
> >appear inside a keyword expansion?
> 
> Don't do that (including '$' in a filename).

There may be valid reasons to have '$' in a filename (like any other
printable character).

> >Also, when are locales considered for keyword expansion?
> 
> They aren't [currently].

I thought the Date keyword used the locales, or has this changed?

> >How do Subversion developers suggest to parse keywords (in
> >particular, Id)?
> 
> Don't parse it.

AFAIK, this is the only way to get the UTC date (if one wants to avoid
a conversion). Moreover it is easier to use Id than the other keywords
when one wants to get several metadata.

-- 
Vincent Lefèvre <vi...@vinc17.org> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / SPACES project at LORIA

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

Re: Spaces in Keyword Expansion

Posted by Charles Bailey <ba...@gmail.com>.
On 7/6/05, John Peacock <jp...@rowman.com> wrote:
> Vincent Lefevre wrote:
> > In particular, how are control characters in filenames handled?
> 
> They aren't [currently] escaped/encoded.

Most control chars (in the less-than-0x20 set, at least) aren't legal
XML characters, so they'll probably cause you bigger problems than
illegible keyword substitution.

> > And what about the '$' character
> > in a filename, which must not appear inside a keyword expansion?
> 
> Don't do that (including '$' in a filename).

Hmm.  I'm not sure the user always has that level of control over filenames.

-- 
Regards,
Charles Bailey
Lists: bailey _dot_ charles _at_ gmail _dot_ com
Other: bailey _at_ newman _dot_ upenn _dot_ edu

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


Re: Spaces in Keyword Expansion

Posted by John Peacock <jp...@rowman.com>.
Vincent Lefevre wrote:
> In particular, how are control characters in filenames handled?

They aren't [currently] escaped/encoded.

> Are they encoded? If not, what about the end-of-line characters
> vs the svn:eol-style property? 

All keywords must be a single line (and placing a EOL character in a 
file name, while technically legal, is a really poor choice).

> And what about the '$' character
> in a filename, which must not appear inside a keyword expansion?

Don't do that (including '$' in a filename).

> 
> Also, when are locales considered for keyword expansion?

They aren't [currently].

> How do Subversion developers suggest to parse keywords (in
> particular, Id)?

Don't parse it.  $Id$ is just made up of (rev, url, date, author) 
without explicit delimiters, so if you want any of those individual 
values, just use $Rev$ or whatever.

If the keywords-as-hash code every gets applied (Hi Max!), those changes 
will make it easier to revisit how the expansion should handle 
non-alphanumeric characters (both in terms of escaping and encoding). 
Keywords are very primitive now, and ever after the patch are still not 
going to be useful for anything really bizarre.

HTH

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: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Spaces in Keyword Expansion

Posted by John Peacock <jp...@rowman.com>.
Vincent Lefevre wrote:
> In particular, how are control characters in filenames handled?

They aren't [currently] escaped/encoded.

> Are they encoded? If not, what about the end-of-line characters
> vs the svn:eol-style property? 

All keywords must be a single line (and placing a EOL character in a 
file name, while technically legal, is a really poor choice).

> And what about the '$' character
> in a filename, which must not appear inside a keyword expansion?

Don't do that (including '$' in a filename).

> 
> Also, when are locales considered for keyword expansion?

They aren't [currently].

> How do Subversion developers suggest to parse keywords (in
> particular, Id)?

Don't parse it.  $Id$ is just made up of (rev, url, date, author) 
without explicit delimiters, so if you want any of those individual 
values, just use $Rev$ or whatever.

If the keywords-as-hash code every gets applied (Hi Max!), those changes 
will make it easier to revisit how the expansion should handle 
non-alphanumeric characters (both in terms of escaping and encoding). 
Keywords are very primitive now, and ever after the patch are still not 
going to be useful for anything really bizarre.

HTH

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: Spaces in Keyword Expansion

Posted by Vincent Lefevre <vi...@vinc17.org>.
On 2005-06-16 08:51:19 -0500, kfogel@collab.net wrote:
> I don't think that doing URL-escaping on the basenames in $Id$ was
> ever intentional, it was just an accident of implementation.  

Could this be fully documented then, please?

In particular, how are control characters in filenames handled?
Are they encoded? If not, what about the end-of-line characters
vs the svn:eol-style property? And what about the '$' character
in a filename, which must not appear inside a keyword expansion?

Also, when are locales considered for keyword expansion?
And a reference to bug 2332 [*] would be fine.

[*] http://subversion.tigris.org/issues/show_bug.cgi?id=2332
"Keyword expansion in non-UTF8 documents results in mixed charsets"

How do Subversion developers suggest to parse keywords (in
particular, Id)?

-- 
Vincent Lefèvre <vi...@vinc17.org> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / SPACES project at LORIA

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

Re: Spaces in Keyword Expansion

Posted by "Peter N. Lundblad" <pe...@famlundblad.se>.
On Thu, 16 Jun 2005 kfogel@collab.net wrote:

> I don't think that doing URL-escaping on the basenames in $Id$ was
> ever intentional, it was just an accident of implementation.
>
> Maybe some people who wrote code to parse the basenames are expecting
> URLs (though I'll bet most haven't noticed yet), but IMHO we should
> bite the bullet and treat that as "depending on a buggy behavior".
> Let's just make sure to list it in the CHANGES file for the next
> release -- you might want to make that part of your commit.
>
I added a note to the commit log about compatibility.

Regards,
//Peter

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

Re: Spaces in Keyword Expansion

Posted by Vincent Lefevre <vi...@vinc17.org>.
On 2005-06-16 08:51:19 -0500, kfogel@collab.net wrote:
> I don't think that doing URL-escaping on the basenames in $Id$ was
> ever intentional, it was just an accident of implementation.  

Could this be fully documented then, please?

In particular, how are control characters in filenames handled?
Are they encoded? If not, what about the end-of-line characters
vs the svn:eol-style property? And what about the '$' character
in a filename, which must not appear inside a keyword expansion?

Also, when are locales considered for keyword expansion?
And a reference to bug 2332 [*] would be fine.

[*] http://subversion.tigris.org/issues/show_bug.cgi?id=2332
"Keyword expansion in non-UTF8 documents results in mixed charsets"

How do Subversion developers suggest to parse keywords (in
particular, Id)?

-- 
Vincent Lefèvre <vi...@vinc17.org> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / SPACES project at LORIA

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

Re: Spaces in Keyword Expansion

Posted by "Peter N. Lundblad" <pe...@famlundblad.se>.
On Thu, 16 Jun 2005 kfogel@collab.net wrote:

> I don't think that doing URL-escaping on the basenames in $Id$ was
> ever intentional, it was just an accident of implementation.
>
> Maybe some people who wrote code to parse the basenames are expecting
> URLs (though I'll bet most haven't noticed yet), but IMHO we should
> bite the bullet and treat that as "depending on a buggy behavior".
> Let's just make sure to list it in the CHANGES file for the next
> release -- you might want to make that part of your commit.
>
I added a note to the commit log about compatibility.

Regards,
//Peter

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

Re: Spaces in Keyword Expansion

Posted by kf...@collab.net.
"Peter N. Lundblad" <pe...@famlundblad.se> writes:
> > Escaping of some characters (at least '$', and '%' as the escape
> > character) is necessary. I think it is a good idea to escape the
> > space too to ease the parsing of the Id keyword (I need that here).
> > Otherwise this could be optional and could be part of bug 890.
>
> I was going to commit a patch that "fixed" this "bug". Now I realize that
> this might cause problems for people parsing the Id keyword expansion. So,
> maybe we should document Id as containing the basename of the URL, not the
> filename (I don't know if it is documented as the latter anywhere).
> 
> Any opinions? Should I drop my patch or commit it?

I don't think that doing URL-escaping on the basenames in $Id$ was
ever intentional, it was just an accident of implementation.  

Maybe some people who wrote code to parse the basenames are expecting
URLs (though I'll bet most haven't noticed yet), but IMHO we should
bite the bullet and treat that as "depending on a buggy behavior".
Let's just make sure to list it in the CHANGES file for the next
release -- you might want to make that part of your commit.

-Karl

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

Re: Spaces in Keyword Expansion

Posted by kf...@collab.net.
"Peter N. Lundblad" <pe...@famlundblad.se> writes:
> > Escaping of some characters (at least '$', and '%' as the escape
> > character) is necessary. I think it is a good idea to escape the
> > space too to ease the parsing of the Id keyword (I need that here).
> > Otherwise this could be optional and could be part of bug 890.
>
> I was going to commit a patch that "fixed" this "bug". Now I realize that
> this might cause problems for people parsing the Id keyword expansion. So,
> maybe we should document Id as containing the basename of the URL, not the
> filename (I don't know if it is documented as the latter anywhere).
> 
> Any opinions? Should I drop my patch or commit it?

I don't think that doing URL-escaping on the basenames in $Id$ was
ever intentional, it was just an accident of implementation.  

Maybe some people who wrote code to parse the basenames are expecting
URLs (though I'll bet most haven't noticed yet), but IMHO we should
bite the bullet and treat that as "depending on a buggy behavior".
Let's just make sure to list it in the CHANGES file for the next
release -- you might want to make that part of your commit.

-Karl

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

Re: Spaces in Keyword Expansion

Posted by Xevious <xe...@heavyphoton.com>.
Peter N. Lundblad wrote:
> I was going to commit a patch that "fixed" this "bug". Now I realize that
> this might cause problems for people parsing the Id keyword expansion. So,
> maybe we should document Id as containing the basename of the URL, not the
> filename (I don't know if it is documented as the latter anywhere).

I understand more completely now. My first glance at the $Id keyword
in the SVN book led me to believe it included the filename - not 
realizing that it was merely the last segment of the URL.

> Any opinions? Should I drop my patch or commit it?


I cannot answer this. Perhaps a $Filename keyword would be nice.

xev



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

Re: Spaces in Keyword Expansion

Posted by "Peter N. Lundblad" <pe...@famlundblad.se>.

On Thu, 16 Jun 2005, Vincent Lefevre wrote:

> On 2005-06-16 00:07:16 -0500, Xevious wrote:
> > I am attempting to include the $Id keyword in
> > a RTF document. All is well, except that the
> > spaces in the filename are being escaped to %20
> > like so:
> >
> > Mr%20Bigs%20Important%20Doc
> >
> > This is unattractive and not quite the desired
> > result. Is this the normal behavior?
>
> Escaping of some characters (at least '$', and '%' as the escape
> character) is necessary. I think it is a good idea to escape the
> space too to ease the parsing of the Id keyword (I need that here).
> Otherwise this could be optional and could be part of bug 890.
>
>
I was going to commit a patch that "fixed" this "bug". Now I realize that
this might cause problems for people parsing the Id keyword expansion. So,
maybe we should document Id as containing the basename of the URL, not the
filename (I don't know if it is documented as the latter anywhere).

Any opinions? Should I drop my patch or commit it?

Best,
//Peter

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

Re: Spaces in Keyword Expansion

Posted by "Peter N. Lundblad" <pe...@famlundblad.se>.

On Thu, 16 Jun 2005, Vincent Lefevre wrote:

> On 2005-06-16 00:07:16 -0500, Xevious wrote:
> > I am attempting to include the $Id keyword in
> > a RTF document. All is well, except that the
> > spaces in the filename are being escaped to %20
> > like so:
> >
> > Mr%20Bigs%20Important%20Doc
> >
> > This is unattractive and not quite the desired
> > result. Is this the normal behavior?
>
> Escaping of some characters (at least '$', and '%' as the escape
> character) is necessary. I think it is a good idea to escape the
> space too to ease the parsing of the Id keyword (I need that here).
> Otherwise this could be optional and could be part of bug 890.
>
>
I was going to commit a patch that "fixed" this "bug". Now I realize that
this might cause problems for people parsing the Id keyword expansion. So,
maybe we should document Id as containing the basename of the URL, not the
filename (I don't know if it is documented as the latter anywhere).

Any opinions? Should I drop my patch or commit it?

Best,
//Peter

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

Re: Spaces in Keyword Expansion

Posted by Xevious <xe...@heavyphoton.com>.
Vincent Lefevre wrote:

> Escaping of some characters (at least '$', and '%' as the escape
> character) is necessary. I think it is a good idea to escape the
> space too to ease the parsing of the Id keyword (I need that here).
> Otherwise this could be optional and could be part of bug 890.

If I am understanding you correctly, you are saying that it is
convenient for the spaces in the filename to be escaped so that
you can then split $Id on spaces and get the filename in one chunk?


xev





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

Re: Spaces in Keyword Expansion

Posted by Vincent Lefevre <vi...@vinc17.org>.
On 2005-06-16 00:07:16 -0500, Xevious wrote:
> I am attempting to include the $Id keyword in
> a RTF document. All is well, except that the
> spaces in the filename are being escaped to %20
> like so:
> 
> Mr%20Bigs%20Important%20Doc
> 
> This is unattractive and not quite the desired
> result. Is this the normal behavior?

Escaping of some characters (at least '$', and '%' as the escape
character) is necessary. I think it is a good idea to escape the
space too to ease the parsing of the Id keyword (I need that here).
Otherwise this could be optional and could be part of bug 890.

-- 
Vincent Lefèvre <vi...@vinc17.org> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / SPACES project at LORIA

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