Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gated Checkin: Sheving the Sources causes rollback in Visual Studio

One of our developers discovered something very strange in Gated Checkin Builds which seems to be a feature of Gated Checkins.

When launching a Gated Checkin, the solution in his Solution Explorer seems to go back to the last Version Checked in. After the build is completed Visual Studio shows an error or success message with the button in German called "Code aufnehmen" (in English: "Reconcile...")

After clicking he gets back his changes.

I know that in Visual Studio you can choose to revert your solution when shelving it. It appears to me that this is what Visual Studio does by default.

Is it possible to set Visual Studio or TFS to not revert after shelving for Gated Checkins? Or maybe someone can tell me the reason why Visual Studio does it.

like image 875
sebastianmehler Avatar asked Oct 09 '22 03:10

sebastianmehler


1 Answers

The whole process with Gated checkins is that TFS:

  • Constructs a Shelveset with all changes
  • Tries to Build the latest state of the codebase + this Shelveset &
  • If all succeeds, Shelveset gets commited into the repository

By default, TFS will revert the Developer's workspace into the last checked in during this operation. This can be changed with the following:
enter image description here

By doing this, Developer can directly continue working, but once the build is over trouble & conflicts may arise when reconciling the local workspace.

In general, gated builds should last as less as possible. If this principle is kept, the reaswonable way to proceed is to avoid setting the "Preserve" option.
If the Build last longer, than -say- 5 mins, it might be worth doing so.

A very nice description of the Gated Checkin functionality can be found in this article by P.Carnahan.

like image 115
pantelif Avatar answered Oct 16 '22 11:10

pantelif