0

Unknowingly i deleted a useraccount from TFS server where he doesn't checkin the checkout file.

Now i am facing the merging issue..

Unable to perform operation on $/ERPONCLOUD/Development/V1.5/Source/Presentation/WebUI/Script/ControlPanel/UserCreation.js. The item $/ERPONCLOUD/Development/V1.5/Source/Presentation/WebUI/Script/ControlPanel/UserCreation.js is locked in workspace NCWS054;Suganth.

Regards

Sundar

3 Answers3

1

UPDATE:

Based on Sundaresan's comment below, resolved the issue via create another branch by eliminating the deleted user.


You can try below ways to unlock the file:

To use the lock command, you must have the Lock permission set to Allow. Having the Unlock other user's changes permission set to Allow is required to remove a lock held by another user if you do not have Write permission for that user's workspace

tf lock /lock:none /workspace:workspacename [/recursive][/login:username,[password]] [/collection:TeamProjectCollectionUrl]

UPDATE:

In your case please try below command: (According to the error message,the file is locked in workspace NCWS054 and Suganth, So, you need to unlock in both workspace)

tf lock /lock:none /workspace:NCWS054 $/ERPONCLOUD/Development/V1.5/Source/Presentation/WebUI/Script/ControlPanel/UserCreation.js /login:Domain\user,password /collection:http://servername:8080/tfs/DefaultCollection
  • tf undo The undo command removes any locks on the items. See Undo command

    To unlock individual files run the command below in Visual Studio Command Prompt:

    tf undo "file_path" /workspace:workspace_name

    e.g.:

    tf undo $/ERPONCLOUD/Development/V1.5/Source/Presentation/WebUI/Script/ControlPanel/UserCreation.js /workspace:NCWS054

    To unlock the whole folder in one shot:

    tf undo $/ERPONCLOUD/Development/V1.5/Source/Presentation/WebUI/Script/ControlPanel/* /workspace:NCWS054

    here it will unlock all files which is inside ControlPanel folder.

UPDATE:

In your case, if it is a remote workspace, please try below command:

tf undo /collection:http://servername:8080/tfs/DefaultCollection /workspace:NCWS054;workspaceOwner $/ERPONCLOUD/Development/V1.5/Source/Presentation/WebUI/Script/ControlPanel/UserCreation.js
  • You can also unlock other users file using TFS Sidekick tools:

    It gives you a graphical interface to do all these commands, which makes it much easier to perform these tasks.

You can also reference this thread: How to unlock a file from someone else in Team Foundation Server

Andy Li-MSFT
  • 28,712
  • 2
  • 33
  • 55
  • Hi Andy, if i execute the above command, its throwing error as below. C:\Users\Administrator\Source>tf undo $/ERPONCLOUD/Development/V1.5/Source/Prese ntation/WebUI/Script/ControlPanel/* /workspace:NCWS054 Unable to determine the source control server. C:\Users\Administrator\Source>tf undo $/ERPONCLOUD/Development/V1.5/Source/Prese ntation/WebUI/Script/ControlPanel/UserCreation.js /workspace:NCWS054 Unable to determine the source control server. – Sundaresan Aug 09 '17 at 09:40
  • @Sundaresan What about "tf lock /lock: none" something like : tf lock /lock:none /workspace:NCWS054 /recursive /login:username,password /collection:collectionUrl – Andy Li-MSFT Aug 09 '17 at 09:53
  • still no improvement. Facing the below issue C:\Users\Administrator\Source> tf lock /lock:none /workspace:NCWS054 /recursive /login:nc291,mouseBall100 /collection: $/ERPONCLOUD/Development/V1.5/Source/Pres entation/WebUI/Script/ControlPanel/UserCreation.js Option collection requires a value. C:\Users\Administrator\Source> tf lock /lock:none /workspace:NCWS054 /recursive /login:nc291,mouseBall100 /collection:$/ERPONCLOUD/Development/V1.5/Source/Prese ntation/WebUI/Script/ControlPanel/UserCreation.js No files specified. – Sundaresan Aug 09 '17 at 10:31
  • @Sundaresan The format you specified is incorrect, please see the updated answer above, then change the user name and password and Collection URL accordingly, try it again. – Andy Li-MSFT Aug 10 '17 at 01:57
  • Sorry Andy for late response. Our tech team create one another branch by eliminating the deleted user. Now its working fine. So far so good. – Sundaresan Aug 29 '17 at 04:35
  • @Sundaresan Glad to know that you have resolved the issue, I have updated the answer, you could [Accept it as an Answer](https://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work), This can be beneficial to other community members reading this thread. – Andy Li-MSFT Aug 29 '17 at 04:44
0

Team Foundation Sidekicks from Attrice (just Google it) are very helpful here. You can find all workspaces and delete the ones that are locking the files you need.

Jim Roth
  • 399
  • 2
  • 9
0

If you install TFS PowerTools for whatever version of TFS you have (e.g. TFS 2015 you should use https://marketplace.visualstudio.com/items?itemName=TFSPowerToolsTeam.MicrosoftVisualStudioTeamFoundationServer2015Power)

It adds many useful things, including ways to do this through the UI.

With Powertools installed:

  1. Open Soruce Control Explorer in Visual Studio
  2. Right click some file or folder or Team Project and select from the fly-out menu "Find" > "Find by Status..."
  3. Choose to "Display all checked out" or optionally search for just the files checked out to the deleted user. Then click "Find"
  4. Choose/Highlight any User/Workspace/File combination desired and Right click and "Undo..."
  5. Choose OK/Yes to all the prompts confirming you want to do it and informing you what the remote workspace would have to do if you continue.

I've had to use this many times because a developer's machine/hard-drive fails, or a mapped workspace folder was accidentally removed, an unused VM was reclaimed before properly disconnected from TFS, etc. I prefer doing it through the UI vs command line.

Arkaine55
  • 548
  • 6
  • 15