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

Re: Script or process to fix old invalid data in repositories or dumps?

From: Mark Phippard <markphip_at_gmail.com>
Date: Sat, 5 Apr 2014 10:58:59 -0400

On Sat, Apr 5, 2014 at 7:12 AM, Daniel Shahaf <d.s_at_daniel.shahaf.name>wrote:

> Mark Phippard wrote on Fri, Apr 04, 2014 at 13:30:48 -0400:
> > So I realize I can use that option to force the file to load, but that is
> > just punting the problem to the future. Has anyone ever written any
> > scripts that can run through an entire repository and fix these sort of
> > problems? In this case, maybe a script that goes through a repos and
> > retrieves and then sets each revprop using the current command line?
>
> That's easy enough:
>
> [[[
> #!/usr/bin/env zsh
> #
> # Renormalize svn:* revprops in repository $1 (local path).
> #
> set -e
> [ $# -eq 1 ] && [ -d "$1" ] || { echo "Usage: $0 REPOS" >&2; exit 1 }
> REPOS=$1
> ABS_REPOS=`cd -- "$REPOS" && pwd`
> for revnum in {0..`svnlook youngest -- "$REPOS"`};
> for prop in $(svnlook proplist -r$revnum --revprop -- "$REPOS" | cut
> -c3- | grep '^svn:');
> svnadmin setrevprop -r$revnum -- "$REPOS" "$prop" =(svn propget
> --strict --revprop -r$revnum -- "$prop" "file://$ABS_REPOS")
> ]]]
>

Thanks. I first ran svnsync and that worked and it said that it fixed 3
revision properties.

I then went back and ran your script on the source repository. This is
what it output:

svnlook: E135000: Inconsistent line ending style
svnlook: E135000: Inconsistent line ending style
svnlook: E135000: Inconsistent line ending style

Do you think that means the script would have fixed those three properties,
or did svnlook fail to list them because of the line endings?

-- 
Thanks
Mark Phippard
http://markphip.blogspot.com/
Received on 2014-04-05 16:59:35 CEST

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

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