获取最新签入号(最新变更集id)
有没有办法以编程方式获取最新的变更集版本。
获取特定文件的变更集 ID 相当容易:
var tfs = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(new Uri("https://my.tfs.com/DefaultCollection"));
tfs.EnsureAuthenticated();
var vcs = tfs.GetService<VersionControlServer>();
然后调用 GetItems 或 QueryHistory,但我想知道最后一次签入号码是什么。
Is there a way to get programmatically latest changeset version in general.
It's fairly easy to get changeset id for certain file :
var tfs = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(new Uri("https://my.tfs.com/DefaultCollection"));
tfs.EnsureAuthenticated();
var vcs = tfs.GetService<VersionControlServer>();
and then call GetItems or QueryHistory, but i would like to know what was the last checkin number.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
你可以这样做:
You can do it like this:
使用
VersionControlServer.GetLatestChangesetId
获取最新的变更集 ID,如用户 tbaskan 在评论中提到的。(在 TFS Java SDK 中为
VersionControlClient.getLatestChangesetId
)Use
VersionControlServer.GetLatestChangesetId
to get the latest changeset id, as mentioned by user tbaskan in the comments.(In the TFS Java SDK it's
VersionControlClient.getLatestChangesetId
)我在执行后使用以下 tf 命令来执行此
操作我解析该命令的输出以获取变更集编号
这是我执行命令的方式
不是一种有效的方法,但仍然是在 TFS 2008 中有效的解决方案,希望这会有所帮助。
I use following tf command for this
after execution I parse the output of this command to get changeset number
This how I execute the command
Not a efficient way but still a solution this works in TFS 2008, hope this helps.