简体   繁体   English

将 SVN 与 TFS 集成

[英]Integrating SVN with TFS

Is there any recommendable solution to integrate SVN with TFS 2013 in a sense that SVN is being used for source control and TFS for work item tracking?从某种意义上说,SVN 用于源代码控制和 TFS 用于工作项跟踪,是否有任何可推荐的解决方案将 SVN 与 TFS 2013 集成?

For example, it should be possible to link commits in SVN to work items in TFS.例如,应该可以将 SVN 中的提交链接到 TFS 中的工作项。

You can use Integration with Bug Tracking Systems / Issue Trackers : http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-bugtracker.html您可以使用Integration with Bug Tracking Systems / Issue Trackershttp : //tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-bugtracker.html

It is very common in Software Development for changes to be related to a specific bug or issue ID.在软件开发中,更改与特定错误或问题 ID 相关是很常见的。 Users of bug tracking systems (issue trackers) would like to associate the changes they make in Subversion with a specific ID in their issue tracker.错误跟踪系统(问题跟踪器)的用户希望将他们在 Subversion 中所做的更改与其问题跟踪器中的特定 ID 相关联。 Most issue trackers therefore provide a pre-commit hook script which parses the log message to find the bug ID with which the commit is associated.因此,大多数问题跟踪器都提供了一个预提交钩子脚本,该脚本解析日志消息以查找与提交相关联的错误 ID。 This is somewhat error prone since it relies on the user to write the log message properly so that the pre-commit hook script can parse it correctly.这有点容易出错,因为它依赖于用户正确写入日志消息,以便预提交钩子脚本可以正确解析它。

TortoiseSVN can help the user in two ways: TortoiseSVN 可以通过两种方式帮助用户:

  1. When the user enters a log message, a well defined line including the issue number associated with the commit can be added automatically.当用户输入日志消息时,可以自动添加包含与提交关联的问题编号的明确定义的行。 This reduces the risk that the user enters the issue number in a way the bug tracking tools can't parse correctly.这降低了用户以错误跟踪工具无法正确解析的方式输入问题编号的风险。

  2. Or TortoiseSVN can highlight the part of the entered log message which is recognized by the issue tracker.或者 TortoiseSVN 可以突出显示问题跟踪器识别的输入日志消息的部分。 That way the user knows that the log message can be parsed correctly.这样用户就知道可以正确解析日志消息。

When the user browses the log messages, TortoiseSVN creates a link out of each bug ID in the log message which fires up the browser to the issue mentioned.当用户浏览日志消息时,TortoiseSVN 会根据日志消息中的每个错误 ID 创建一个链接,从而启动浏览器到提到的问题。

Go through mentioned URL for detailed description.通过提到的 URL 进行详细说明。

https://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-bugtracker.html describes how to configure folders in TortoiseSVN to do a one-way integration between file versions committed in TortoiseSVN, and work items in TFS. https://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-bugtracker.html描述了如何在 TortoiseSVN 中配置文件夹以在 TortoiseSVN 中提交的文件版本和 TFS 中的工作项之间进行单向集成。 When a developer commits the file version, he/she is prompted for the TFS work item number (which works fine if the developer knows the number).当开发人员提交文件版本时,系统会提示他/她输入 TFS 工作项编号(如果开发人员知道该编号,则工作正常)。 It even creates a link to the TFS work item in the Revision Log of the file in TortoiseSVN.它甚至会在 TortoiseSVN 文件的修订日志中创建一个指向 TFS 工作项的链接。 However, it does not display a list of work items for the developer to choose from, nor is there any link in the TFS work item going back to the committed file version in TortoiseSVN.但是,它不会显示供开发人员选择的工作项列表,TFS 工作项中也没有返回到 TortoiseSVN 中提交的文件版本的任何链接。 (It is possible to write an issue tracker plug-in for TFS to do this, but all the plug-ins I have found on the internet seem to be for older versions of TFS.) (可以为 TFS 编写一个问题跟踪器插件来执行此操作,但我在互联网上找到的所有插件似乎都是针对旧版本的 TFS。)

This integration will insert the bug number into the Revision Log of committed source files, and will add a link from the log to the selected bug in TFS.此集成将错误号插入到已提交源文件的修订日志中,并将添加从日志到 TFS 中选定错误的链接。 Although you make this change inside your working copy, it will apply to the same folder in other working copies once those working copies have been updated.尽管您在工作副本中进行了此更改,但一旦这些工作副本更新,它将应用于其他工作副本中的同一文件夹。

To associate a folder tree in TortoiseSVN to TFS: 1. Right-click on the folder in your working copy.要将 TortoiseSVN 中的文件夹树关联到 TFS: 1. 右键单击​​工作副本中的文件夹。 This should be at the apex of the folder tree you want to associate with a project in TFS.这应该位于您要与 TFS 中的项目关联的文件夹树的顶端。 Select TortoiseSVN > Properties.选择 TortoiseSVN > 属性。 2. On the Properties - TortoiseSVN window, check to see whether there are any bugtraq properties for this folder. 2. 在 Properties - TortoiseSVN 窗口中,检查该文件夹是否有任何 bugtraq 属性。 If not, click New > Bugtraq (issue tracking integration).如果没有,请单击新建 > Bugtraq(问题跟踪集成)。 3. The Edit Bugtraq Properties - TortoiseSVN window opens. 3. 编辑 Bugtraq 属性 - TortoiseSVN 窗口打开。
a.一种。 For Issue tracker URL, specify the URL to your work items: http://tfs_server_name:8080/tfs/DefaultCollection/TFS_Project_Name/_workitems?id=%BUGID%&_a=edit b.对于问题跟踪器 URL,指定工作项的 URL: http://tfs_server_name:8080/tfs/DefaultCollection/TFS_Project_Name/_workitems?id=%BUGID%&_a=edit b。 Next, place a check in the "Remind me to enter a bug-ID" checkbox.接下来,勾选“提醒我输入错误 ID”复选框。 c. C。 For Message Pattern, specify something like: TFS Work Item: %BUGID% d.对于消息模式,指定如下内容:TFS 工作项:%BUGID% d。 For Message Label, specify something like: TFS Work Item: e.对于消息标签,指定如下内容:TFS 工作项:e。 For "Bug-id is", specify Numeric.对于“Bug-id is”,指定数字。 f. F。 At the bottom of the window, place a check next to "Apply property recursively".在窗口底部,勾选“递归应用属性”。 Click OK.单击确定。 4. Back on the Properties - TortoiseSVN window, verify that the bugtraq properties have been added and click OK. 4. 返回 Properties - TortoiseSVN 窗口,验证 bugtraq 属性是否已添加,然后单击 OK。 5. Remember to perform an SVN Update and SVN Commit on the folder after changing its bugtraq properties. 5. 记住在更改 bugtraq 属性后对文件夹执行 SVN 更新和 SVN 提交。

The bugtraq properties that implement this one-way integration between SVN and TFS are built into Apache Subversion and so should work for SVN even if you are not using the TortoiseSVN user interface.实现 SVN 和 TFS 之间这种单向集成的 bugtraq 属性内置于 Apache Subversion 中,因此即使您不使用 TortoiseSVN 用户界面,也应该适用于 SVN。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM