本文介绍了如何创建特定 TFS 2010 源代码管理路径的资源管理器快捷方式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在慢慢地将项目从基于旧文件的存储(不要问)转移到 tfs.我们的编码人员仍然习惯于在文件系统中查找代码.

We are slowly moving projects from old file based storage (don't ask) to tfs. Our coders are still used to find the code in the file System.

因为我们谈论的是 100 个项目,每个项目都有某种历史,所以我们必须逐个小心地移动它们.因此,我们将不得不使用与 TFS 管理文件混合的现有文件结构一段时间.

Since we are talking about 100 Projects each with some sort of history, we have to move them carefully one by one. Resulting that we will have to live for some time with the already existing file structure mixed with the TFS managed files.

为了让我们的程序员更轻松,我想在文件系统中为我们移动的每个项目创建一个快捷方式.因此,开发人员可以查看项目是否已移动,如果是,则双击打开直接指向正确项目的 TFS 源代码管理资源管理器.

To make life easier for our coders, I would like to create a shortcut in the filesystem, for each project that we moved. So the developers can look up if the Project has already been moved, and if yes, go by double click to open up the TFS Source Control Explorer pointing directly to the correct Project.

这可能吗?感谢您的回复.

Is this possible? Thanks for your Response.

推荐答案

我找到了一个满足我需要的简单解决方案,它基于一个小批量脚本,您必须单击它.即使您仍然可以创建批处理文件的快捷方式,也可以说这不是快捷方式.

I found a simple solution for my needs, which is based on a small batch script, that you'll have to click. It's not a shortcut so to say even though you can still create a shortcut of the batchfile.

脚本如下:

CALL "%VS100COMNTOOLS%\..\..\VC\vcvarsall.bat" x86
REG ADD "HKCU\Software\Microsoft\VisualStudio\10.0\TeamFoundation\SourceControl\Explorer\<GUIDofTFS>" /v "SceMostRecentPath" /d "$/<PathToTfsProject>" /f
devenv /Command View.TfsSourceControlExplorer

事实上,我结合了在不同来源中发现的 2 个想法:

In fact I combined 2 ideas found in separate sources:

1.使用源代码管理资源管理器启动 VS

2.操作注册表以在特定路径中打开源代码管理资源管理器

使用命令 devenv/Command View.TfsSourceControlExplorer 您实际上可以启动 VS 并自动打开源代码管理资源管理器.不幸的是,没有办法给一个参数直接指向你想要的位置.但我注意到 VS2010 似乎保留了上次使用的路径并在重新启动时重新打开到该位置.快速研究导致注册表项

With the command devenv /Command View.TfsSourceControlExplorer you can actually start VS and automatically open Source Control Explorer. Unfortunately there is no way to give a parameter to point it directly to a location you wish. But I noticed that VS2010 seems to persist the last used path and reopens to that place on restarts. A quick research resulted in the registry entry

HKCU\Software\Microsoft\VisualStudio\10.0\TeamFoundation\SourceControl\Explorer\058104ed-f0e2-4126-9ccc-0e37e19c4f91\SceMostRecentPath

通过操作 SceMostRecentPath 的值,您可以欺骗 VS2010 打开带有路径的源代码管理资源管理器.请记住:您需要将 058104ed-f0e2-4126-9ccc-0e37e19c4f91 替换为您的 TFS 安装的 GUID.

By manipulating the value of SceMostRecentPath you can trick VS2010 to open Source Control Explorer with the path in there.Keep in mind: You will need to replace 058104ed-f0e2-4126-9ccc-0e37e19c4f91 with the GUID of your TFS Installation.


由于我们都使用 VS 2010 但安装路径不同,我通过使用 VS100COMNTOOLS 变量动态实现了路径.首先我们设置TFS命令行环境:


Since we are all using VS 2010 but the installation paths differ, I implemented the path dynamically by making use of the VS100COMNTOOLS variable. First we set up the TFS command line environment:

CALL "%VS100COMNTOOLS%\..\..\VC\vcvarsall.bat" x86`

然后我们更改注册表:

REG ADD "HKCU\Software\Microsoft\VisualStudio\10.0\TeamFoundation\SourceControl\Explorer\[PutYourTfsGUIDHere]" /v "SceMostRecentPath" /d "$/<YourTfsPath>" /f

最后,我们使用 source Explorer 命令简单调用 devenv.exe:

Finally we do a simple call of devenv.exe with the source Explorer command:

devenv /Command View.TfsSourceControlExplorer

这篇关于如何创建特定 TFS 2010 源代码管理路径的资源管理器快捷方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-18 17:49