TFS - undoing a checkout of another user ...

A common query we get is how we can undo a checkout for another user, either because the user has left the company, lost their machine and workspace or has simply gone on a vacation. In the following snapshot we can see that MTUNET\willyp has checked out the AssemblyInfo.cs file ... has gone on holiday and is therefore creating a bit of tension in the force. Microsoft reports the common scenarios as:

  • Undo a pending change because I need to check-in and someone has it exclusively checked out
  • Undo the checkout lock on the file and not the actual change itself
  • Undo all the changes in a workspace because the person has left the company or the group

imageCLIPART_OF_12412_SM

  • To list the workspaces for the doomed user, execute the following command:
    tf workspaces /owner:MTUNET\willyp /computer:*
    ... which gives us the following:
    image
  • To undo the checkouts on the AssemblyInfo.cs file you can run:
    tf undo /workspace:NEPTUNE_TEST;MTUNET\willyp "$/ATC_EcoSystem/ATF/ATF 1.1b 2003/Source Code/Automated Test Framework/Copy of ATFCoreAgent/AssemblyInfo.cs"
    ... which results in:
    image
  • Alternatively if the resource is gone for definite, you can delete the workspaces which will also undo any pending changes using the following command:
  • tf workspace /delete NEPTUNE_TEST;MTUNET\willyp /s:http://TFSTEST:8080
    and
    tf workspace /delete NEPTUNE;MTUNET\willyp /s:http://TFSTEST:8080
    image

If we look at the TFVC repository, we get the following updated view:
image CLIPART_OF_12401_SM

Published Wednesday, July 23, 2008 10:39 PM by willy
Filed under: ,

Comments

# VSTS Links - 07/31/2008

Thursday, July 31, 2008 4:09 PM by Team System News

Martin Woodward on Behind Brian the Build Bunny The NWCadence Blog on VSTS User Group on MSBuild and...

Leave a Comment

(required) 
(required) 
(optional)
(required) 

Enter the numbers above: