Can TFS Pending Changes show files that are truly changed like SourceGear Vault?

一个人想着一个人 提交于 2019-12-03 03:08:10

问题


I have been using SourceGear vault for some personal projects and Team Foundation Server for work projects. One thing TFS is missing is a simple feature that Vault has on its check in dialog window.

In the Vault client, you can see if the checked out file changed from the previous version checked in. Here is a screen shot. Notice the column "Details"? That tells you there is a difference. The way this is super helpful is if you have to check out a entire project because you are going to do code re-generation. I'll check out my class library project and then regenerate my CodeSmith templates. Doing this may result in just a few specific files from changing. When I view the pending check-in screen, I see the files that really changed and I can compare to see the impact.

SO... can TFS do this? Maybe there is a 3rd-party tool that will do it for me? Is there a TFS SDK or PowerTool that I have to get. Anyone want to build it?


回答1:


Per this page, you can run this command from the Visual Studio Command Prompt.

tfpt uu /noget /r *

You'll need to have TFS Power Tools installed for this to work. Also, make sure you browse to the root of your mapped folder within the command prompt (ie - C:\TFS for example).

TFS Power Tools links (if you don't already have it)
TFS Power Tools for 2010
TFS Power Tools for 2012




回答2:


Select all the files in "Pending changes" window and activate the context menu. Then click "Undo..." > "Undo Changes" > "No to All". The files without changes will be rolled back.




回答3:


There is no need to undo the unchanged files, as TFS will notice they're unchanged upon checkin and will only associate the truly changed files. Any files checked out but unchanged are reverted to their last known checked in version and will not be associated with your checkin. It is impossible in TFS (though not very clearly documented) to check in an unchanged file. It will always revert to the previous version if there are no changes.

You can quickly undo your unchanged files by calling 'tfpt.exe uu /r' from the command line (you need to have the Team Foundation Power tools for this) or by using the "Undo unchanged" button in the Pending changes window. This removed any items from the list that are unchanged immediately. So that you can see exactly what you're checking in.

Though it might be that this option is added by the Team Foundation Power Tools or the TFS Source Control Explorer Extensions (which are a must have for every TFS user anyways).

See also:

  • https://stackoverflow.com/a/2100981/736079
  • https://stackoverflow.com/a/6387656/736079
  • https://jessehouwing.net/vsts-tfs-why-i-like-them/



回答4:


I don't like answering my own questions, but it looks like there might not be a real Microsoft solution out there. For me, this is how I handle the problem at the office using Visual Studio.

  1. Before I re-generate the business objects, I make a copy of the entire folder structure
  2. I check out the entire project or the root generated folder
  3. I start the code generator. Sometimes, I know exactly what is changing, but other times, I might make a lot of changes and I don't want to miss anything. My code generator at work also generates all the SQL files needed to DROP / CREATE stored procedures.
  4. Using SourceGear DiffMerge, I compare the folders of the just generated and the previously backed up folder.

This is pretty time consuming. I never thought of it as a problem until I saw Vault identifying that a file was different on disk from the repository.

Maybe you all can say how you do code generation / regeneration when working with a source control repository.




回答5:


I work in a corporate development environment where many developers may be working on the same file, and we have TFS as our source control as well. In our document of Best Practices for TFS, we really discourage checking out files that the developers don't intend on changing, that way we naturally exclude files without differences when submitting a changeset.

To answer your question, I normally just look at the "Pending Changes" window and run a Compare on the "changed" files that I'm unsure of--the Compare tool should immediately tell you if your local copy is the same as the server copy. Unfortunately, there's no real workaround other than what I suggested, but I don't see the scenario where I absolutely must check out an entire project branch for editing.



来源:https://stackoverflow.com/questions/3348134/can-tfs-pending-changes-show-files-that-are-truly-changed-like-sourcegear-vault

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!