You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Alexander Kitaev <al...@tmate.org> on 2006/02/28 15:46:54 UTC

Eols are not preserved in DAV log reponse.

Hello All,

I've noticed a difference between mod_dav_svn responses to
getRevisionProperty("svn:log") and log(...):

Fetching revision property:

<S:log>changes from 0.9.0 merged (1116:1155):&#13;
&#13;
- export and swtich fixes&#13;
.....

Fetching log (history):

<D:comment>changes from 0.9.0 merged (1116:1155):

- export and swtich fixes
.....

As you could see, in "log" response real eols (those stored in corresponding
revprop file, in this case \r\n) are replaced with \n. When using "svn" or
"file" protocol, eols are reported correctly. Is this a known problem?

Alexander Kitaev,
TMate Software,
http://tmate.org/
http://jetbrains.com/tmate/


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

RE: Eols are not preserved in DAV log reponse.

Posted by Alexander Kitaev <al...@tmate.org>.
Thanks, Stefan!

> That's not quite true: the svn:log property is (like all other svn: 
> properties) a Subversion property. And all Subversion 
> properties *must* be in UTF8 and LF lineendings (as defined 
> in the docs). A client must make sure that this is done right.
> If it were another property, *then* you're allowed to store 
> whatever you want in whichever format you like, even with 
> CRLF lineendings or binary data. But not with svn: properties.
Thanks for clarification, I understand it well now, and see that though
mod_dav_svn behaviour is not consistent with "svnserve" one, it is just an
output caused by incorrect (unexpected) input data and shouldn't be
considered as a bug.

Alexander Kitaev,
TMate Software,
http://tmate.org/
http://jetbrains.com/tmate/ 

> -----Original Message-----
> From: Stefan Kung [mailto:tortoisesvn@gmail.com] 
> Sent: Tuesday, February 28, 2006 20:17
> To: dev@subversion.tigris.org
> Subject: Re: Eols are not preserved in DAV log reponse.
> 
> Alexander Kitaev wrote:
> >> There shouldn't be any \r's in the svn:log value in the 
> first place; 
> >> they're supposed to be filtered out by the client. So the first 
> >> question is, where are they coming from?
> > I'm setting those messages programatically through JavaSVN 
> (actually 
> > I'm doing commit and commit message includes \r's). I 
> understand your 
> > point and agree that client should convert commit message not to 
> > contain \r's before making a commit.
> > 
> > On the other side, as far as I understand, svn:log is not 
> special kind 
> > of property (except that it is set automatically on commit), so it 
> > should be possible to set it to any value in any encoding or even 
> > binary data as well as any other revision property (probably doing 
> > "svn propset -rX --revprop svn:log -F fileWithWindowsEols" 
> will do the 
> > same). Svnserve behaves consistently here, preserving 
> svn:log property 
> > value in log message, but mod_dav_svn does not (the log message it 
> > reports is not same as the value stored in revprop file of 
> the corresponding revision).
> 
> That's not quite true: the svn:log property is (like all other svn: 
> properties) a Subversion property. And all Subversion 
> properties *must* be in UTF8 and LF lineendings (as defined 
> in the docs). A client must make sure that this is done right.
> If it were another property, *then* you're allowed to store 
> whatever you want in whichever format you like, even with 
> CRLF lineendings or binary data. But not with svn: properties.
> 
> Stefan
> 
> -- 
>         ___
>    oo  // \\      "De Chelonian Mobile"
>   (_,\/ \_/ \     TortoiseSVN
>     \ \_/_\_/>    The coolest Interface to (Sub)Version Control
>     /_/   \_\     http://tortoisesvn.tigris.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: dev-help@subversion.tigris.org
> 
> 


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

Re: Eols are not preserved in DAV log reponse.

Posted by Stefan Küng <to...@gmail.com>.
Alexander Kitaev wrote:
>> There shouldn't be any \r's in the svn:log value in the first 
>> place; they're supposed to be filtered out by the client. So 
>> the first question is, where are they coming from?
> I'm setting those messages programatically through JavaSVN (actually I'm
> doing commit and commit message includes \r's). I understand your point and
> agree that client should convert commit message not to contain \r's before
> making a commit.
> 
> On the other side, as far as I understand, svn:log is not special kind of
> property (except that it is set automatically on commit), so it should be
> possible to set it to any value in any encoding or even binary data as well
> as any other revision property (probably doing "svn propset -rX --revprop
> svn:log -F fileWithWindowsEols" will do the same). Svnserve behaves
> consistently here, preserving svn:log property value in log message, but
> mod_dav_svn does not (the log message it reports is not same as the value
> stored in revprop file of the corresponding revision).

That's not quite true: the svn:log property is (like all other svn: 
properties) a Subversion property. And all Subversion properties *must* 
be in UTF8 and LF lineendings (as defined in the docs). A client must 
make sure that this is done right.
If it were another property, *then* you're allowed to store whatever you 
want in whichever format you like, even with CRLF lineendings or binary 
data. But not with svn: properties.

Stefan

-- 
        ___
   oo  // \\      "De Chelonian Mobile"
  (_,\/ \_/ \     TortoiseSVN
    \ \_/_\_/>    The coolest Interface to (Sub)Version Control
    /_/   \_\     http://tortoisesvn.tigris.org

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

Re: Eols are not preserved in DAV log reponse.

Posted by Malcolm Rowe <ma...@farside.org.uk>.
On Tue, Feb 28, 2006 at 07:27:04PM +0100, Alexander Kitaev wrote:
> On the other side, as far as I understand, svn:log is not special kind of
> property (except that it is set automatically on commit)

Actually, that's not strictly true.  As an 'svn:' property, it's defined
to be in a UTF-8 encoding.  Also (perhaps more relevantly), svn:log
is intended to be a list of lines, each terminated by a NL character.
Now there's no reason that the lines couldn't each end with a CR, perhaps,
but that's pretty far from a generic 'anything goes' property.

Regards,
Malcolm

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

RE: Eols are not preserved in DAV log reponse.

Posted by Alexander Kitaev <al...@tmate.org>.
Hello Branko,

> There shouldn't be any \r's in the svn:log value in the first 
> place; they're supposed to be filtered out by the client. So 
> the first question is, where are they coming from?
I'm setting those messages programatically through JavaSVN (actually I'm
doing commit and commit message includes \r's). I understand your point and
agree that client should convert commit message not to contain \r's before
making a commit.

On the other side, as far as I understand, svn:log is not special kind of
property (except that it is set automatically on commit), so it should be
possible to set it to any value in any encoding or even binary data as well
as any other revision property (probably doing "svn propset -rX --revprop
svn:log -F fileWithWindowsEols" will do the same). Svnserve behaves
consistently here, preserving svn:log property value in log message, but
mod_dav_svn does not (the log message it reports is not same as the value
stored in revprop file of the corresponding revision).

I think behaviour of the mod_dav_svn and svnserve should be at least
consistent, otherwise one could get different log messages depending on the
protocol one uses; both shouldn't touch revision property values, leaving
eol convertion up to the client.

Alexander Kitaev,
TMate Software,
http://tmate.org/
http://jetbrains.com/tmate/ 

> -----Original Message-----
> From: Branko Cibej [mailto:brane@xbc.nu] 
> Sent: Tuesday, February 28, 2006 19:14
> To: alex@tmate.org
> Cc: dev@subversion.tigris.org
> Subject: Re: Eols are not preserved in DAV log reponse.
> 
> Alexander Kitaev wrote:
> > Hello All,
> >
> > I've noticed a difference between mod_dav_svn responses to
> > getRevisionProperty("svn:log") and log(...):
> >
> > Fetching revision property:
> >
> > <S:log>changes from 0.9.0 merged (1116:1155):&#13; &#13;
> > - export and swtich fixes&#13;
> > .....
> >
> > Fetching log (history):
> >
> > <D:comment>changes from 0.9.0 merged (1116:1155):
> >
> > - export and swtich fixes
> > .....
> >
> > As you could see, in "log" response real eols (those stored in 
> > corresponding revprop file, in this case \r\n) are replaced 
> with \n. 
> > When using "svn" or "file" protocol, eols are reported 
> correctly. Is this a known problem?
> >   
> There shouldn't be any \r's in the svn:log value in the first 
> place; they're supposed to be filtered out by the client. So 
> the first question is, where are they coming from?
> 
> -- Brane
> 
> 


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

Re: Eols are not preserved in DAV log reponse.

Posted by Branko Čibej <br...@xbc.nu>.
Alexander Kitaev wrote:
> Hello All,
>
> I've noticed a difference between mod_dav_svn responses to
> getRevisionProperty("svn:log") and log(...):
>
> Fetching revision property:
>
> <S:log>changes from 0.9.0 merged (1116:1155):&#13;
> &#13;
> - export and swtich fixes&#13;
> .....
>
> Fetching log (history):
>
> <D:comment>changes from 0.9.0 merged (1116:1155):
>
> - export and swtich fixes
> .....
>
> As you could see, in "log" response real eols (those stored in corresponding
> revprop file, in this case \r\n) are replaced with \n. When using "svn" or
> "file" protocol, eols are reported correctly. Is this a known problem?
>   
There shouldn't be any \r's in the svn:log value in the first place; 
they're supposed to be filtered out by the client. So the first question 
is, where are they coming from?

-- Brane


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

RE: Eols are not preserved in DAV log reponse.

Posted by Alexander Kitaev <al...@tmate.org>.
Hello Stefan,

> So if you could commit a log message with CRLF lineendings, 
> that's the fault of the Subversion client which didn't 
> convert the log message.
Now it is JavaSVN bug. But what if one will set "invalid" svn:log value with
"svn propset --revprop"? Should svn:log value be converted by the client in
this case as well?

Alexander Kitaev,
TMate Software,
http://tmate.org/
http://jetbrains.com/tmate/ 

> -----Original Message-----
> From: Stefan Kung [mailto:tortoisesvn@gmail.com] 
> Sent: Tuesday, February 28, 2006 19:05
> To: dev@subversion.tigris.org
> Subject: Re: Eols are not preserved in DAV log reponse.
> 
> Alexander Kitaev wrote:
> 
> > I've noticed a difference between mod_dav_svn responses to
> > getRevisionProperty("svn:log") and log(...):
> > 
> > Fetching revision property:
> > 
> > <S:log>changes from 0.9.0 merged (1116:1155):&#13; &#13;
> > - export and swtich fixes&#13;
> > .....
> > 
> > Fetching log (history):
> > 
> > <D:comment>changes from 0.9.0 merged (1116:1155):
> > 
> > - export and swtich fixes
> > .....
> > 
> > As you could see, in "log" response real eols (those stored in 
> > corresponding revprop file, in this case \r\n) are replaced 
> with \n. 
> > When using "svn" or "file" protocol, eols are reported 
> correctly. Is this a known problem?
> 
> With which client did you commit that revision?
> I'm asking because the docs of svn_client_get_commit_log2() 
> clearly state:
> "The log message MUST be a UTF8 string with LF line separators."
> 
> So if you could commit a log message with CRLF lineendings, 
> that's the fault of the Subversion client which didn't 
> convert the log message.
> 
> (I know TSVN had this bug once, but it got fixed in revision 
> 847 which was before version 1.0.1 almost two years ago).
> 
> Stefan
> 
> -- 
>         ___
>    oo  // \\      "De Chelonian Mobile"
>   (_,\/ \_/ \     TortoiseSVN
>     \ \_/_\_/>    The coolest Interface to (Sub)Version Control
>     /_/   \_\     http://tortoisesvn.tigris.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: dev-help@subversion.tigris.org
> 
> 


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

Re: Eols are not preserved in DAV log reponse.

Posted by Stefan Küng <to...@gmail.com>.
Alexander Kitaev wrote:

> I've noticed a difference between mod_dav_svn responses to
> getRevisionProperty("svn:log") and log(...):
> 
> Fetching revision property:
> 
> <S:log>changes from 0.9.0 merged (1116:1155):&#13;
> &#13;
> - export and swtich fixes&#13;
> .....
> 
> Fetching log (history):
> 
> <D:comment>changes from 0.9.0 merged (1116:1155):
> 
> - export and swtich fixes
> .....
> 
> As you could see, in "log" response real eols (those stored in corresponding
> revprop file, in this case \r\n) are replaced with \n. When using "svn" or
> "file" protocol, eols are reported correctly. Is this a known problem?

With which client did you commit that revision?
I'm asking because the docs of svn_client_get_commit_log2() clearly state:
"The log message MUST be a UTF8 string with LF line separators."

So if you could commit a log message with CRLF lineendings, that's the 
fault of the Subversion client which didn't convert the log message.

(I know TSVN had this bug once, but it got fixed in revision 847 which 
was before version 1.0.1 almost two years ago).

Stefan

-- 
        ___
   oo  // \\      "De Chelonian Mobile"
  (_,\/ \_/ \     TortoiseSVN
    \ \_/_\_/>    The coolest Interface to (Sub)Version Control
    /_/   \_\     http://tortoisesvn.tigris.org

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