Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/tfs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Deployment 获取一个文件夹/zip,其中包含TFS中具有完整目录结构的变更列表中的文件_Deployment_Tfs - Fatal编程技术网

Deployment 获取一个文件夹/zip,其中包含TFS中具有完整目录结构的变更列表中的文件

Deployment 获取一个文件夹/zip,其中包含TFS中具有完整目录结构的变更列表中的文件,deployment,tfs,Deployment,Tfs,我们的团队使用TFS在以下流程中管理工作流: 工作项->源代码管理->变更列表->手动部署到服务器 对于给定的变更列表,有没有办法只获取具有完整目录结构的文件列表?理想情况下,我希望能够选择多个变更列表和/或工作项,以获取与工作项关联的所有变更列表,并获取变更列表/工作项中文件的完整目录结构 如有任何建议,将不胜感激,谢谢 您可能可以使用以下代码snippit开始 Uri tfsUri = new Uri(@"http://server:8080/tfs"); string serverPath

我们的团队使用TFS在以下流程中管理工作流: 工作项->源代码管理->变更列表->手动部署到服务器

对于给定的变更列表,有没有办法只获取具有完整目录结构的文件列表?理想情况下,我希望能够选择多个变更列表和/或工作项,以获取与工作项关联的所有变更列表,并获取变更列表/工作项中文件的完整目录结构


如有任何建议,将不胜感激,谢谢

您可能可以使用以下代码snippit开始

Uri tfsUri = new Uri(@"http://server:8080/tfs");
string serverPath = @"$/Project";

//Connect to the project collection
var projectCollection = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(
        tfsUri, new UICredentialsProvider());

//Get the source code control service. 
var sourceControl = projectCollection.GetService<VersionControlServer>();
var history = sourceControl.QueryHistory(
    serverPath,  //Source control path to the item. Like $/Project/Path ...
    LatestVersionSpec.Instance, //Search latest version
    0, //No unique deletion id. 
    RecursionType.Full, //Full recursion on the path
    null, //All users 
    new  ChangesetVersionSpec("9829"), //From the 7 days ago ... 
    LatestVersionSpec.Instance, //To the current version ... 
    Int32.MaxValue, //Include all changes. Can limit the number you get back.
    true, //Include details of items, not just metadata. 
    false //Slot mode is false. 
    );

//Enumerate of the changesets. 
foreach (Changeset changeset in history.OfType<Changeset>().Take(1))
{
    foreach (var change in changeset.Changes)
    {
        change.Item.ServerItem.Dump();
    }
}
Uri-tfsUri=新Uri(@“http://server:8080/tfs");
字符串serverPath=@“$/Project”;
//连接到项目集合
var projectCollection=tfstreamprojectcollectionfactory.GetTeamProjectCollection(
tfsUri,新UICredentialsProvider());
//获取源代码控制服务。
var sourceControl=projectCollection.GetService();
var history=sourceControl.QueryHistory(
serverPath,//项的源代码管理路径。如$/Project/path。。。
LatestVersionSpec.Instance,//搜索最新版本
0,//没有唯一的删除id。
RecursionType.Full,//路径上的完整递归
null,//所有用户
新的ChangesetVersionSpec(“9829”),//从7天前开始。。。
LatestVersionSpec.Instance,//到当前版本。。。
Int32.MaxValue,//包括所有更改。可以限制返回的数量。
true,//包括项的详细信息,而不仅仅是元数据。
false//插槽模式为false。
);
//枚举变更集。
foreach(Changeset Changeset在history.OfType().Take(1))中)
{
foreach(changeset.Changes中的变量更改)
{
change.Item.ServerItem.Dump();
}
}