Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SVN - how to transform individually checked-out sub-folders into sparse checkout

SVN repo looks like this:

top/
top/one
top/two
top/three
...etc

You don't want to checkout the entire top folder but you don't know about SVN's sparse checkout feature.
So you check-out repo folder top/one into C:\svn\top\one and then you checkout repo folder top/two into C:\svn\top\two

At this point, both of the checked-out folders have their own .svn folder

Then you discover sparse checkouts.

QUESTION

How do you transform the "standalone" checkout of these two folders into a sparse checkout of the top-level folder with minimal re-checking out?

Is it as simple as initiating a sparse check-out while not overwriting existing items and then simply deleting the pre-existing .svn folders?

like image 940
Bob Avatar asked Mar 16 '17 16:03

Bob


People also ask

How do I checkout a single directory in SVN?

Open the Repository Browser: Right-Mouse Button (RMB) on the newly created folder ==> TortoiseSVN ==> Repo-browser (or immediately Update to revision on a subfolder). Navigate to the folder you want to checkout completely. Press RMB on that subfolder, and select 'Update item to revision'. Press OK.

How do I checkout with TortoiseSVN?

Right-click on the folder and the Explorer context menu will appear, along with some new TortoiseSVN commands. Select SVN Checkout…' From here you can set the following properties: URL of Repository — the URL of the repository you wish to check out.

What is SVN depth?

Depth allows working copies to have exactly the contents the user wants, leaving out everything else. 1. Design ========= We have a new "depth" field in . svn/entries, which has (currently) four possible values: depth-empty, depth-files, depth-immediates, and depth-infinity.


1 Answers

SVN works recursively, which means that every folder is mostly independent from its parent. So the issue comes from the .SVN in the parent folder, this is the one you want to recreate from scratch.

Rename your former folder (.old) and create a new one. Do your Sparse Checkout in that folder. It should download the files but you can prevent that with --depth empty.

Then, move your old folders back in the freshly created Sparse Checkout folder and Clean it. SVN will scan and repair the folder recursively.

like image 83
Guillaume F. Avatar answered Oct 04 '22 21:10

Guillaume F.