You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by "Srilakshmanan, Lakshman" <la...@police.vic.gov.au> on 2008/01/04 01:58:24 UTC

svn keyword expansion

Hi All,

My understanding is that the svn keyword expansion is performed on the
client side. 

The above being the case, word doc files on the server should never be
corrupted due to keyword expansion related issues, because the keywords
are not expanded and stored on the server. 

Therefore, how can I retrieve a MSword file without a client attempting
to perform keyword substitution.

I tried svn export http://.../ , alas that too substitutes keywords. I
know this because I have a txt file and a MSword file in the same
directory.

Any help is much appreciated.

I am aware that keyword expansion is not supported for MSWord (binary)
files http://svn.haxx.se/users/archive-2007-11/0801.shtml. I have *not*
got my self into a strife, but was interested in having a work around
for such an issue.

Thanks
lakshman

================================================================================================
EMAIL DISCLAIMER

This email and any attachments are confidential. They may also be subject to copyright.

If you are not an intended recipient of this email please immediately contact us by replying
to this email and then delete this email. 

You must not read, use, copy, retain, forward or disclose this email or any attachment.

We do not accept any liability arising from or in connection with unauthorised use or disclosure 
of the information contained in this email or any attachment.

We make reasonable efforts to protect against computer viruses but we do not accept liability
for any liability, loss or damage caused by any computer virus contained in this email.
================================================================================================

Re: svn keyword expansion

Posted by Ashwin Basagouda Patil <as...@robosoftin.com>.
Dear All. 

I am getting following error message when i try to access the one repository, i am not able to access 
the repository all. All are having the problem with this repository.

Please help me as it urjent case. 


Error message:

[Tue Jan 08 12:42:33 2008] [error] [client ip addres] Found malformed header in revision file  [500, 
#160004]



-----------------------------------------------
Robosoft Technologies - Come home to Technology

Disclaimer: This email may contain confidential material. If you were not an intended recipient, please notify the sender and delete all copies. Emails to and from our network may be logged and monitored. This email and its attachments are scanned for virus by our scanners and are believed to be safe. However, no warranty is given that this email is free of malicious content or virus.


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

Re: svn keyword expansion

Posted by Hari Kodungallur <hk...@gmail.com>.
On Jan 3, 2008 8:49 PM, Srilakshmanan, Lakshman <
lakshman.srilakshmanan@police.vic.gov.au> wrote:

> Hi Ryan,
>
> In the first email :
> >> then the Subversion client will
> >> transform '$Id:foo$' to '$Id$' before sending the file to the server,
>
> >> thus likely corrupting it if it is a binary file. The data has been
> >> changed before the file was sent to the repository, therefore there
> >> is no way to retrieve the original from the repository.
>
> May be its my misunderstanding, but from the text above, I understood
> the file is updated and the updated version is sent to the repository.
> That would indicate that the server would store the keyword expanded ?


Subversion will only store the keyword within $ signs (the string "$Id$" for
the Id keyword) on the server. What it means is that if the file already has
something like "$Id: <some text>$" when you set the svn:keywords, it will
delete ": <some text>" and then send the file over to the server. If the
file only has $Id$, then it will not do any modification.
[As you might have already read from the document, if there is no keyword
within $ sign within the file, then no modification is made.]

Once the initial modification is made, the actual expansion of the keyword
is made only on the client side. So in the case of an $Id$, then you will
only see $Id$ on the server (via web) and then on the client you will see it
expanded ($Id: <file revision..etc>$).

Regarding your original question, by some huge chance, if there was no
modification made to the word document by subversion, then accessing it via
web might be the work around. I am not sure, but may be svn cat
url://to/file/mydoc.doc > mydoc.doc will work.



>
>
> But in the next email you indicate :
> >> Therefore, it sees the file as it exists in the repository -- with
> keywords unexpanded. As
> >> you know, only a Subversion client performs the keyword
> >> expansion.
>
> So the question is
> A) does the server store the keyword *expanded*
> B) does the server store the keywords *unexpanded*
>
> If the answer is B) then the file should not be corrupted, as the
> keywords have not been expanded. That is, the expansion is performed
> when the client checks out the file.
>
> If the answer is A) then a browser should see the expanded keywords ?
>
> Could you please clarify my misreading.
>


Thanks,
-Hari

Re: svn keyword expansion

Posted by Erik Huelsmann <eh...@gmail.com>.
On 1/4/08, Henrik Sundberg <st...@gmail.com> wrote:
> 2008/1/4, Ryan Schmidt <su...@ryandesign.com>:
> > The only way I know of to retrieve the file with unexpanded keywords
> > as it exists in the repository is to host the repository with Apache
> > 2 and view the file in a web browser.
>
> Isn't it possible to just turn off the keyword handling for the file,
> before retrieval?

Sure it is: svn propdel svn:keywords <url-to-file>

It's final though.


I would recommend using fixed-length keywords with Word documents:
$Id::                           $ uses exactly that number of bytes.

bye,

Erik.

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

Re: svn keyword expansion

Posted by Henrik Sundberg <st...@gmail.com>.
2008/1/4, Ryan Schmidt <su...@ryandesign.com>:
> The only way I know of to retrieve the file with unexpanded keywords
> as it exists in the repository is to host the repository with Apache
> 2 and view the file in a web browser.

Isn't it possible to just turn off the keyword handling for the file,
before retrieval?
/$

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

Re: svn keyword expansion

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Jan 3, 2008, at 22:49, Srilakshmanan, Lakshman wrote:

> In the first email :
>
>>> then the Subversion client will
>>> transform '$Id:foo$' to '$Id$' before sending the file to the  
>>> server,

After some testing, I realize I was inaccurate here. When I said  
"$Id:foo$" I should have said "$Id: foo $".

>>> thus likely corrupting it if it is a binary file. The data has been
>>> changed before the file was sent to the repository, therefore there
>>> is no way to retrieve the original from the repository.
>
> May be its my misunderstanding, but from the text above, I understood
> the file is updated and the updated version is sent to the repository.
> That would indicate that the server would store the keyword expanded ?

Sorry, I was unclear. The repository stores the keywords unexpanded.  
The client normalizes the keywords to the unexpanded form before  
sending the file to the repository to be stored.


> But in the next email you indicate :
>
>>> Therefore, it sees the file as it exists in the repository -- with
>>> keywords unexpanded. As
>>> you know, only a Subversion client performs the keyword
>>> expansion.
>
> So the question is
> A) does the server store the keyword *expanded*
> B) does the server store the keywords *unexpanded*

It is B.


> If the answer is B) then the file should not be corrupted, as the
> keywords have not been expanded. That is, the expansion is performed
> when the client checks out the file.

Well... If the file you originally committed had the keywords  
unexpanded (e.g. "$Id$") then that's true: the file stored in the  
repository matches the file you had in your working copy before  
committing, and so the file in the repository is fine. After the  
commit, the client expands the keywords in the file in the working  
copy, so it becomes corrupted, possibly. If you use svn checkout or  
svn update or svn cat or svn export to retrieve the file from the  
repository, the keywords will be expanded, and the retrieved file  
will be corrupted, possibly.

However, if the file you originally committed had the keywords  
expanded (e.g. "$Id: something $") then the file in the repository  
will (possibly) be corrupted because "$Id: something $" will be  
converted by the client to "$Id$" before being stored in the repository.

The only way I know of to retrieve the file with unexpanded keywords  
as it exists in the repository is to host the repository with Apache  
2 and view the file in a web browser.


> If the answer is A) then a browser should see the expanded keywords ?

When viewed through a web browser, you see the file as it exists in  
the repository, with unexpanded keywords.


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

RE: svn keyword expansion

Posted by "Srilakshmanan, Lakshman" <la...@police.vic.gov.au>.
Hi Ryan,

In the first email : 
>> then the Subversion client will 
>> transform '$Id:foo$' to '$Id$' before sending the file to the server,

>> thus likely corrupting it if it is a binary file. The data has been 
>> changed before the file was sent to the repository, therefore there 
>> is no way to retrieve the original from the repository. 

May be its my misunderstanding, but from the text above, I understood
the file is updated and the updated version is sent to the repository.
That would indicate that the server would store the keyword expanded ?

But in the next email you indicate :
>> Therefore, it sees the file as it exists in the repository -- with
keywords unexpanded. As
>> you know, only a Subversion client performs the keyword 
>> expansion.

So the question is 
A) does the server store the keyword *expanded*
B) does the server store the keywords *unexpanded*

If the answer is B) then the file should not be corrupted, as the
keywords have not been expanded. That is, the expansion is performed
when the client checks out the file.

If the answer is A) then a browser should see the expanded keywords ?

Could you please clarify my misreading.


Thanks
lakshman
-----Original Message-----
From: Ryan Schmidt [mailto:subversion-2007b@ryandesign.com] 
Sent: Friday, 4 January 2008 3:13 PM
To: Srilakshmanan, Lakshman
Cc: users@subversion.tigris.org
Subject: Re: svn keyword expansion

On Jan 3, 2008, at 21:51, Srilakshmanan, Lakshman wrote:

> Ryan Schmidt wrote:
>
>> On Jan 3, 2008, at 19:58, Srilakshmanan, Lakshman wrote:
>>
>>> My understanding is that the svn keyword expansion is performed on 
>>> the client side.
>>>
>>> The above being the case, word doc files on the server should never 
>>> be corrupted due to keyword expansion related issues, because the 
>>> keywords are not expanded and stored on the server.
>>>
>>> Therefore, how can I retrieve a MSword file without a client 
>>> attempting to perform keyword substitution.
>>>
>>> I tried svn export http://.../ , alas that too substitutes keywords.
>>> I know this because I have a txt file and a MSword file in the same 
>>> directory.
>>>
>>> Any help is much appreciated.
>>>
>>> I am aware that keyword expansion is not supported for MSWord
>>> (binary) files http://svn.haxx.se/users/archive-2007-11/0801.shtml.
>>> I have *not* got my self into a strife, but was interested in having

>>> a work around for such an issue.
>>
>> Well...
>>
>> The client does the keyword substitution, yes. But it does so not 
>> only when checking out or updating a working copy, but also when 
>> committing.
>>
>> So, if your Word file contains the string '$Id:foo$', and "Id" is in 
>> this file's svn:keywords property, then the Subversion client will 
>> transform '$Id:foo$' to '$Id$' before sending the file to the server,

>> thus likely corrupting it if it is a binary file. The data has been 
>> changed before the file was sent to the repository, therefore there 
>> is no way to retrieve the original from the repository. Therefore you

>> must not set svn:keywords on binary files, unless you restrict 
>> yourself to the fixed-width keywords, which are meant to work fine in

>> binary files.
>> Assuming strings like '$Id$' do not otherwise appear in the file.
>
> When I look at my text file using the browser (IE) I don't see the 
> keyword expanded. I do however see the keyword substituted once I have

> checked it out using the client.
>
> Am I doing something wrong ?

Nope. That's just how it is. The web browser is not a Subversion client.
Therefore, it sees the file as it exists in the repository -- with
keywords unexpanded. As you know, only a Subversion client performs the
keyword expansion.

================================================================================================
EMAIL DISCLAIMER

This email and any attachments are confidential. They may also be subject to copyright.

If you are not an intended recipient of this email please immediately contact us by replying
to this email and then delete this email. 

You must not read, use, copy, retain, forward or disclose this email or any attachment.

We do not accept any liability arising from or in connection with unauthorised use or disclosure 
of the information contained in this email or any attachment.

We make reasonable efforts to protect against computer viruses but we do not accept liability
for any liability, loss or damage caused by any computer virus contained in this email.
================================================================================================

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


Re: svn keyword expansion

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Jan 3, 2008, at 21:51, Srilakshmanan, Lakshman wrote:

> Ryan Schmidt wrote:
>
>> On Jan 3, 2008, at 19:58, Srilakshmanan, Lakshman wrote:
>>
>>> My understanding is that the svn keyword expansion is performed  
>>> on the
>>> client side.
>>>
>>> The above being the case, word doc files on the server should  
>>> never be
>>> corrupted due to keyword expansion related issues, because the
>>> keywords are not expanded and stored on the server.
>>>
>>> Therefore, how can I retrieve a MSword file without a client
>>> attempting to perform keyword substitution.
>>>
>>> I tried svn export http://.../ , alas that too substitutes keywords.
>>> I know this because I have a txt file and a MSword file in the same
>>> directory.
>>>
>>> Any help is much appreciated.
>>>
>>> I am aware that keyword expansion is not supported for MSWord
>>> (binary) files http://svn.haxx.se/users/archive-2007-11/0801.shtml.
>>> I have *not* got my self into a strife, but was interested in  
>>> having a
>>> work around for such an issue.
>>
>> Well...
>>
>> The client does the keyword substitution, yes. But it does so not  
>> only
>> when checking out or updating a working copy, but also when  
>> committing.
>>
>> So, if your Word file contains the string '$Id:foo$', and "Id" is in
>> this file's svn:keywords property, then the Subversion client will
>> transform '$Id:foo$' to '$Id$' before sending the file to the server,
>> thus likely corrupting it if it is a binary file. The data has been
>> changed before the file was sent to the repository, therefore  
>> there is
>> no way to retrieve the original from the repository. Therefore you  
>> must
>> not set svn:keywords on binary files, unless you restrict yourself to
>> the fixed-width keywords, which are meant to work fine in binary  
>> files.
>> Assuming strings like '$Id$' do not otherwise appear in the file.
>
> When I look at my text file using the browser (IE) I don't see the
> keyword expanded. I do however see the keyword substituted once I have
> checked it out using the client.
>
> Am I doing something wrong ?

Nope. That's just how it is. The web browser is not a Subversion  
client. Therefore, it sees the file as it exists in the repository --  
with keywords unexpanded. As you know, only a Subversion client  
performs the keyword expansion.

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

RE: svn keyword expansion

Posted by "Srilakshmanan, Lakshman" <la...@police.vic.gov.au>.
Hi Ryan,

Thanks for your quick response.

When I look at my text file using the browser (IE) I don't see the
keyword expanded. I do however see the keyword substituted once I have
checked it out using the client.

Am I doing something wrong ?

Thanks
Lakshman
-----Original Message-----
From: Ryan Schmidt [mailto:subversion-2007b@ryandesign.com] 
Sent: Friday, 4 January 2008 1:40 PM
To: Srilakshmanan, Lakshman
Cc: users@subversion.tigris.org
Subject: Re: svn keyword expansion


On Jan 3, 2008, at 19:58, Srilakshmanan, Lakshman wrote:

> My understanding is that the svn keyword expansion is performed on the

> client side.
>
> The above being the case, word doc files on the server should never be

> corrupted due to keyword expansion related issues, because the 
> keywords are not expanded and stored on the server.
>
> Therefore, how can I retrieve a MSword file without a client 
> attempting to perform keyword substitution.
>
> I tried svn export http://.../ , alas that too substitutes keywords.  
> I know this because I have a txt file and a MSword file in the same 
> directory.
>
> Any help is much appreciated.
>
> I am aware that keyword expansion is not supported for MSWord
> (binary) files http://svn.haxx.se/users/archive-2007-11/0801.shtml.  
> I have *not* got my self into a strife, but was interested in having a

> work around for such an issue.
>

Well...

The client does the keyword substitution, yes. But it does so not only
when checking out or updating a working copy, but also when committing.

So, if your Word file contains the string '$Id:foo$', and "Id" is in
this file's svn:keywords property, then the Subversion client will
transform '$Id:foo$' to '$Id$' before sending the file to the server,
thus likely corrupting it if it is a binary file. The data has been
changed before the file was sent to the repository, therefore there is
no way to retrieve the original from the repository. Therefore you must
not set svn:keywords on binary files, unless you restrict yourself to
the fixed-width keywords, which are meant to work fine in binary files.
Assuming strings like '$Id$' do not otherwise appear in the file.

================================================================================================
EMAIL DISCLAIMER

This email and any attachments are confidential. They may also be subject to copyright.

If you are not an intended recipient of this email please immediately contact us by replying
to this email and then delete this email. 

You must not read, use, copy, retain, forward or disclose this email or any attachment.

We do not accept any liability arising from or in connection with unauthorised use or disclosure 
of the information contained in this email or any attachment.

We make reasonable efforts to protect against computer viruses but we do not accept liability
for any liability, loss or damage caused by any computer virus contained in this email.
================================================================================================

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


Re: svn keyword expansion

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Jan 3, 2008, at 19:58, Srilakshmanan, Lakshman wrote:

> My understanding is that the svn keyword expansion is performed on  
> the client side.
>
> The above being the case, word doc files on the server should never  
> be corrupted due to keyword expansion related issues, because the  
> keywords are not expanded and stored on the server.
>
> Therefore, how can I retrieve a MSword file without a client  
> attempting to perform keyword substitution.
>
> I tried svn export http://…/ , alas that too substitutes keywords.  
> I know this because I have a txt file and a MSword file in the same  
> directory.
>
> Any help is much appreciated.
>
> I am aware that keyword expansion is not supported for MSWord  
> (binary) files http://svn.haxx.se/users/archive-2007-11/0801.shtml.  
> I have *not* got my self into a strife, but was interested in  
> having a work around for such an issue.
>

Well...

The client does the keyword substitution, yes. But it does so not  
only when checking out or updating a working copy, but also when  
committing.

So, if your Word file contains the string '$Id:foo$', and "Id" is in  
this file's svn:keywords property, then the Subversion client will  
transform '$Id:foo$' to '$Id$' before sending the file to the server,  
thus likely corrupting it if it is a binary file. The data has been  
changed before the file was sent to the repository, therefore there  
is no way to retrieve the original from the repository. Therefore you  
must not set svn:keywords on binary files, unless you restrict  
yourself to the fixed-width keywords, which are meant to work fine in  
binary files. Assuming strings like '$Id$' do not otherwise appear in  
the file.


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