I start by making a copy of the project from C:\ DataFlex 18.2 Examples to the folder C:\Projects\Automated Testing.
Making a version control repository
I am using Mercurial, with GUI front-end tool TortoiseHg, but you can do the same in Git. (There are of course many version control systems available, but I wholeheartedly recommend using a distributed version control system, such as Mercurial or Git.)
The first thing I do is create a Mercurial repository. In Windows Explorer, right click on the folder “Order Entry”, select TortoiseHg, and “Create Repository Here”
I keep the default settings, and select Create.
Before checking in the workspace, I tell Mercurial to ignore certain files that are created automatically. A good starting point is Dennis Piccioni’s blog entry, Configuring Source Control for Visual DataFlex. I end up with the following .hgignore file:
syntax: glob Programs/*.exe Programs/*.dbg Programs/*.exe.manifest AppSrc/*.dep AppSrc/*.prn AppSrc/*.fld AppSrc/*.pbg AppSrc/*.pdp AppSrc/*.pkd AppSrc/*.prp AppSrc/*.err Data/*.cch DDSrc/*.bak Programs/Reindex.log IDESrc/*.dsk IDESrc/StudioMetaData.mtd IDESrc/Workspace.loc
Finally, I check in all the files. First, I select the Commit view in TortoiseHg.
Then, I select all the files, press the Commit button, and enter a commit message (confirming to add the selected untracked files).
Finally, I start DataFlex Studio, compile and run the Order Entry project, and check to see if any files have changed.
In TortoiseHg, in the Commit view, I press F5 (refresh), and see that two files have indeed changed:
Upon closer investigation, the Order.cfg file has AutoIncrementBuild=1. So this file will change every time I compile the project. Since these files don’t contain any information that I am interested in for this particular project, I right-click on the files and add them to .hgignore.
Now we have our project under version control, and can move with greater freedom – because we can always go back if we mess something up.
The final step is to add the VDFUnit library as a subrepository for the project.