自动添加“分支/标签/主干”使用 VisualStudio 2010 的 VisualSVN 服务器将文件夹复制到 AnkhSVN?
我正在 Visual Studio 2010 中实现源代码控制系统,而不使用 Team Foundation Server。为了实现这个目标,我选择 AnkhSVN 作为 Visual Studio 2010 中的 subversion 插件,并选择 VisualSVN Server 作为源存储服务器(我不使用它的客户端)。
所有设置都很成功,我在 VisualSVN 中创建了一个存储库,并在 VisualStudio 2010 中激活了 AnkhSVN 插件。
根据源代码控制的最佳实践,我希望为添加到 subversion 存储库的每个解决方案添加一个子文件夹结构 < strong>“branches/tags/trunk”,如下所示:
RepositoryFolder
Solution1
Branches
Tags
Trunk
Solution2
Branches
Tags
Trunk
...
VisualSVN服务器在创建subversion存储库时,询问您是否想要这个“branches/tags/trunk”子文件夹结构。假设存储库是空,VisualSVN 将这 3 个子文件夹放置在存储库文件夹下。
当我在 Visual Studio 2010 下使用 AnkhSVN 将解决方案添加到存储库时,它会在存储库文件夹下为该解决方案创建一个新文件夹。 Visual Studio 询问我是否只想创建 trunk 文件夹。因此,我最终会得到这样的结构:
RepositoryFolder
Branches
Tags
Trunk
Solution1
Trunk
这显然不是我想要的。如何设置 VisualSVN 和 AnkhSVN 以自动创建(和检索)从 Visual Studio 添加的每个解决方案下的“分支/标签/主干”结构?
谢谢
弗朗西斯科
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你做不到(至少对于 VisualSVN Server 而言,不仅仅是“VisualSVN”,它是 Visual Studio 的 Subverson 插件):服务器只能自动添加一棵常规树:在存储库的根目录中
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
您可以使用 VisualSVN Server 的 WMI 提供程序 编写一个脚本,该脚本将预先创建任何您想要的存储库/项目结构。但是,该任务需要访问服务器计算机(即运行脚本的帐户必须具有足够的权限来远程管理 VisualSVN Server)。
您可以编写脚本来使用不同的语言管理 VisualSVN Server 及其存储库(本地或远程)。描述 VisualSVN Server 的 WMI 提供程序(即它的接口)的 MOF 文件位于安装 VisualSVN Server 的计算机上的以下文件夹
%VISUALSVN_SERVER%WMI
中。例如,VisualSVN Server 的 WMI 提供程序允许您创建具有预定义结构和预定义挂钩脚本以及已就位的授权设置的存储库。
VisualSVN_Repository
类的Create
方法,CreateFolders
方法可用于提交新的项目结构或单个文件夹。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.
Create
method ofVisualSVN_Repository
class,CreateFolders
method can be used to commit a new project structure or a single folder.