Version control of Delphi 7 projects in TFS

See in this post how to put your designs Delphi 7 under version control in TFS and/or VSTS.

(Part 1 of 13 in the series under control of legacy projects in TFS)

The overview of version control under the TFS has changed a lot since it was introduced support for Git. Have two different models-the TFVC with a classic centralized approach and the Git with the new world of decentralisation – of course affects our options, especially in time of supporting technologies and IDEs. Delphi, as is to be expected, is no exception.

So, this post will cover the two scenarios – use of TFVC and using Git-Delphi projects. Let's start with the TFVC.

TFVC and Delphi integration

The Delphi 7 comes from a time when the "King" of version on the Windows platform was – believe it or not! -Visual SourceSafe.

(And it just occurred to me that most of the devs of Lambda3 should never have seen the VSS. I'm definitely getting old)

This means that the IDE of Delphi 7 is optimized for the SourceSafe and its centralized model of lock-modify-unlock (i.e. the good old "check out & checked in"). In this way, the TFVC fits like a glove in the user experience offered by the Delphi IDE.

Environment and prerequisites

To align the expectations, it is important you know how I set up my environment. After All, YMMV Smile

  • Windows 7 Ultimate, SP1, x 86, 2 GB RAM
  • Delphi 7 Enterprise

Now, let's talk a little bit about prerequisites:

  • Team Explorer 2013: Any integration with TFS passes necessarily by Team Explorer. You can download it from the Microsoft Web site (installation free for licensed users of TFS and/or VSTS). If you already have Visual Studio installed 2013 (Professional or higher) then you do not need to install Team Explorer, because it is already included with the VS.
  • Visual Studio Team Foundation Server MSSCCI Provider: "MSSCCI Provider" (pronounced "miss-kee") provides the integration between TFS and IDEs that use the MSSCCI interface (Microsoft Source Code Control Interface), created for the SourceSafe integration. In other words, the MSSCCI provider emulates the interface created for SourceSafe, "cheating" old IDEs and making them believe that they are talking to the SourceSafe database.
  • EPocalipse SourceConneXion: plug-in from a third party (i.e., $ $ $Smile) that makes the integration between Delphi and MSSCCI providers.

This integration occurs as whole in the diagram below:

High-level diagram with components Delphi-TFS integration
89

Configuration of the plug-ins

Here's the installation process of the various components required for habilitarmos integration. Install them in the following order:

Team Explorer

Start the installation by Team Explorer (TE). You can use the 2012 or 2013 but not 2015. In other words: you can even have YOU (or VS) 2015 installed on your machine, but it won't be enough. You still need to install (or VS) 2012 or 2013, because TFS MSSCCI Provider does not work with the 2015.

Team Explorer can be obtained in three different ways:

  • Through a direct download from the Microsoft Web site (2012, 2013);
  • On the Team Foundation Server media of corresponding version (i.e. == 2012 2012 YOU TFS, TFS 2013 == YOU 2013);
  • Or through the installation of Visual Studio (Professional or higher) of corresponding version. In this case just install the VS; The YOU will be included in the installation.

There is too much out of it. Choose one of the three ways above and then just next-next-finish.

TIP: after installing Team Explorer, it is always a good idea to install the Visual Studio Update corresponding to YOUR version you installed, as it may contain bug fixes. Inst
all the Update 5 in 2012 or YOU Update 5 in 2013.

Visual Studio Team Foundation Server MSSCCI Provider

What should be a very simple installation can become a process a bit confusing. That's because there are two versions of TFS MSSCCI Provider available in Visual Studio Marketplace:

The difference between both is the version of Team Explorer that each depends on. As a rule, use the 2010 version if you need to install in Windows XP. For newer versions of Windows (such as in our case, we're using Windows 7) use the 2013 version & 2015 (which works both with the 2013 and 2015). Download the correct version and then just next-next-finish.

TIP: sometimes it may be necessary to change the default MSSCCI Provider on your computer. This is especially true if you have other MSSCCI provider (like SourceSafe) installed. In order to use TFS, you must set your MSSCCI provider as the default. The only detail is that there is no native way to do this
. You can set the default provider directly in the Registry or download one of the various utilities available for it. In the past I've used the SccSwitch, but was discontinued. In my research for this post, I found this in CodeProject.Na doubt
, prefer to go directly in the Registry and edit in hand.

EPocalipse SourceConneXion

As mentioned previously, the SourceConneXion – key for integration with TFS-is paid. The version for Delphi 7 it costs 49 euros. Oh, before someone asks: neither Lambda3 we have no type of commercial link with the company EPocalipse. I'm indicating the plug-in simply because it was the only option I have found to integrate the Delphi with TFS. The good side is that you can download a 30 days trial version.

After a default installation next-next-finish, when opening the Delphi for the first time after installing the initial Setup screen SourceConneXion:

SourceConneXion initial Setup screen
480

In the next step the MSSCCI provider SourceConneXion question which you will use. Select the TFS:

Selecting the MSSCCI provider integrated with SourceConneXion
480

Then it's time to configure MSSCCI provider specific options in use. In the case of TFS, it gives the option to set the default file block model. The default behavior of the TFS is "None" (copy-modify-merge). If you prefer the exclusive checkout model SourceSafe, select the "Check Out" (lock-modify-unlock).

Setting the default file block model of the TFS
480

Remember that the SourceConneXion allows you to integrate the Delphi any versioning that supports the MSSCCI API, right? Therefore, a user can connect the Delphi to different version controls which, in turn, can use distinct names for the same operation. Imagine, for example, "Check In" on and "Commit" TFVC in Subversion.

To deal with these differences, the SourceConneXion allows you to customize the terms that will be used in its interface. So, you can use the classification corresponding to your version control system. By a happy coincidence, he uses by default TFS the same terms; Therefore, you can accept the suggestions offered.

Customizing the terminology of the version control system in SourceConneXion
480

With that completed the initial configuration. Note that now there is a menu called Source Control in Delphi, which offers access to the capabilities of TFS. It is through him that we will be adding our project the TFVC repository:

Adding a Delphi project for the first time to a repository TFVC
480

Now, enter the server (actually the Team Project Collection) and then select the Team Project where the project will be added:

Selecting the Team Project to add the Project Delphi
480

Then it's time to indicate which files of your project will be added to version control. Typically you'll want to add:

Indicating which project files must be added to version control
480

And finally a screenshot familiar to those accustomed to the TFS. Look at the default screen TFVC check-in there! Smile

Standard dialog box TFS check-in
480

In it we have all the resources that the TFVC offers for our projects: Association with work items, check-in policy, check-in notes. Complete integration.

Confirm check-in and ready. Our Delphi project is under version control in TFS.

Cool, huh? :-)
Cool, huh? :-)

 

From now on, use the Source Control menu to interact with TFS from the Delphi IDE:

Source Control menu with commands to integrate with TFS
480

One of the cool things to have a native integration with version control directly in the IDE is able to have easy access to change history. Source Control menu, select the Show Difference command to open the history dialog box. Here, you can select two different changesets to compare the changes between the two versions:

History dialog box, showing two selected changesets
480

Right-click on one of the selected changesets, and then click the Compare command. Opens a window of Visual Studio with the diff between the two versions of the selected file:

Viewing the difference between two versions of a file Delphi
480

Cool, huh? Now, it may be that your team prefer to use Git. In this case, let's see how to connect the Delphi to a Git repository of TFS.

Git integration and Delphi

Author: Igor Abade

Igor Abade V. Leite ([email protected]) is a Visual Studio ALM MVP (Microsoft Most Valuable Professional) since 2006. Speaker at various Software Development community events (TechEd Brasil, The Developers’ Conference, DevOps Summit Brasil, Agile Brazil, Visual Studio Summit, QCON among others), has also written articles in magazines and websites such as MSDN Brazil. Since March/2011 is one of the owners of Lambda3, a Brazilian consulting company specialized in ALM, software development and training. Visit his blog about VS ALM at http://www.tshooter.com.br/ and follow him on Twitter @igorabade.

Leave your comment!