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

早过忘川 提交于 2019-12-02 17:41:08

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

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.

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:

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.

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.

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