2

I know we can go to solutions explorer and select files to do check in lock, but this is slow. Is there any extension or option to just do check in lock on all the files with pending changes?

Nitheesh
  • 47
  • 8
  • What's the detail mean of `lock on pending changes` are you talking about? Did you just want to check in other's locked files? – PatrickLu-MSFT Apr 10 '18 at 06:20

1 Answers1

2

If what you are talking about is check-in lock. For example:

Developer A has checked out $/FabrikamTFVC/Main/Source/FabrikamFiber.CallCenter/FabrikamFiber.Web/Web.config in the FabrikamTFVC project with a check-in lock type. So while other users can check out the Web.config file, no one can check in Web.config until developer A has lifted this lock:

enter image description here

In the following image, Web.config is checked out with the check-in lock. This is represented by lock in the Pending Change column:

enter image description here

You could download TFS Power Tools and you can see Find by Status under Find in the Source Control Explorer. Then follow the below steps -

  1. From the Source Control Explorer find the folder containing the locked file(s).
  2. Right-click and select Find then Find by Status...
  3. The "Find in Source Control" window appears
  4. Click the Find button
  5. A "Find in Source Control" tab should appear showing the file(s) that are checked out
  6. Right click the file you want to unlock
  7. Select Undo... from the context menu
  8. A confirmation dialog appears. Click the Yes button.
  9. The file should disappear from the "Find in Source Control" window.

Source Link

Or you could try to use Lock command to remove other users lock for an item. Eg: c:\projects>tf lock /lock:none src/


Update:

You could also create your own customize check in policy to met your requirement. Check-in policy enforces constraints every time when files are checked into TFS source control. The user must meet the policy restriction, then could check in files.

How to please refer this blog: Creating TFS Custom Check-in Policy

PatrickLu-MSFT
  • 49,478
  • 5
  • 35
  • 62
  • Hi Patrick! Thanks for the answer. My problem is a little different. We have a big team of developers working on relatively small number of files. So the team keeps checking in same files concurrently and sometimes they mess up with merging to latest changes and the other times TFS itself messes up the auto merge. So I want a developer to check in lock the files with pending changes just before he is about to check in and merge all his changes properly and then release the check in lock after he checkin's all the files. – Nitheesh Apr 10 '18 at 14:36
  • 1
    @Nitheesh In this case, you could consider use custom check in policy, for example take a look at this similar question: https://stackoverflow.com/questions/20899859/tfs-set-a-branch-to-allow-check-ins-of-merge-changeset-only . If this not totally met your requirement, you could also create your own customize check in policy. How to please refer this blog: https://blog.devart.com/creating-tfs-custom-check-in-policy-part-1.html – PatrickLu-MSFT Apr 10 '18 at 15:04
  • @Nitheesh Any update on this issue, have it been solved? Did my reply helped or gave a right direction? If so appreciate for a vote or [marking it as an answer](https://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work) which will also helps others in the community. – PatrickLu-MSFT Apr 30 '18 at 01:50
  • We haven't implemented it yet, we have added a backlog item for this and we will work on this soon. The post you suggested " blog.devart.com/creating-tfs-custom-check-in-policy-part-1.html" I think is the way to go. We will use that as a starting point. If you can add it as a answer I will accept it. Thanks a lot! – Nitheesh May 01 '18 at 18:02
  • @Nitheesh Have done. Appreciate for your kindly remind. – PatrickLu-MSFT May 02 '18 at 09:11