TFS Power Tools 2010 Showing File Checked Out - tfs

Somehow TFS Power Tools thinks my file is checked out, it won't let me check-out because that option is greyed out.
When I look in windows explorer I see my file with the little pen icon overlay. When I right-click and go to "Team Foundation Server", I choose undo but then get the message "There are no changes to undo in the selection or any children of the selection". If I right-click and go to Check-In then I get the message "no pending changes".
When I open source control explorer in Visual Studio it shows no pending changes for the file.
Can anyone please advise any steps I can take to resolve?

Can it be that the file is checked out by you on another workspace? Go to VStudio & check "Team Members" under Team Explorer. Right-click on yourself & select "Show pending changes". This should show all your checked out items, across all workspaces/worstations. You can also undo it there.Eventually, in order to find out what is happening with your file go in VS to"File">"Source Control">"Find in Source Control">"Status"Select the path to your module & hit 'find'. This should reveal if any other person has this file checked out

Seems strange, lets check common scenarios:
File is actually not checked-out but shown as checked-out in explorer
=> Please try to checkout file through VS, if you can, there is definitely some problem in Power Tools integration to Source COntrol. Restart machine. If problem is same then it might be case TFS credentials are different from Login windows credentials, status don't update sometimes.
File has set property of single check out by Admin & checked- out by anyone else thus preventing you from either check-out or check-in also undo checkout is not possible for same reason.
Create new workspace or try on other machine with different workspace.
=> Some times workspace conflicts, multiple mapping of same directory through multiple workspace creates problems.
Power Tools installation is corrupted or incompatible with some other extension.
=> Many a times, frequent abrupt power-off or etc corrupts software, reinstall latest Power tools. If problem persists, check if some other extension for VS or windows shell is not interrupting functioning.
Hope that helps, if not, let me know with more details like installed extensions, power tools version/ update installed.

Related

Complete nuke all changes in visual studio and reset from TFS

I am using Visual Studio 2013. Regarding TFS workflow, there are issues I have when working on a bug or work item, after I am finished, I move the changes into a shelfset for further review, undo my changes by right clicking on the pending changes and clicking undo. The move on to the next issue or enhancement. The shelfsets can be indpendendly reviewed and then applied to whatever branch they are currently needed.
The problem I have is that undoing through visual studio does not completely reset the solution to a completely clean state. There are often orphaned files around or projects that have references to non-existing files or other such problems. I'd like to be able to completely nuke and reset my solutions from source control as if I am a new developer and I have not found an easy solution to do this.
Currently, the only way I can accomplish this is to go to "Source Control Explorer" remove the file system mapping for the project. Go to the file system, removed the folder. Go back into "Source Control Explorer" add the mappings back in. And then "Get Latest Version".
Is there an easy way to completely reset a solution in Visual Studio with TFS?
You can achieve this in Visual Studio 2010 without Power Tools. Process is likely similar for other VS versions.
Open the Source Control Explorer. Right-click the entry you want to reset, then choose "Get Specific Version." Select the version you want to reset to. Ensure that the two checkboxes are checked:
☑ Overwrite writeable files that are not checked out
☑ Overwrite all files even if the local version matches the specified version
This will overwrite all locally mapped files with the server's version. (And will correspondingly take time proportionate to the number of files.) I do not believe that this operation will remove any unmapped files.
If you have the Power Tools installed, call tfpt scorch /deletes /recursive /diff. That should make your local folder match the server exactly.
You can also call tfpt treeclean, which will just delete any item that is not mapped to TFS. It won't update or replace any changed files though, like scorch will.

TFS file must remain locked

I have some 3rd party dlls checked into TFS
Our machines were renamed and now TFS believes they are checked out for edit by me on another machine.
I tried tf lock /lock:none contrib64/* /workspace:oldmachine;myusername but I get the error
TF10152: The item $/XXX/YYYY/contrib64/third_party.dll must remain
locked because its file type prevents multiple check-outs.
1, Is there any way around this ?
2, Is TFS really this bad or is it just me ?
3, Is the purpose of TFS to make us nostalgic for VSS?
ps It's a hosted version so I can't just get the admin to fix it.
Undoing the lock won't work on those files because they are binary, as binaries cannot be merged they must be locked if they are checked out.
As the machine the workspace resides on no longer exists (the machine has been renamed) the best thing to do is delete the workspace.
from a Visual Studio command prompt
tf workspace /delete oldmachine;myusername /collection:http://*tfsserver*:8080/tfs/*collection*
This will remove the workspace and undo all pending changes
If you don't want to delete the workspace, you can undo the change and unlock the file after that:
Using a Visual Studio developer command prompt:
tf undo "$/<server-path-to-file/folder>" /workspace:"<workspace>;<user>" /collection:<collection-url> /recursive
tf lock "$/<server-path-to-file/folder>" /lock:none /workspace:"<workspace>;<user>" /collection:<collection-url> /recursive
Files with .dll extension as well as other extensions like .exe, .doc, .docx, etc. are automatically locked because (as mentioned) here they cannot be merged.
If you want to disable the automatic lock and allow these files to go through gated check-in, follow the steps below:
Log in to your build server.
Open visual studio.
In team explorer, log into your team project.
Go to "Settings".
Under "Team Project Collection", select "Source Control".
Set "File Merging" property to "Disabled" for any file extension you don't want to be automatically locked.
Reference: https://blogs.msdn.microsoft.com/phkelley/2008/11/12/everything-you-ever-wanted-to-know-about-locks/
This worked for me.
I needed to change settings in 2 places:
At Visual Studio, team project window, Settings->Team Project Collection -> Source Control
Enable File Merging for the extension.
2) At Visual Studio, team project window, Settings->Team Project -> Source Control
Enable the multiple check-out box

Deleted a file out side Visual Studio, TFS doesn't recognize it

I am new to TFS. I checked out a folder from TFS using Visual Studio and then deleted bunch of files/added couple of files within that folder using windows explorer (actually I didn't do it, but that folder has third party libraries and I used an installer which made all these changes).
Now if I go to Visual Studio and try to check in that folder, I am getting this error:
Check in: Operation not performed
Could not find file : /ThirdPartyFolder/aDeletedFile.aspx
I tried to follow the solution proposed in this post, but that didn't work out:
http://www.woodwardweb.com/tfs_top_tip/tfs_top_tip_11.html
When I do 'Get Specific Version' and specified 'change set 1', it doesn't show the deleted files in red as it does in the screenshot of that blog post. Also, when I click OK, it shows the Pending Changes-Conflicts window with all the files that got deleted. Even though I selected "Keep Local Version", when I try to check in, I am getting the same error again.
Is there a way in TFS to take what is in my local version and over write what is in the server with my local version files?
I have done similar operations using Subversion, and this has never been a problem. Hopefully someone will let me know how to achieve this in TFS.
Team Foundation Server requires that you explicitly pend changes for these files - if you delete a file locally, this does not explicitly pend a delete against Team Foundation Server. This is actually a useful feature - the server optimizes the data it sends you based on its knowledge of your local filesystem. That is to say, if you say "get latest", it knows your current versions and will only deliver the changes. If you're working with very large projects, this can be very efficient.
However, when other programs decide to make changes without pending the changes to the server, things can get a bit confused. Fortunately, TFS has the ability to detect changes that were made outside without explicitly pending those changes. You can use the "return online" capabilities of your TFS client.
You'll need the Team Foundation Server Power Tools installed, then you can simply run: tfpt online to detect those changes and select which ones to pend to the server.
(VS2012) Select the missing files from TFS "Check In" list and then right click on them and click on "Undo Changes" to exclude them from the list of "Check In"s forever.
This is one of the major differences between svn and tfs. Svn is somehow more integrated with windows shell and every change in your working folder will affect the server on commit. I propose you to perform any move, delete and rename actions within tfs UI, not from shell.

How to undo changes in tfs coming from unmanaged workspace?

I have a workspace that is lost forever. I have some files checked out from this workspace. I want to unlock them but I can't. I tried to do:
TF UNDO $/MyProject/MyFolder/MyFile.cs /WORKSPACE:LOST;user /s:http://mysite:8080
But I got this message:
The workspace LOST;user is not on this
computer. Run get (get all if edits
were undone) on the computer hosting
that workspace to update it with the
change s that have been made on the
server.
Does exist any way to undo a file (not every file) checked out by unavailable workspace?
If the workspace is lost, then I would just delete it. Deleting it undoes any changes that were made in it.
tf workspace /delete WorkspaceName;WorkspaceOwner
As long as you have the appropiate permissions I would think that the method from this answer by #BubbleSort should work: https://stackoverflow.com/a/17870318/1982894
He used TFS 2012, I have tested it in TFS 2010 and it works there too.
Answer copied for easy reference:
(Note: I have the TFS Power Tools installed so if you don't see the
described options you may need to install them.
http://visualstudiogallery.msdn.microsoft.com/b1ef7eb2-e084-4cb8-9bc7-06c3bad9148f
)
If you are accessing the Source Control Explorer as a team project
administrator (or at least someone with the "Undo other users'
changes" access right) you can do the following in Visual Studio 2012
to clear a lock and checkout.
From the Source Control Explorer find the folder containing the locked file(s).
Right-click and select Find then Find by Status...
The "Find in Source Control" window appears
Click the Find button
A "Find in Source Control" tab should appear showing the file(s) that are checked out
Right click the file you want to unlock
Select Undo... from the context menu
A confirmation dialog appears. Click the Yes button.
The file should disappear from the "Find in Source Control" window.
The file is now unlocked.

Source Control Explorer Shows Pending Changes, But In Pending Changes Window does not show

In TFS Source Control Explorer it shows pending changes (edit,[more]) with my name, but the Pending Changes window does not show any pending changes.
What I thought is, months ago my Visual Studio crashed, and at that time some files were checked out (which I was not aware of, due to the automatic checkout nature of TFS). Due to that, I copied a new VMImage, without undoing the pending changes (which are currently showing in Source Control Explorer).
One of my team members wants to checkin a new version of that particular file. Now, I need to undo my pending changes.
It sounds like you have them checked out under a different workspace. Try going to View->Other Windows->Source Control Explorer, then open the Workspace dropdown near the top of the screen, and select "Workspaces..."
I would suggest simply deleting any extra workspaces shown.
Steps to reproduce:
Make non-conflicting edits to files in TFS.
Get the latest version of the project from source control.
Sometimes, pending changes will be marked as non-pending and all project files are saved, resulting in no pending changes in the Team Explorer.
Workaround:
Right-click on the solution folder in source code explorer
Select "Compare"
In the search results, manually open files which have been edited/added and save them. This will register them as a "Pending Change" in team explorer.
This is because TFS apparently uses file properties rather than actual text comparisons to register pending changes in Visual Studio.
Tested on: Windows 7, Visual Studio Ultimate 2012.
Additional feedback from my supervisor: "Not sure if it was the issue this time, but that can happen when you disconnect from the TFS server (which sometimes happens without it being obvious). File | Source Control | Go Online usually fixes it (and the option isn’t available if you are online)."
TFS is buggy everywhere. i think you need to check out the parent folder and use TFS power toys to undo all the rubbish unchanged item.
TFS use file property to indicate whether or not a file has change, which sucks the most, and produce tons of usability problem.
If the file that you checked out is not part of the current solution, it might be hidden by the "Filter by solution" toolbar button on the Pending Changes window.
Get your changed files check out for edit
I had the same problem, I re-started VS, opened the solution and all the changes are now being displayed in the pending changes window.
Did you try to checkout the file from the Source Control Explorer view ?
For me, it worked.
I have just had a similar issue in VS2012.
To resolve the issue, I toggled the "Show xxx" dropdown to "Show Solution Changes" and then back to "Show All". The files that were missing from the list then re-appeared.
I was having a similar problem and it was due to the fact that my local version was a "non-version control solution" for some reason! meaning that my local was not really connected to the actual source code on tfs.
fix: Got the latest with override option checked. I know this could be painful if you had a lot of changes made to your local.
I was facing same issue the first answer was really helpfull. But make sure to check "Show Remote Workspaces" if you are working from different computer. In my cases the files where checked in and edited from home computer and it was showing pending changes. Deleting unwanted workspaces helps to solve this problem.
a different workspace on the same machine
a different workspace on another machine
TeamExplorer -> PendingChanges -> Excluded Changes ( I included this only because you didn't specifically mention they weren't there)
especially if you right clicked a node in solution explorer and chose check-in
Filtered based on TeamExplorer Settings #Oliver
Use a Tfs Query to find the pending changes and what workspace they are pending from.
Another option is to permanently or temporarily give them permissions to overwrite your lock. Then he can check-in anyhow.
I've seen this problem. Sometimes when I have the pending changes window in 'flat display mode', it doesn't display my changes. I find if I click the toolbar icon at the top of the pending changes window with tooltip 'Change to folder view', then they display. I think this is a bug in the Team Explorer Client.
sometimes I can not lock a branch because users have things checked out, but when I ask them about it, the pending merges/changes, only folders come up with no objects to change. What's with that?

Resources