特别是关于您的示例场景 - 一个怪癖是,在您的示例中,您使用反斜杠而不是正斜杠的斜杠的方向无法按预期工作。
我专门测试了您的场景,并且可以在尝试以下情况时使用反斜杠模拟您的结果。
编辑:测试结果操作场景
Visual Studio 2015 企业版(版本:14.0.23107.0 D14REL)
TFS Powertools 2015(版本 14.0.23206.0)
- 带正斜杠 /
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.
- 带反斜杠 \
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.
- 再次使用正斜杠 /
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:操作问题..
在这个答案的 cmets 中,我建议 OP 删除 TFS 缓存以便从已知的基线状态开始,因为在测试了我的解决方案并且没有得到预期的结果之后,这似乎确实是一个损坏的工作区状态问题。
可以通过关闭IDE并删除其中的文件来删除缓存
C:\Users\USERNAME\AppData\Local\Microsoft\Team Foundation\XXXX\Cache
然后再次打开 IDE 并检查幽灵挂起的更改是否仍然出现。在未决更改仍然出现的情况下,我建议搁置或提交想要保留的更改并删除工作区。
关于 TFPT 的附加说明:
如果 tfpt 工作路径 不在映射的工作空间路径中,则 tfpt 命令将产生指定的消息 -
示例:
我有一个名为:
的服务器路径
$/serverpath/testapp/src1
我将该路径映射到本地:
D:\src\testapp\src1
为了模拟,然后我明确地检查 src1 中的文本文件进行编辑。
tfpt uu /recursive /noget 从 D:\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 /noget 从 D:\src\testapp\src1 执行会导致
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