我可以在办理TFVC - TFS 2015后设置不同的ChangeDate CreationDate

时间:2016-03-02 07:40:46

标签: git tfs migration tfvc

我遇到问题我无法在TFS 2015中修改Changeset的CreationDate 使用Microsoft.TeamFoundation.VersionControl.Client.dll

    $changeset = $versionControlServer.GetChangeset("2656")
    $changeset.CreationDate = $(get-date).AddDays(-90)
    $changeset.Comment = "bla-bla-bla"
    $changeset.Owner = "test\test1"
    $changeset.Committer = "test\test1"
    $changeset.CommitterDisplayName = "test\test1"
    $changeset.OwnerDisplayName = "test\test1"

    $changeSet.Update()

尝试运行$changeSet.Update()方法后,结果不佳。仅应用了$changeset.Comment = "bla-bla-bla",其他属性未成功。

所以,我的问题是:

  1. 如何在不直接干预数据库的情况下修改属性CreationDate, Committer
  2. 为什么只读取此属性?
  3. 也许有些政策会阻止我这样做?

2 个答案:

答案 0 :(得分:1)

Why would you want to do change the check-in date?

The API isn't going to let you do it and editing the TFS SQL database directly is unsupported. If you decide to do it anyway then there is a fairly high probability that you will break something so make sure you have a current backup.

That said, there is a similar question here: Modify CreationDate for TFS Changeset

答案 1 :(得分:0)

TFS 2015支持并托管Git存储库以及TFVC。如果您向团队项目添加Git仓库,则可以将其添加为附加远程和推送。这将带来所有的历史,而不需要弄乱历史。

如果你必须从Git转移到TFVC(不建议Git好多了),那么你可以使用Git-TF在两者之间推送代码。

http://nkdagility.com/migrating-codeplex-github/

上面是一个相反的例子,但你应该能够:

  1. 在TFVC中克隆正确的文件夹
  2. 强制从您现有的Git仓库推送到TFVC链接的
  3. 推送至TFVC
  4. 由于TFVC是可审计的,因此无法解决日期问题。

    好的,所以我撒谎并且有办法。

    1. 创建一个新的空集合
    2. 创建一个团队项目,不要签入
    3. 使用API​​导入每个变更集,日期应该是可写的。
    4. ...这被允许支持VSS到TFVC的迁移,你的millage可能会有所不同。

相关问题