Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Unfortunately, I don't have a fully automated solution for you but one way to figure out what files are versioned in a repository is using the <em>list</em> command with the command-line tool:</p> <pre><code>svn.exe list -R </code></pre> <p>That command will recursively list all files that are versioned by SVN in the current directory. Once you have that list you can copy them to another directory and batch-commit them to a new repository.</p> <p>Combining that command with some <a href="http://technet.microsoft.com/en-us/scriptcenter/dd742419.aspx" rel="nofollow noreferrer">Powershell</a> magic would probably make the task of recreating the repositories as painless as possible.</p> <p><strong>Update:</strong></p> <p>I spent some time playing with Powershell and figured out how you could do this. For the example I am about to explain the original repository directory is C:\source_repos\ and the new repository directory is C:\dest_repos\.</p> <p><ol> <li> Open a command prompt. This can be done through the Accessories start menu folder or by running "cmd" from search box in Vista/Win7 or the Run... in WinXP. </li></p> <p><li> From the command prompt run the following commands:</p> <pre><code>cd C:\source_repos\ echo File &gt; filelist.csv svn.exe list -R &gt;&gt; filelist.csv </code></pre> <p>The second command creates filelist.csv with the first line containing the word "File". The third command runs the svn list command and redirects the output to append to filelist.csv. At this point filelist.csv should have "File" on the first line followed by every file versioned in your svn directory listed on individual lines. </li> </p> <p><li> Take the code below and paste it into a file called reposcopy.ps1:</p> <pre><code># Assumptions / Notes: # - No crazy file names with "\" in them! # - A file named filelist.csv was created by running: # svn.exe list -R &gt;&gt; filelist.csv # and is in the base directory of the source repository. # - The first line of filelist.csv is "File" without quotes, this is # important for the Import-Csv command # - If you get an error about permissions when you try to run the script, # use the command "Set-ExecutionPolicy RemoteSigned" in the powershell # Source &amp; destination repository directories $src = "C:\source_repos\" $dest = "C:\dest_repos\" # Get current directory $origdir = Get-Location # Goto source repository directory Set-Location $src # Check if destination repository directory exists, if not create it if (![IO.Directory]::Exists($dest)) { [IO.Directory]::CreateDirectory($dest) } # Import filelist.csv created with these commands at a command prompt: # cd C:\source_repos # echo File &gt; filelist.csv # svn.exe list -R &gt;&gt; filelist.csv $filelist = Import-Csv filelist.csv # Go through each line in the filelist foreach ($line in $filelist) { # Concatenate the filename with the source and destination directories $srcfile = [String]::Concat($src, $line.File) $destfile = [String]::Concat($dest, $line.File) # If the destination file is a directory and it doesn't exist create it # Otherwise copy the source file to the destination. if ($destfile.EndsWith("\")) { if (![IO.Directory]::Exists($destfile)) { [IO.Directory]::CreateDirectory($destfile) } } else { Copy-Item $srcfile $destfile } } # Go back to the original directory Set-Location $origdir </code></pre> <p>You will need to modify the <code>$src</code> and <code>$dest</code> variables for each run. </li></p> <p><li> Open Powershell (it can be found in Accessories on Vista/Win7 or Powershell in WinXP). Go to the directory where you saved the above script and run it. If you get an error that mentions "execution of scripts is disabled on this system", run</p> <pre><code>Set-ExecutionPolicy RemoteSigned </code></pre> <p>in the powershell to enable local scripts to run without being signed. </li> </ol>That should do it. If all went well you should be able to go to <code>C:\dest_repos\</code> and <code>svn add</code> all the files to the new repository and <code>svn commit</code> them.</p> <p>If you run into any questions about what I've tried to explain or encounter any odd errors, let me know. I did superficial testing of the script but it's quite possible I forgot some edge cases.</p> <p>Good luck on getting your repositories restored!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload