5

Using Tfs 2015, when running the following command in my dev folder:

tfpt uu \ noget \recursive

it tells me: There are no redundant pending changes, although in my workspaces there are 15 files in pending changes without changes at all.

Does anyone know what the command is not working for me?

leppie
  • 115,091
  • 17
  • 196
  • 297
  • Another cause can be baseless merges--including merging from a branch that was *renamed* after it was created, in which case the VS merge wizard doesn't even mention that it's a baseless merge. See this answer (http://stackoverflow.com/a/15621451/1633949) for more details. As far as I know, there is no remedy. The best advice seems to be: don't rename a branch until you know for sure you will never need to merge from it again. (This comment is here out of self-interest. Twice, several months apart, I've run into this issue, and Google search leads me to this question first.) – Richard II Oct 24 '16 at 16:06
  • 1
    As mentioned in comment on one of the answers, the slashes are incorrect. they should be forward slashes. tfpt uu . /noget /recursive However, even with this correction, unchanged files may still remain undetected. – Richard II Oct 26 '16 at 13:35
  • Found a workaround here: http://stackoverflow.com/a/15643286/1633949 – Richard II Oct 26 '16 at 13:50

1 Answers1

1

Specifically regarding your example scenario - one quirk is that the direction of your slashes aka in your example you're using backslashes instead of forward slashes doesn't work as expected.

I tested your scenario specifically and can simulate your result when using back-slashes when trying the cases below.

EDIT: TEST RESULT OP SCENARIO

Visual Studio 2015 Enterprise (version: 14.0.23107.0 D14REL)

TFS Powertools 2015 (version 14.0.23206.0)

  1. WITH FORWARD SLASHES /
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. WITH BACK SLASHES \
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. AGAIN WITH FORWARD SLASHES /
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.

EDIT 2: THE OP PROBLEM.. In the comments on this answer I suggested that the OP deletes TFS cache in order to start from a known baseline state since after testing my solution it and not getting the anticipated result it appeared that this was indeed a corrupted workspace state issue.

Deleting the cache can be done by closing one's IDE and deleting the files in

C:\Users\USERNAME\AppData\Local\Microsoft\Team Foundation\XXXX\Cache

Then opening the IDE again and checking if the ghost pending changes still appear. In a case where the pending changes do still appear I would suggest shelving or committing changes one wants to keep and deleting the workspace.

ADDITIONAL NOTES ON TFPT: If the tfpt working path is not in a mapped workspace path the tfpt command will result in the message specified -

example:

I have a server path entitled:

$/serverpath/testapp/src1

I have that path mapped locally to:

D:\src\testapp\src1

to simulate I then explicitly check out a text file in the src1 for edit.

tfpt uu /recursive /noget executed from D:\src\testapp results in

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 executed from D:\src\testapp\src1 results in

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.

Related Note:

You can also run the standard TF command although you'll be adding the path explicitly for TF.exe to execute against:

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

which results in:

Undoing edit: file_with_pending_change.txt
Elmar
  • 1,236
  • 1
  • 11
  • 16
  • I run the command from the local mapped path.. it always says: Getting the list of pending changes for your workspace... Building the list of redundant changes... There are no redundant pending changes. –  Mar 12 '16 at 10:43
  • @S.Peter can you confirm that you're **specifically** in the locally mapped path and not one of its parent paths and that you are indeed using forward slashes instead of back slashes? – Elmar Mar 12 '16 at 11:06
  • Dedinitely using the forward slashes now, and I tried running it from every mapped folder, from the highest parent to the folder where my code is..not working –  Mar 12 '16 at 11:40
  • Have you attempted deleting your tfs cache? C:\Users\USERNAME\AppData\Local\Microsoft\Team Foundation\XXXX\Cache and afterwards checking your IDE source control explorer to see whether these 15 files are still showing as pending? Please close your IDE, delete cache, attempt it again, my next suspicion will be that your workspace has somehow become corrupted... if so I would simply check in and/or shelve the changes I actually want and deleting the workspace altogether, then recreating it. – Elmar Mar 12 '16 at 11:50
  • Hey, regarding that command, when I add files to a project and run it, it treates that csproj file as unchanged, is it supposed to do so? –  Mar 15 '16 at 12:06
  • Depends, when you see pending changes in source explorer it in reality means that they are checked out for edit, not that they actually contain changes. Thus if your project files are being regarded as unchanged it means that they were simply checked out for edit during your normal dev workflow. You can test the scenario by checking out a file for edit without actually editing it and running the command. Your previous problem turned out to be slightly different in the end since your workspace was in some unknown state. What I've just described is the the normal behaviour for tfpt /uu. – Elmar Mar 15 '16 at 12:56