Question

Here is the scenario. In a svn repository, there are multiple folders under same folder tree. Say structure is as:

ProjectA
 |
 | - Folder1
 | - Folder2

Now in a separate folder tree:

ProjectB
 | - FromExternalProject (needs all contents of Folder1 & Folder2 in ProjectA)

Preferably all content should remain at same folder level as externals. Using file externals is one options, but there are too many files (almost 25). We cannot have multiple folder externals from the same folder, can we? Is there any other way to achieve this?

Was it helpful?

Solution

File externals was my initial idea and 25 files are not really that much. You set it up once and then just use it.

Another option would be to use client side hook scripts. Tortoise SVN client supports several of them. SVN client would work with files in their original folders, and hook scripts would synchronize these files with the corresponding files in your work folder in pre-commit, pre-update, and post-update scripts. Update phase would look like this:

  • pre-update: copy files from FromExternalProject to Folder1 and Folder2
  • post-update: copy files from Folder1 and Folder2 to FromExternalProject

Commit phase would look like this:

  • pre-commit: copy files from FromExternalProject to Folder1 and Folder2

There's no need for post-commit hook.

Yet another option would be to use features of the file system, like symbolic links in Windows and Linux. The case is identical to the previous one, but without the previous hooks, because the files are already synchronized (because they are the same files on the disk). You still need to create the links after the checkout, either manually running a script once, or in a post-update hook script.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top