Tf 命令行实用程序 - 在重命名后确定以前的文件路径

Tf Command Line utility - Determine previous file path after a rename

有什么办法吗?我知道我可以做 tf changeset xxx,它会告诉我哪些文件是旧文件路径的 "delete, source rename",但如果有多个重命名,则无法确定哪个文件与哪个文件匹配。

此外,如果更改是本地的并且尚未提交,我看不出有什么方法可以使它起作用。

本地更改:

C:\Users\JesseHouwing\Source\Workspaces\vsts-tfvc-tasks-test>tf rename "changes.122204,old" "changes.122204.new"
changes.122204.new

C:\Users\JesseHouwing\Source\Workspaces\vsts-tfvc-tasks-test>tf status /format:detailed
$/vsts-tfvc-tasks-test/changes.122204.new;C29
  User       : Jesse Houwing
  Date       : Friday, 15 September 2017 11:10:29
  Lock       : none
  Change     : rename
  Workspace  : SNAPPIE
  Source item: $/vsts-tfvc-tasks-test/changes.122204,old
  Local item : [SNAPPIE] C:\Users\JesseHouwing\Source\Workspaces\vsts-tfvc-tasks-test\changes.122204.new
  File type  : Windows-1252

1 change(s)

对于远程更改,当您知道更改集编号时,使用更改集选项查看:

C:\Users\JesseHouwing\Source\Workspaces\vsts-tfvc-tasks-test>tf changeset 29 /noprompt
Changeset: 29
User: Jesse Houwing
Date: Thursday, 14 September 2017 20:02:54

Comment:

Items:
  delete, source rename $/vsts-tfvc-tasks-test/changes.122204;X2
  rename                $/vsts-tfvc-tasks-test/changes.122204,old

使用/itemmode和历史记录来跟踪特定文件,在这里您可以看到该特定文件的先前名称:

C:\Users\JesseHouwing\Source\Workspaces\vsts-tfvc-tasks-test>tf vc history "changes.122204,old" /noprompt /format:detailed /itemmode
-----------------------------------------------------------------------------------------------------------------------
Changeset: 29
User: Jesse Houwing
Date: Thursday, 14 September 2017 20:02:54

Comment:

Items:
  rename $/vsts-tfvc-tasks-test/changes.122204,old

-----------------------------------------------------------------------------------------------------------------------
Changeset: 11
User: Jesse Houwing
Checked in by: Project Collection Build Service (jessehouwing-dev)
Date: Saturday, 2 April 2016 20:46:32

Comment:

  ***NO_CI***

Items:
  add $/vsts-tfvc-tasks-test/changes.122204

如果重命名不是通过 Visual Studio 或 tf rename 命令完成的,它可能显示为 deleteadd 以及它们之间的关系更改将丢失。 Visual Studio 提供 UI 以在签入前修复这些类型的更改,但一旦签入,该信息将不会返回