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

Re: Create new repos rev 1 from existing repos revision

From: Mark Clements <gmane_at_kennel17.co.uk>
Date: 2006-11-20 23:08:58 CET

"Ryan Schmidt" <subversion-2006d@ryandesign.com> wrote in message
news:4332746C-345C-4BD9-9457-84A354B692BA@ryandesign.com...
> On Nov 16, 2006, at 11:58, Mark Clements wrote:
>
> > OK - I see how this works, but it's quite a bit of work to redo
> > whenever the
> > default setup changes. Not sure how often that will happen but it
> > could be
> > an issue. Is there maybe some way of doing this by playing with the
> > relocate/switch statement? The currently proposed solutions are not
> > currently simple enough for my purpose - I want to be able to have a
> > 'default_repo' that gets tweaked and modified as required, and for my
> > createrepo script to seed a new repository with revision 1 that
> > matches the
> > head of default_repo, with no user intervention required.
> >
> > If that is not possible, then I will probably get my script to
> > manually
> > construct the first revision in a temporary working copy, commit
> > that and
> > delete it. This would mean that any modifications would need to be
> > made
> > directly in my setup script rather than in a versioned repository,
> > but this
> > is probably the simplest solution if I can't automate the above.
>
> Have you tried the "dump head revision / load" strategy someone
> mentioned? I think it works and it's easy:
>
> svnadmin create /path/to/newrepo
> svnadmin dump -rHEAD /path/to/oldrepo \
> | svnadmin load /path/to/newrepo

Hi - yes I tried that. This successfully creates a new repo with the same
file contents/dir structure, but:

1) The properties I had set on the root folder did not survive (although
properties on other folders did).
2) The author/date/log message were all taken from the old repo's head
revision. I would like Author:"Setup", Date:now, Msg:"Default repository
structure created."

My current solution seems to work. I have two folders in my svn root (which
has sub-directories contains various svn related things, and is not in
itself a repository), 'default_repo' and 'default_props'. default_repo is a
directory structure containing the default files/folders for a new
repository. My createrepo script, after creating the repo, checks it out
copies that folder into the root and svn adds it. It then recurses through
each file in default_props and creates a new property on the root folder
where the propname is the file name and the propvalue is the file's
contents. Finally it commits the changes as rev1 with an appropriate log
message.

This works fine for my current setup (e.g. no file/folder properties) but if
those requirements change I may need to use the dump/load technique with a
subsequent modification of the revision properties to reflect the correct
details (which also requires modifying my pre-revprop-change script), and
then use my default_props folder to populate the root folder properties. A
bit more work, but would probably do the job.

Ah well - thanks (everyone!) for all your help. I'll let you know if I come
back to this problem any time in the future.

- Mark Clements (HappyDog)

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Mon Nov 20 23:09:52 2006

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.