开发者

TFS: How to dectet changed files when loading a solution?

开发者 https://www.devze.com 2022-12-27 13:16 出处:网络
I am new to TFS integration with Visual Studio 2010, and I have a problem I would like to solve. Practically, when I open a solution, how can I detect, looking only at the Solution Explorer which fil

I am new to TFS integration with Visual Studio 2010, and I have a problem I would like to solve.

Practically, when I open a solution, how can I detect, looking only at the Solution Explorer which file has been changed since my last login?

I am able to discover the changed files if I look at the Latest开发者_StackOverflow column of Source Control Explorer but it is not so intuitive.

I attach you an image for better understanding.

alt text http://img37.imageshack.us/img37/9308/mainmicrosoftvisualstud.jpg

I would like to have a different icon, not the lock, for frmAbout.vb (in this case), associated to the item in Solution Explorer. Do you have any idea how can I achieve this behavior? Or some alternatives (plugins) for Visual Studio 2010?

EDIT: We are a small team of 3 people, and we need to be aligned on each line code changed because we are interchangeable. Therefore for us having a clear visible icon, would be helpful.

EDIT2: Bounty time finished again, without a real solution. If you know a plug-in that implements this behavior, please let me know. If I find some spare time I will try to write it.


First of all, just checking for cases where a file has been updated isn't sufficient. You also have to consider cases where files were added on the server, but you don't have those files yet... likewise in cases where a file is deleted on the server but hasn't been deleted from the local workspace.

Lucky for you, all this is built into Team Explorer in VS2010. All you have to do is:

  1. go to the Source Control Explorer
  2. right-click on the root folder of your solution (or any folder, really) on the tree pane on the left, and choose "Compare..."
  3. Choose your comparison options (the defaults will work fine for what you want to do) It will run a full comparison. When done, you will be presented with a "Folder Difference" window which shows all cases where the server and your workspace differ (these will be highlighted in red)
  4. Right-click on any item that's out of sync (or an entire folder) and choose "Reconcile..."; at this point you can choose how to resolve the differences.

And that's about it. Hope this helps.


What I put here is based on what I know with TFS and Visual Studio 2008, but I don't think much has changed on this area. (Feel free to correct me if I'm wrong ;))

  • In the solution explorer you see if you have a file checked-out.
  • In the source control explorer you can see if you have a latest version of a file

These 2 are entirely different things. TFS works with "Change sets" which is a set of changes you do localy with checked out files. Once you have done editing these you check-in all your changes at once. Multiple team members can check-out the same file. If this happens the changes are merged when the file is checked in.

You do not automatically receive the latest version of the files locally, untill you checkout a file or use "get latest version."

AFAIK there's no way to indicate if you have the latest version of a file in the solution explorer.

Hope this helps.


My question is "why do you care?" If you're working in a team environment where multiple people are making changes to the source, just remember to frequently perform forward integration into your workspace.

We're doing this right now, and our standard is to do a "Get Latest" recursively on the solution before starting work. If there are any conflicts, you'll get to merge them. Otherwise, you have latest.


Why are you not using a Source Control that has a plugin that integrates into VS? Depending on the platform (SVN, git, Hg, TFS) there should be numerous plugins that will tell you if something has changed. What's not succeeding in those cases?


Not sure this will be useful, but another workaround of your problem. First of all, you can set “Get everything when project or solution is opened” option at Tools -> Options -> Source control -> Environment page. This guarantees you have latest version after solution is opened. Second, after “Get everything” operation, check Output window. Select “Show output from” = Source Control. You will see all changed files in a convenient list form.

0

精彩评论

暂无评论...
验证码 换一张
取 消