4
votes

I am implementing a source control system in Visual Studio 2010 without using the Team Foundation Server. To achieve this goal I chose AnkhSVN as subversion plug-in in Visual Studio 2010 and VisualSVN Server as source repository server (I do not use its client).

All the setup was successful, I created a repository in VisualSVN and I activated the AnkhSVN plug-in in VisualStudio 2010.

According to the best practices in source control, I would like to have for every solution added to subversion repository, a subfolder structure "branches/tags/trunk", as shown here:

RepositoryFolder  
  Solution1  
    Branches  
    Tags  
    Trunk  

  Solution2  
    Branches
    Tags
    Trunk
...

VisualSVN server, when creating the subversion repository, asks whether you want to have this "branches/tags/trunk" subfolder structure. Let's assume the repository is empty, VisualSVN places this 3 subfolders under the repository folder.

When I use AnkhSVN under Visual Studio 2010 to add a solution to the repository, it creates a new folder for the solution under the repository folder. Visual Studio asks me if I want to create just the trunk folder. I will therefore end up with a structure like this:

RepositoryFolder
  Branches
  Tags
  Trunk
  Solution1
    Trunk

That obviously is not what I wan. How can I set up both VisualSVN and AnkhSVN to automatically create (and retrieve) a "branches/tags/trunk" structure underneath every solution added from Visual Studio?

Thanks

Francesco

2

2 Answers

1
votes

How can I set up both VisualSVN and AnkhSVN to automatically create (and retrieve) a "branches/tags/trunk" structure underneath every solution added from Visual Studio?

You can't do it (at least for VisualSVN Server, not just "VisualSVN", which is Subverson-plugin for Visual Studio): server can automatically add only one conventional tree: in the root of repo

0
votes

You can use VisualSVN Server's WMI provider to code a script which will pre-create any repository / project structure you want. However, the task requires access to the sever machine (i.e. the account under which the script runs, must have enough permissions to administer VisualSVN Server remotely).

You can write a script to manage VisualSVN Server and it's repositories (locally or remotely) on a different languages. MOF file which describes the VisualSVN Server's WMI provider (i.e. it's interface) resides in the following folder %VISUALSVN_SERVER%WMI on the machine where VisualSVN Server is installed.

For example, VisualSVN Server's WMI provider allows you to create a repository with a pre-defined structure and pre-defined hook scripts as well as with authorization settings already in-place.

  • In order to create a repository, you can use Create method of VisualSVN_Repository class,
  • CreateFolders method can be used to commit a new project structure or a single folder.