How does TfsInterface Workspace member initialize when TFSDIFFSOURCE set to shelf?

Oct 31, 2011 at 11:36 PM

This is my first time trying to use Malevich and early on I have been experiencing an unhandled exception on TFS.cs line 406. Each time I hit this, I am attempting to run review.exe with TFSDIFFSOURCE set to shelf.

After debugging, I noticed that before ProcessCodeReview is called, initiating down the call stack to where this occurs, the call stack followed from the earlier call to sourceControl.Connect() traces down into the TFS namespace's implementation of ISourceControl.Connect(). In TFS.cs line 281 I see where Tfs.GetFilesFromShelveSet (the boolean set to true when command switch TFSDIFFSOURCE has been set to shelf) is checked, and only if it's false (i.e. TFSDIFFSOURCE = local) is the Workspace member of TfsInterface instantiated.

After looking through the code, I don't see anywhere else that the Workspace member of the TfsInterface type SourceControl object is to be instantiated. And as noted, without its instantiation, it results in a NULL exception when line 406 of TFS.cs attempts to call a method on its object.

By removing the conditional "if (!Tfs.GetFilesFromShelveSet)", I notice that Workspace is instantiated, of course, and review.exe seems thoroughly capable of running through to create a new review for me, even while running with TFSDIFFSOURCE set to shelf. Removing this check also of course allows me to run with TFSDIFFSOURCE set to local, if I chose.

My question for this thread is what is the reasoning behind the conditional logic "if (!Tfs.GetFilesFromShelveSet)"? As I'm new to this codebase, I obviously feel less than comfortable simply removing it, as I assume there must be a specific purpose for it. At the moment, however, I'm unable to see what that purpose is, and in current state review.exe will not complete successfully with TFSDIFFSOURCE set to shelf.

 

 

Coordinator
Oct 31, 2011 at 11:40 PM

Are you trying to compile Malevich from the source? If so, I would recommend using the binary distribution instead. The current source "tip" has not yet been fully debugged, and it went through a significant modification. The binary is extremely stable.

Oct 31, 2011 at 11:43 PM

I see.

So, I've already gone through the steps to compile Malevich and deploy from source to configure the server (i.e. webUI, SQL, etc.). Do you think I can continue with this, and just use the binary distribution for review.exe, and reviewnotifier.exe?

Or do you have warnings about the stability of everything from source, WebUI, DB, and client pieces?

Thanks for the quick reply!

Coordinator
Oct 31, 2011 at 11:46 PM

No, the old version of review.exe won't work with the new server. Upgrading (in this case, downgrading) is really straightforward though - just run the Malevich installer (MSI is just a shell, all the work is done by the installer exe that MSI installs on your desktop), and it will perform the downgrade.