使用 .NET SDK / C# 在 StarTeam 中查找文件的过去修订版本
我正在尝试编写一个 C# 程序来比较 StarTeam 存储库中不同版本的文件(查看文件的当前版本与给定的先前签入之间是否有任何更改)。我目前能够从当前版本中查找/签出文件,但很难找到正确的方法来查找这些文件的过去版本。
至少在 .NET 方面,Borland 文档似乎相当糟糕,有人能给我指出正确的方向吗?
谢谢你!
I'm trying to write a C# program to compare files from different revisions in a StarTeam repository (see if there have been any changes between the current version of a file and a given prior checkin). I currently am able to find/checkout files from the current revision, but am having difficulty in finding the proper methods to then find past versions of these files.
The Borland documentation seems to be rather poor on the .NET side of things at least, could anyone point me in the right direction?
Thank you!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
找到了答案。
给定当前修订文件,可以通过 File.GetFromHistoryByDate(DateTime) 方法创建过去修订项目。然后可以将返回的 Item 转换为 File 对象。如果给定日期该文件没有修订历史记录,则返回的对象将为空(但不会引发其他错误)。
如果旧文件不为空,则可以将对象与 File.MD5 哈希值进行比较。
Found the answer.
Given a current revision File, a past revision Item can be created via the File.GetFromHistoryByDate(DateTime) method. The returned Item can then be cast into a File object. If there is no revision history for that file for the given date, the returned objects will be null (but no other errors will be thrown).
If the older File is not null, the objects then can be compared with the File.MD5 hashes.