Question

Is there a simple way to check out every revision in Subversion? Currently, if I wanted to do this, I would have to check out each revision individually.

To answer the inevitable "why do you need this?", I'm going to be working with an offline computer and want to be able to test old code states without connecting to the internet. I may not need to go back all the way, but I'd still like to have all revisions in case I do.

Était-ce utile?

La solution 2

I will strongly recommend you to make use of GIT.

By making use of git-svn, you will be able to clone the svn repository, get every revision and make a corresponding GIT repository.

With the GIT repo containing all version, you can do whatever you want in that offline computer.

Autres conseils

You can use svnsync to clone the repository locally. svnsync doesn't need any additional level of access than what you already have and you'll end up with a full copy of the repository. Note that if the repository is large this could take some time.

svnsync is documented in the svnbook here: http://svnbook.red-bean.com/en/1.7/svn.ref.svnsync.html

The general process will be.

Create a new repository:

svnadmin create mirror

Initialize the sync (where URL is your Google code repository root):

svnsync initialize file://`pwd`/mirror $URL --source-username user --source-password pass

You can then update the sync to match the current repo with:

svnsync synchronize file://`pwd`/mirror

Note that the file I'm using the pwd command in the URL you can use the full path if you want so you don't necessarily have to stay in the same directory.

You can then relocate your existing working copy to use your local mirror with (where WC is your working copy path and URL is the URL to the Google code repo):

 svn switch --relocate $URL file://`pwd`/mirror $WC

Returning back to the Google Code repository is then as simple as (where URL is the URL to your Google code repo):

svn switch --relocate file://`pwd`/mirror $URL $WC

If you want to continue syncing from the Google code repo I wouldn't commit. However, if you had no intention of updating you could commit and then do a svnadmin dump limited to the versions you changed on your local repo and use svnrdump load to send them to the Google code server.

git-svn is another option. But the above should be able to be done with an existing installation of SVN.

Not as nice of a solution as Adrian Shum's, but if you really prefer to stick with SVN, you could also use svnsync. From Stefan's answer on stackoverflow:

First, create a fresh repository on your home machine.

svnadmin create c:\backuprepo

Next, create a file named pre-revprop-change.bat:

echo exit 0 > c:\backuprepo\hooks\pre-revprop-change.bat

then, initialize the sync:

svnsync init file:///c:/backuprepo https://url/of/your/repository

After that, you can simply run

svnsync sync file:///c:/backuprepo

once a day or so, and you'll get only those changes which are not yet in your backup repository. The first time it will take a while, but after you've synchronized your backup repository with the real one, it will only take a few seconds to sync it because only those revisions that are new need to be synched.

The tool rsvndump fulfills exactly this purpose.

Answer on asked question

You can use svn export 1-st form in oder to export to unversioned tree state of repo in any revision. From svn help export

export [-r REV] URL[@PEGREV] [PATH]
...
Exports a clean directory tree from the repository specified by
URL, at revision REV if it is given, otherwise at HEAD, into
PATH.

You can easy code simplest script, which run across all revisions in repo and perform exports into change changing destination path

Answer on not asked question "How to clone any remote repo"

In Subversion 1.7.* new management-tool was added: svnrdump, which allow perform svnadmin dump|load, but for remote repositories.

In your case you:

  • create local repo in TortoiseSVN
  • load dump of CG-repo (full dump of maybe only trunk part)
  • svnadmin load dump into repo
  • switch your current WC to new repo or checkout from local into new WC (and in any case have full history in traditional way)

Final note about svnrdump

Svnrdump is part of client-side tools in Subversion 1.7.X. Any 1.7 client can freely communicate with 1.6 server without problems

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top