Jacob
Jacob

Reputation: 78850

Cannot eliminate phantom pending TFS change

Somehow, due to folder renamings and various other source code changes, I'm having an irritating problem. I'm showing a pending change for a file that cannot be undone in TFS.

This is a little hard to completely explain. Here is what the directory/file structure looks like in TFS:

RootFolder
    Folder
        FileA
        FileB
    OldFolderThatWasRenamedToFolder (shows add icon)
        FileA (shows "edit" pending change)

"OldFolderThatWasRenamedToFolder" had been renamed to "Folder" and is committed to TFS like that. The "FileA" under that non-existing folder references the same file as "Folder/FileA" but registers as a different file; for example, if I change "Folder/FileA," pending changes are shown for both "files." Whenever I undo pending changes for the phantom file, TFS reports the error:

No pending changes were found for .../Folder/FileA.

I cannot get rid of this annoying false pending change. I've done an update in the folder forcing an overwrite and even deleted the folder prior to the update. How can I eliminate this phantom pending change?

Update:

I found a potential clue. When I compare the "pending" file with the latest, no changes are detected, but when comparing with the "Workspace version," the file is compared with an older version of the file. I've recently tried deleting my workspace and creating a new one, but the same problem persists. What exactly is going on? Where are these pending changes even stored? Is there some file I can manually edit?

Upvotes: 7

Views: 11849

Answers (8)

TheProgrammer
TheProgrammer

Reputation: 1

I had a similar issue with a project that is stuck in AX version control/pending objects with “Add” action. I could not get rid of it by clicking on “Undo checkout” because it no longer exists in AX projects, local repository, nor in VSTS. To get rid of it, I created the project in AX/projects/shared then was able to get rid of it by going to AX version control/pending objects and clicked on “Undo checkout”. I believe this occurs when you create an object in AX, add it to version control, then rename the object afterwards. Hope this helps.

Upvotes: 0

Matt
Matt

Reputation: 27001

John Kurlak's comment helped me a lot, but let me describe what issue happened in my case and how I solved it.

I've tried what he has suggested:

I opened the developer console, did a cd to the directory of my branch, and ran:

tf undo * /recursive

Then selected "All" when the tool asked "Undo your changes...? (Yes/No/All)".

In my case that was not enough, because NUGET left some files which were not added to TFS. That caused the tf tool to abort with the error:

TF400024: The change on C:(SomePath)\themes\base\images\ui-icons_cd0a0a_256x240.png cannot be undone because a file already exists at C:(SomePath)\themes\base\images\ui-icons_cd0a0a_256x240.png. The file must be deleted from disk for the undo to succeed.

In this case, I had to delete those files mentioned manually, and then retry until it succeeded. That had to be done a few times.

Note: Those files can be found easier in the file explorer if you have the TFS power tools installed, because the files belonging to TFS have a green triangle in their icons, the other filies (the ones you need to delete) not.

Upvotes: 1

MarcWeintraub
MarcWeintraub

Reputation: 76

I know this is an old post, but I expierenced the same thing.

What I found: John Kurlak's command line worked for me. I wanted to try something so I ran the TF MERGE again. This time I closed all Visual Studios open and then reopened it. The files showed up in Pending Changes and was able to Undo from there.

Upvotes: 2

Assaf Stone
Assaf Stone

Reputation: 6317

You should be able to undo the pending change with a 3rd party tool called TFS Sidekicks. It is a free set of utilities by Attrice. I use it especially when I (or a client) come across such problems, as well as permissions issues, and the like.

Moreover, the tool will allow an administrator to do the same for other users. That means that it will solve situations where code is marked as checked out by a user that may no longer exist in the system.

Download it at http://www.attrice.info/cm/tfs/index.htm

Hope this helps.

Upvotes: 4

Luty
Luty

Reputation: 170

I know this is an old question, but I just faced that issue and I was not able to figure this out with sidekicks or tf command line tool. In my case the solution was close the solution and delete the .suo file.

Upvotes: 1

Charlie
Charlie

Reputation: 95

In visual studio 2010, you can right-click on the phantom pending check-in on the "Pending Changes" panel and click "Undo..." on the popup menu, then click button "Undo Changes" on the dialog box "Undo Pending Changes", the phantom pending check-in will be removed from the list.

Upvotes: 7

David K.
David K.

Reputation: 7

I am still new to VS2010, but this is how I fixed this issue for me:

Go to Source Control in the Team Explorer panel. In the Source Control Explorer, right-click the directory, project, or source code file for which there are pending changes to be ignored. Select Undo Pending Changes. A modal dialog appears confirming the Pending Changes that will be undone. Select Undo Changes, and voila! No more phantom pending changes.

Upvotes: -4

Jacob
Jacob

Reputation: 78850

I figured out a way to fix this using the tf.exe command line. By entering this:

tf undo /workspace:MyWorkspace $/.../RootFolder/OldFolderThatWasRenamedToFolder/FileA

...I was able to undo the pending change. If anyone knows how to do this same thing without resorting to the command line, I'll accept their answer instead.

Upvotes: 2

Related Questions