user1131435
user1131435

Reputation:

Checkout each subversion revision into its own directory?

I want to checkout each revision of an SVN archive to its own directory.

My poorly worded last question prompted answers telling me to create a duplicate SVN repository, however, this is explicitly NOT what I want.

I'm not looking for a duplicated SVN archive - each revision specifically must go in its own folder.

Upvotes: 0

Views: 49

Answers (1)

prodigitalson
prodigitalson

Reputation: 60413

Im not sure why you would want to do this but it should be pretty easy to write some kind of script to do it. You just need to figure out that the HEAD revision number is and then script the checkouts. For example with php (cause its the easiest to write off the top of my head):

$head = 5042;
$base = 1;
$basepath = "/path/to/folder";
$svnbin = '/usr/bin/svn';
$svnurl = 'http://svn.whatever.com/path/to/repo';

$cmdtpl = "$svnbin co -r%d $svnrl %s";

for ($n = $base; $n <= $head; $n++) {
   $dir = $basepath . '/r' . $n; // folders names like r1, r2, etc.
   $cmd = sprintf($cmdtpl, $n, $dir);

   exec($cmd, $out, $ret);

   // blow up if it fails!
   if($ret) {
      throw new Exception("Command ($cmd) failed with return value \"$ret\".");
   }

}

Upvotes: 1

Related Questions