Monday, February 4, 2008

FRAG! I have checked in the code in TFS05 I did not mean. What do I do now?

Hypothetically speaking...

Lets assume that one of my "friends" made a big mistake and have checked in the code into TFS, and broke the build, and screw up the code that was frozen & suppose to be ready to go to the production!

So, what can the "friend" do at this point, considering that once the code is checked in into the TFS source control it does become part of the permanent record.

Well the "friend" has found that the easiest thing to do, besides blaming the PM is to do following:

1. Find the Changeset that was preceding the check-in, one can do it by right clicking on the solution/project/file(s) (I think solution or project would be preferred to ensure that all changes will be rolled back) and selecting "Get Specific Version"; from the Type dropdown select "Changeset" and using the Changeset dialog to display all change for the day or person.

2. Once the code for the selected Changeset is loaded, you still have nothing to check-in, so trigger the checking process, select solution/project/file(s) and select "Check Out for Edit".

3. Now one should be able to check-in the back into the source control by selecting "Checkin Pending Changes".

4. Here is where the fun comes, during the check-in process "Conflict" dialog will popup, one should select the file(s) and click on "Resolve" choice and select "Discard Server Changes".

5. Now that all conflicts has been resolved, repeat step 3.


Alternatively, one may download Team Foundation PowerToys (TFPT.exe) and use one of the nifty commands: tfpt rollback /changeset:###; if there are any conflicts detected user is presented with a "Merge" dialog.


Jon Kruger said...

That has to be worth at least a dozen donuts!

Anonymous said...

Steve Horn unavaliable for comment :-x