View RSS Feed

Development Team Blog

Configuring Source Control for Visual DataFlex

Rate this Entry
This post contains information about configuring a source control system to be used for Visual DataFlex projects. This post can be used in conjunction with Source Control and Visual DataFlex 101: The Basics and Source Control and Visual DataFlex 102: Multi-Developer Use. Also, see my previous post, The Case for Source Control to learn why you should use it.

What Files to Check Into Source Control

The rule of thumb for checking in source code is only to check in files that are source code and files that cannot be recreated automatically. For example, compiled program files can be recreated automatically (by recompiling the application) from the source code. Here is a typical list of files not to check in from Visual DataFlex workspaces/projects:

  • \workspace\Programs\*.exe files
  • \workspace\Programs\*.dbg files
  • \workspace\Programs\*.exe.manifest files *
  • \workspace\AppSrc\*.dep files
  • \workspace\AppSrc\*.prn files **
  • \workspace\AppSrc\*.fld files
  • \workspace\AppSrc\*.pbg files
  • \workspace\AppSrc\*.pdp files
  • \workspace\AppSrc\*.pkd files
  • \workspace\AppSrc\*.prp files
  • \workspace\AppSrc\*.err files
  • \workspace\Data\*.cch files
  • \workspace\DDSrc\*.bak files
  • \workspace\IdeSrc\StudioMetaData.mtd file
  • \workspace\IdeSrc\Workspace.loc file
  • \workspace\IdeSrc\*.dsk files -- These are user-specific files created by the Studio to store breakpoint locations, etc. While not 'required' because they can be recreated by the Studio, I personally like to check these in on my individual projects so this information is retained.

The goal is to have everything in source control that you need to recreate the workspace/project from scratch if something goes wrong. A good way to test this is to check in everything you think you need, then check it out to a different location and test if it compiles and runs.

* Manifest files are created at compile time by the Studio. If you batch compile your applications outside the Studio using the standalone compiler, missing manifest files will not be recreated. In this case, I recommend checking manifest files in source control. As Anasazi Software's Dan Levene demonstrated at Synergy 2011, Microsoft provides a utility to embed manifest files into .exe files, named mt.exe. Google mt.exe for more information.

** As discussed in our forums, some developers archive the PRN file(s) for a released product version so they can use it as a reference when customers report errors.

Data and Other Binary Files

Handling data and binary files using source control is tricky and subjective. You can search the web and find many discussions on this topic and many opinions. The problem is that source control systems are set up to handle plain text files like source code, and the merge programs are not designed to detect and track changes in binary files that vary broadly in format, such as Word documents and databases.

For Visual DataFlex purposes, store the text files that contain your database schema info, such as .fd and .int files. You should probably back up your database separately. SQL database servers typically have backup capability built-in. If you use the embedded database, depending on the size of the data, you may or may not want to keep it in source control. If I am developing a project and have a small test database with limited embedded data, I'll typically zip up the data (*.dat, *.hdr, *.vld and *.k??) and check in the zip file.

For some projects, I have a documentation subfolder with notes that sometimes include Word documents and other binary files. I track changes in these using Word's built-in change tracking and check the latest version into source control without merging.

Creating a Vault Repository

Vault has an administrative control panel that you can access through a browser. Here, I've created a repository named 'source control blog' for this demo.

Name:  VaultAdminCreateNewRepository.jpg
Views: 1639
Size:  36.6 KB

I always check 'Require check in comments' to force myself to type comments when I check in any code. It's a "nag" option you'll be thankful for later when you view your code changes.

Vault Client Configuration

I will go over some of the more interesting configuration options using Vault Client 5.0.3 (the version I have installed). Open the Vault Options dialog from Tools > Options. I suggest that if you are new to source control, you configure your options as I have mine to get started. Then, as you get more experienced, you can tweak the options.

  • In the tree view on the left, click on Concurrent Development Style. We use Vault in 'Edit, Merge, Commit (CVS Style)'. Start on this tab page, since making a Style selection this will default some of the other options to this style.
  • In the tree view on the left, click on General. I personally like to check 'Show non-version-controlled files ghosted in file list' and 'Show non-version-controlled folders ghosted in folder tree'. This makes it easy to see files and folders that are not checked in without doing a diff.
  • Still on the General tab, I always check 'Act on folders recursively' to make it easier to work with subfolders (e.g. typical VDF workspaces).
  • In the tree view on the left, click on Diff/Merge. Leave these settings as they are if you use the built-in Diff tool. I use Scooter Software's Beyond Compare as a Diff tool. It's a great tool, inexpensive and quite popular, so here are the settings I use for running it with Vault (only for Diff, leave the Merge settings as they are):
    • Program: C:\Program Files (x86)\Beyond Compare 2\BC2.exe (or wherever you have Beyond Compare installed).
    • Arguments: /leftreadonly /title1="%LEFT_LABEL%" /title2="%RIGHT_LABEL%" "%LEFT_PATH%" "%RIGHT_PATH%"

There are lots more options, but I think these are the ones that really matter.

Visual DataFlex Studio

It has been suggested that we add source control features to our Studio. These suggestions and their implications can range rather widely. For Visual DataFlex 16.1, we made some improvements in this area by adding and tags and the ability to configure the command and command line separately to the Studio's Configure Tools Menu.

We welcome any suggestions you have to improve Visual DataFlex, please keep these coming!

More Information

Source Control is a huge topic in itself. There are lots of books available on it, lots of tools, blogs, Wiki articles. Just Google anything in this post and be ready for hours of fun.

Here's a list of resources I find particularly good, interesting or "on target":

  • Wil van Antwerpen's article on about using subversion with Visual DataFlex
  • Eric Sink's Source Control HOWTO. Eric is the founder of SourceGear, the company that makes Vault, among other products, and he knows his stuff.
  • See the comments section of all blog posts on source control for more information. Lots of good feedback there and thanks everyone for that!


  1. Marco's Avatar
    Good article.
    The first and in my opinion most important change to VDF Studio to better respect a file's Read-only attribute.

    The studio does show a red circle with backslash symbol in the status bar, but I would suggest:
    - Different icon in the Workspace Explorer
    - Different icon in the File Navigator
    - No changes allowed to the file

    This would assist the Source Control Users, to properly checkout the sourcecode before they make any changes.
  2. matthewd's Avatar
    One thing that would be nice (if it hasn't already been done in 16/16.1) is to add some CRLFs to the DDCLassList.xml file in the DDSrc folder. (Compare it to Appsrc\config\classlist.xml, which has plenty of newlines, so there must be some way of doing it!)

    We put DDClassList.xml under version control, but without a single CRLF in the file, CVS chokes when it tries to merge different versions together. Same with Beyond Compare--without any newlines, you can't even manually merge two different copies together. So when different developers add new tables, they must each register the other's new data dictionary classes in the Studio.

    I would imagine that any source control system would have similar problems unless it has specific capabilities for comparing XML files.
  3. Dennis Piccioni's Avatar
    Matthew, we already did this, either for 15.1 or 16.0, I think.