Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get specific changeset version treated as changes relative to latest version?

I rolled back a changeset. Now I need to check out the changeset that was rolled back with 'actualized' pending changes. So like everything is before the commit of the changes.

When I get specific version with files override I see nothing in pending changes window. How can I get the state I need? Is it possible?

like image 575
Pavel Voronin Avatar asked Oct 06 '14 07:10

Pavel Voronin


People also ask

How do I get a specific changeset in TFS?

Take searching for a changeset in Visual Studio's TFS Source Explorer. Luckily if super easy to do! When you're in the Source Explorer, simply press Ctrl + G and the Find ChangeSet dialog will appear.

How do I get a specific version of TFS?

You can use the File/Source Control/Advanced/Open From Server... to load the latest version of a solution into your sandbox. Once you have the latest, you can use Tore's suggestion of Right Clicking on the solution then Source Control/Get Specific Version... to pull down the labelled version you want to work on.

How do I edit a changeset?

Click on the Changeset [number] link for the changset you are interested in. Above the changeset details panel click on the little speech bubble with the plus sign, a textbox will appear and you can enter your comment - hitting Enter will save the comment.

How do I get a new changeset number in TFS?

If you don't know the number, to find a changeset, In Source Control Explorer, on the menu bar, File => Source Control => Find => Find Changesets. The Find Changesets dialog box will appear. (Optional) Next to the Containing File box, choose Browse.


1 Answers

After doing the "Get Specific version" you need to check out every file in the changeset manually (right-click, check-out). Be sure that you have the "Get latest on checkout" turned off.

After that perform a get latest, which will prompt you to merge. This is going to be a more tricky merge, since Visual Studio will assume that the newer version is what you want. When you're satisfied, check in the code.

Alternatively start with the same steps as the first solution, but instead of immediately doing a get-latest, you can create a shelfset after you've checked out each file and then perform a get latest. When you're on the target version, unshelf your changes, resolve any conflicts and check them back in.

Another trick you could apply is to find the changeset number that contains the rolled back changes. Since this checkin is a compensating checkin, you might also be able to re-do the changes by rolling back that compensating changeset. I tried this in a local workspace and it works. Again you might need to go through a merge and it's hard to tell exactly which changes to pick.

My best advice on this is: try not to get into this situation :).

like image 62
jessehouwing Avatar answered Sep 21 '22 01:09

jessehouwing