views:

310

answers:

3

When you right click on a file and select "Compare...", you get a few different options:

  1. Changeset
  2. Date
  3. Label
  4. Latest Version
  5. Workspace Version

The first 3 are pretty self explanatory. But what is the difference between the latest version and workspace version? 4 seems like you are comparing the code on your machine to the latest version in TFS 5 - shouldnt this be just like (4)? (I thought it might allow you to compare against multiple workspaces, but the dialog doesnt seem to have an option to select a different works space.)

+2  A: 

Latest Version refers to the last version that was committed to the TFS Source Control while Workspace version refers to the last checked-in version in your local workspace.

So basically the Workspace version Compare will will compare the file(s) you are comparing with your checked in files. While the Lastest Version Compare will compare it against files that may have been checked in by someone else on your team.

Robert Kozak
So what happens if I have not checked in my code and I have never edited that file before. What does the workspace version compare against? (As I have no files checked in and I wish to check the file I currently have checked out and made edits to).Very confusing....
Rajah
It will compare your version with the clean version in TFS without any other checked in versions from when you last got latest.
Robert Kozak
A: 

The confusion between 4 and 5 mainly comes (for me) on what you think you're clicking on. When you click on the file in Source Control view or in Pending Changes, TFS treats it as if you're clicking on the file in source control that you last synched to, not the local file.

Most of the time 4 probably won't be used as (I assume) you'll be synched to latest most of the time.

Herms
+1  A: 

THe difference that I have found between Latest Version Workspace Version

Latest version - compares your current code file with the most current code file on TFS server. (This includes all the changes made by your fellow code monkeys and checked back in since you checked out the file). This form of comparison will show differences only if you have multiple checkouts enabled.

Workspace Version - compares your current code file against the code at the time that you had checked out the file. If you have multiple checkouts enabled and some of your fellow code monkeys have checked in changes - then, you use this option to see what you originally changed. You then will have to compare against the latest version to see if there will be any conflicts while you are checking in your code file.

Rajah