简体   繁体   中英

How to search for a specific file in the source control of TFS inside a particular selected project?

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.

安装TFS电动工具,在源控制窗口上单击团队项目或分支上的右键,在上下文菜单上选择查找>按通配符查找,只按名称搜索文件,而不是内容。

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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