如何在特定选定项目内的TFS源代码管理中搜索特定文件? [英] How to search for a specific file in the source control of TFS inside a particular selected project?

查看:339
本文介绍了如何在特定选定项目内的TFS源代码管理中搜索特定文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

代码:

  string spName =usp_Test_Procedure.sql; 
var tfsPp = new TeamProjectPicker(TeamProjectPickerMode.SingleProject,false);
tfsPp.ShowDialog();
_tfs = tfsPp.SelectedTeamProjectCollection;
if(tfsPp.SelectedProjects.Any())
{
_selectedTeamProject = tfsPp.SelectedProjects [0];
}
字符串selectedProjectName = _selectedTeamProject.Name;
var tfs = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(_tfs.Uri);
var vsStore = tfs.GetService< VersionControlServer>();
var project =project;
var branchVersion =1.0.0;
var folders = vsStore.GetItems($ /+ selectedProjectName +/ *,RecursionType.Full);

如何在源代码管理中搜索特定文件 TFS 在用户从c#UI winforms应用程序的下拉菜单中的特定选定项目中选择了branchversion



这里我需要搜索的文件是 usp_Test_Procedure.sql ,它出现在下面的路径中

  $ / selectedProjectName / project / 1.0.0 / UI / Scripts / usp_Test_Procedure.sql 

实际上,我从愚蠢的代码中获得了上述路径:

$ p $ folders.Items [29956] .ServerItem

但我需要知道如何在TFS的源代码控制中搜索特定文件在一个特定的选定项目中,还选择了分支版本?谢谢。如果您想按内容和名称进行搜索,您可以创建一个工作区,并在本地获取该特定版本。 然后使用您的操作系统或Visual Studio中的内置搜索来查找您要查找的内容。


Code:

string spName = "usp_Test_Procedure.sql";
var tfsPp = new TeamProjectPicker(TeamProjectPickerMode.SingleProject, false);
tfsPp.ShowDialog();
_tfs = tfsPp.SelectedTeamProjectCollection;
if (tfsPp.SelectedProjects.Any())
{
     _selectedTeamProject = tfsPp.SelectedProjects[0];
}
string selectedProjectName = _selectedTeamProject.Name;
var tfs = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(_tfs.Uri);
var vsStore = tfs.GetService<VersionControlServer>();
var project = "project";
var branchVersion = "1.0.0";
var folders = vsStore.GetItems("$/" + selectedProjectName + "/*", RecursionType.Full);

How to search for a specific file in the source control of TFS inside a particular selected project and also selected branchversion in the dropdown menu by the user from the c# UI winforms application?

Here the file I need to search is usp_Test_Procedure.sql which is present in the following path

$/selectedProjectName/project/1.0.0/UI/Scripts/usp_Test_Procedure.sql

Actually I am getting the above path from the foolowing code:

folders.Items[29956].ServerItem

But I need to know how to search for a specific file in the source control of TFS inside a particular selected project and also selected branchversion? Thanks.

解决方案

If you want to search by content and name you can create a workspace and "get" that specific version locally. Then use the built in search in your OS or in Visual Studio to find what you are looking for.

这篇关于如何在特定选定项目内的TFS源代码管理中搜索特定文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆