使用 Tfs 电动工具不工作撤消未更改的挂起更改

Undo unchanged pending changes with Tfs power tools not working

使用 Tfs 2015,当 运行 在我的开发文件夹中执行以下命令时:

tfpt uu\noget\递归

它告诉我: 没有多余的待定更改,尽管在我的工作区中有 15 个文件处于待定更改中,根本没有任何更改。

有人知道这个命令对我不起作用吗?

特别是关于您的示例场景 - 一个怪癖是斜杠的方向,也就是在您使用反斜杠而不是正斜杠的示例中 没有按预期工作。

我专门测试了你的场景,在尝试以下情况时可以模拟你使用反斜杠的结果。

编辑:测试结果操作场景

Visual Studio 2015 企业版(版本:14.0.23107.0 D14REL)

TFS Powertools 2015(版本 14.0.23206.0)

  1. 带正斜杠 /
D:\src\testapp\src1>tfpt uu /recursive /noget
Getting the list of pending changes for your workspace...
Building the list of redundant changes...
 edit (contents match): d:\src\testapp\src1\file_with_pending_change.txt
Do you wish to undo these redundant pending changes? (Y/N) n
Operation canceled.
  1. 带反斜杠 \
D:\src\testapp\src1>tfpt uu \recursive \noget
Bringing the specified items up to the latest version…
Getting the list of pending changes for your workspace...
There are no redundant pending changes.
  1. 再次使用正斜杠 /
D:\src\testapp\src1>tfpt uu /recursive /noget
Getting the list of pending changes for your workspace...
Building the list of redundant changes...
 edit (contents match): d:\src\testapp\src1\file_with_pending_change.txt
Do you wish to undo these redundant pending changes? (Y/N) y
Undoing redundant changes...
edit: file_with_pending_change.txt
1 changes undone.

编辑 2:OP 问题.. 在对这个答案的评论中,我建议 OP 删除 TFS 缓存以便从已知的基线状态开始,因为在测试我的解决方案后没有得到预期的结果,这似乎确实是一个损坏的工作区状态问题。

删除缓存可以通过关闭IDE并删除

中的文件来完成
C:\Users\USERNAME\AppData\Local\Microsoft\Team Foundation\XXXX\Cache

然后再次打开 IDE 并检查是否仍然出现 ghost pending changes。如果挂起的更改仍然出现,我建议搁置或提交想要保留的更改并删除工作区。

关于 TFPT 的附加说明: 如果 tfpt 工作路径 不在映射的工作空间路径中,tfpt 命令将产生指定的消息 -

示例:

我有一个名为的服务器路径:

$/serverpath/testapp/src1

我将该路径本地映射到:

D:\src\testapp\src1

为了模拟然后我显式地检出 src1 中的一个文本文件进行编辑。

tfpt uu /recursive /nogetD:\src\testapp 执行结果

Bringing the specified items up to the latest version... 
Getting the list of pending changes for your workspace... 
There are no redundant pending changes.

tfpt uu /recursive /nogetD:\src\testapp\src1[=79 执行=] 结果

Getting the list of pending changes for your workspace...
Building the list of redundant changes...
 edit (contents match): d:\src\testapp\src1\file_with_pending_change.txt
Do you wish to undo these redundant pending changes? (Y/N) y
Undoing redundant changes... 
edit: file_with_pending_change.txt
1 changes undone.

相关说明:

您也可以 运行 标准 TF 命令,尽管您将显式添加路径以供 TF.exe 执行:

tf undo /recursive D:\src\testapp\src1

这导致:

Undoing edit: file_with_pending_change.txt