views:

163

answers:

5

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 column of Source Control Explorer but it is not so intuitive.

I attach you an image for better understanding.

alt text

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.

A: 

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.

Jeroen Landheer
And by default you don't even get the latest version when you check out a file. You have to change that setting in Tools->Options->SourceControl->Visual Studio Team Foundation Server: Get latest version of item on check out.
Ryan
True, this is done to prevent "poluting" your local change set. (It can be that the latest version of code checked-in has some dependancies on other changes in the code tree, which you don't have yet.)
Jeroen Landheer
+1  A: 

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.

Robaticus
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.
marco.ragogna
+3  A: 

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.

Warren
@Warren this helps, but if possible I still would like to have a direct highlight in the solution explorer. If not, we have to adapt I suppose.
marco.ragogna
You could look into writing your own VS plugin to do that.
Warren
@Warren probably I should write it myself, unfortunately I have no experience on VS plug-in development. I will try as soon as I have some spare time
marco.ragogna
A: 

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?

drachenstern
@drachenstern We are evaluating TFS2010, because it is included in our MSDN subscriptions. Till now it seems good, but it misses this little feature that would help us.
marco.ragogna
A: 

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.

Maxsur