如何检查本地文件是否是tfs中的最新版本? [英] How to check whether a local file is the latest version in tfs?

查看:43
本文介绍了如何检查本地文件是否是tfs中的最新版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望能够询问 TfsTeamProjectCollection 并确定服务器上是否有更新版本的文件.我希望能够在不实际获取文件的情况下执行此操作.

I want to be able to interrogate TfsTeamProjectCollection and determine if there is a newer version of a file on the server. I would like to be able to do this without actually fetching the file.

这在某处可能吗?我已经做了一些抓挠,到目前为止还画了一些空白.

Is this possible somewhere? I've done some scratching around and so far drawing blanks.

谢谢.

推荐答案

最简单的方法是 QueryHistory 在工作区版本和最新版本之间;如果它们不同,则服务器上存在较新的最新版本.例如:

The easiest way is to QueryHistory between the workspace version and the latest version; if they differ, there exists a newer latest version on the server. Eg:

versionControlServer.QueryHistory(
    serverPath,
    VersionSpec.Latest,
    0,
    RecursionType.Full,
    new WorkspaceVersionSpec(workspace),
    versionFrom,
    null,
    Int32.MaxValue,
    true,
    true);

这篇关于如何检查本地文件是否是tfs中的最新版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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