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

Re: Retroactively adding versioned properties to files in a dumpfile

From: Ryan Schmidt <subversion-2008c_at_ryandesign.com>
Date: Tue, 23 Sep 2008 03:03:33 -0500

On Sep 21, 2008, at 7:16 PM, Martin Furter wrote:

> On Sun, 21 Sep 2008, Ryan Schmidt wrote:
>
>> On Sep 21, 2008, at 6:54 PM, Martin Furter wrote:
>>
>>> Please try the new svndumptool command 'apply-autoprops'. I hope
>>> it does what you want (you need trunk).
>>> svndumptool.py apply-autoprops input.dmp output.dmp

[snip]

>> Will this also handle eol transformations, or do I need to
>> separately use svndumptool.py eolfix?

[snip]

> I always wanted to redesign svndumptool to be able to chain
> commands, but that's not done yet.
>
> So you still have to run it once for each command you need.

I realize there's no command chaining, but I was thinking of this
scenario:

I add a DOS text file foo.txt to a repository. It has CRLF line
endings. I apply no properties to the file before committing it.

Later I add the auto-props rule "*.txt = svn:eol-style=native" to my
config file. That's great for new files but I'd like old files to
have the correct line endings too, even when looking at historical
versions.

svndumptool 0.5.0 already has the function "eolfix" so I can fix this
by dumping the repository and running:

$ svndumptool.py eolfix --fix=CRLF --eol-style=native --regexp='\.txt
$' repo.dump eolfix.dump

If I examine the difference between these dumps, I see that the
property has been added and the content of the files has been changed
(the line endings have presumably been changed from CRLF to LF):

$ svndumptool.py diff repo.dump eolfix.dump
Comparing
   dump1: 'repo.dump'
   dump2: 'eolfix.dump'
Revision: 1/1
   Node: add file 'foo.txt' (0/0)
     Properties:
+ Property 'svn:eol-style' missing in dump1
         dump2: 'native'
+ Different TextLen:
       dump1: '14'
       dump2: '12'
+ Different TextMD5:
       dump1: '7ac062d8a84466e70d9b899c0821a51c'
       dump2: '0f723ae7f9bf07744445e93ac5595156'
+ Text differs (type 'Text')
Revision: 2/2
   Node: change file 'foo.txt' (0/0)
+ Different TextLen:
       dump1: '32'
       dump2: '27'
+ Different TextMD5:
       dump1: '70c9e53fc3a0a449255aa3cbc7b61b1a'
       dump2: '62f7f37725498bb4c31353fc49d0d107'
+ Text differs (type 'Text')
Done, found diffs.
   type total showed
   Text 2 2
   PropMissing 1 1
   TextMD5 2 2
   TextLen 2 2
$

This seems to do what I need, however it is tedious to specify line
ending styles and regular expressions on the command line. I've
already defined in my auto-props what files I want to have what line
endings.

Now you have a new command "apply-autoprops" which seems like it
would be a much easier way to do the same thing (and much more):

$ svndumptool.py apply-autoprops repo.dump autoprops.dump

However, it only applies the property; it does not normalize the line
endings in the file to LF:

$ svndumptool.py diff repo.dump autoprops.dump
Comparing
   dump1: 'repo.dump'
   dump2: 'autoprops.dump'
Revision: 1/1
   Node: add file 'foo.txt' (0/0)
     Properties:
+ Property 'svn:eol-style' missing in dump1
         dump2: 'native'
Done, found diffs.
   type total showed
   PropMissing 1 1
$

I was under the impression that if a file in the repository has the
svn:eol-style property set (to any value), then the file in the
repository must have only LF line endings. So my hope was that when
"apply-autoprops" encounters the svn:eol-style property, it would
automatically perform the "eolfix" function.

However I will say that loading autoprops.dump into a new repository
with Subversion 1.5.2 worked fine, as did checking it out, and the
file in the working copy had LF line endings like it should (I'm on
Mac OS X where LF is the native line ending style).

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: users-help_at_subversion.tigris.org
Received on 2008-09-23 10:04:01 CEST

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.