Reputation: 63845
I'm a bit new to TFS. One common operation which is very easy with every other source control I've used is comparing two different revisions. Say you have 3 revisions. Revision 3 is my current local copy. There was some regression introduced with revision 2(or whatever). So, I need to see what was changed from revision 1 to revision 2. I'm not concerned about what was changed in revision 3.
How do I do this in TFS?
Upvotes: 3
Views: 143
Reputation: 7625
If you use the source explorer to 'View history" on a file, you will see a list of the verions in TFS. Then you can select two versions. Then right-click to compare the two versions.
Upvotes: 6
Reputation: 463
Actually, one of the things I absolutely love about TFS is the flexibility to compare various versions of files (I'll admit, I love the flexibility but the actual compare tool? Not so much).
You'll have to forgive any mistakes, it has been a while since I've used TFS but I still remember the general idea.
In the solution explorer if you right click the file and click compare, you will be presented with compare dialog. From here you select the two files you want to compare. Make sure both of them point to the server version path.
Under the "Source Version:" in the Type: dropdown, select "Changeset" (or "Date" if you feel confident enough). You should see an elipses that allows you to search for the changeset. You will now be able to select your changeset from history (you may need to press a "Find" button or something, I can't remember by heart). Select Your revision 1 (whatever changeset id that is) and "ok" out of the changeset selection.
The "Target Version" frame will be disabled if the Target Path is pointing to a local file (likewise for the "Source Version" and "Source Path"). So make sure your paths are all pointing to the server versions.
Under "Target Version:" in the Type: dropdown, also select "Changeset". Now using the same steps as above, select the revision 2 changeset.
Finally click "Compare" and enjoy!
Upvotes: 1
Reputation: 7586
If you are using Team Explorer inside Visual Studio, you can go to the Source Control Explorer window and select a file, then view history. Choose 2 versions and right-click to compare.
Upvotes: 0
Reputation: 52798
You can right click on the File and click "Compare...".
There you can set the same Server Path (e.g. "$/Project/Main/File.cs") and use the Changeset "Type:" and set a Changeset Id on the Source and Target.
Upvotes: 2