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

Re: New file svn-restore-dumps.py

From: Mark Stead <mark_at_stead.id.au>
Date: Fri, 13 Mar 2009 09:20:38 +1100

Ok, substantial changes. I've attached a patch, plus the whole file.
Comments below.

2009/3/12 Martin Furter <mf_at_rola.ch>

> I didn't want to wait a night just to test it, so I replaced the
> "svnadmin load repospath" by "wc -l". But that lead to the following error
> on solaris:
> IOError: [Errno 11] Resource temporarily unavailable

That's strange. Maybe the InputPipe classes are not working on
Solaris/Unix. I've only been able to test on Windows - and there is a
separate chunk of code for Unix. Please advise me if you have had success
or problems on Unix.

> So I just commented out the whole command to find the following:
> 1) It is a bit too verbose, I got tons of "Ignoring dump file..." messages,
> especially many for other repositories. Would be nice if those aren't
> printed, except maybe when a new option '-v' is specified.

Verbose mode added. Also added some additional diagnostics - when in
verbose mode.

> 2) I got an endless loop because nothing is loaded into the repository and
> then the HEAD revision does not increase.

Yeah, this is a quirk with how SVN operates. A new repository will have a
revision of 0. Applying that dump of revision 0 to a new repository leaves
the revision unchanged.

> The script scans the directory over and over until it doesn't find any
> matching dumpfiles anymore. It would be better to scan the directory once
> and store the list of dumps found in a list. Also the HEAD revision of the
> repository can be read only once at the start of the script, since if
> svnadmin fails the script will detect it, and if the dumps are labeled wrong
> bad things happen anyway.
> So I propose to change it this way:
> - Read HEAD revision of the repos.
> - Scan for dump files to load and put them into a list.
> - Load all dump files.

I've done the restructure. It scans the dumps, building a dict() keyed on
the first revision number. It then loads the required dumps.

Regarding the revision 0 quirk. You can in-practice load revision 0 or
revision 1 against a new repository. My script currently requires a dump
file corresponding to revision 0 when the head revision is 0. If you have
dumps 0, 1, 2 etc in separate files, then it will load them all. If on the
other hand, you only have dumps 1,2 etc, then it will complain that it can't
find a dump for revision 0.

I don't think this is an unreasonable requirement. Mind you I don't know if
the dump for revision 0 can contain anything significant anyway.


Received on 2009-03-12 23:27:23 CET

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