Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VFP and Source Code Repos

Status
Not open for further replies.

Stevo123

IS-IT--Management
May 10, 2012
9
US
Hi All,

I'm new to FoxPro and have purchase a small software company (2 person company) that has a single app that is written in VFP. I've never used VFP before but am starting to get used to working with it.

I just set up a Mercurial repo as the previous owners never used anything to manage their source code. This is especially important for me as I'm still learning VFP and need the ability to revert to previous versions of code if I inadvertently break something!

Does anyone have any guidelines about what files are safe to ignore in my repo? Like do I need to store the FRX files for example. They seem to be generated (compiled) as I go so their changes seem safe to ignore (I am safely storing the PRG files for example).

Any other files I could safely write into my ignore filter in Mercurial?

Thanks! :)

Steve
 
Hi Steve,

The following is a list of the file types that are usually kept under source control:

SCX
SCT
VCX
VCT
FRX
FRT
MNX
MNT
PRG
H
QPR
Config.FPW
DBC
DCT
DCX

I don't think there any others, but it's possible I have missed somE. If so, others will chip in.

The ones you don't need to keep include FXP (compiled programs) and MPR (generated menus).

Most of the above file types are not text files. If your repository supports file comparisons and searches, you will need to convert them to text. See the Help topic, "How to: Check for Differences in Forms, Reports, and Other Table Files" for information about that.

In fact, there's a great deal of useful information in the Help file. Just drill down to "Source control".

Hope this will get you started.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
A couple of other quick thoughts, while I think of them:

If you want to integrate your source control system with the Visual FoxPro development environment, you will have to use the Project Manager to open your files. Doing this will automatically check the files in and out, but unfortunately it can be quite slow. If you open your files by some other means (such as from the menu system or the command window), you will have to remember to check them out manually.

When checking in and out manually, be aware that most of the source files are in fact two distinct files. For example, a form is an SCX file, but it also has an associated SCT file. Similarly with reports (FRX and FRT). You must be sure to check both files in and out at the same time.

Given that you are just starting the learning process with VFP, I wonder if it would be better for you to not bother with a source control system at the outset. You said that your main reason to use it was to revert to earlier versions, which makes sense. But it would be simpler to set a up a simple rolling backup system to do that. In other words, when you start work on a file that you might want to roll back, you first make a copy of it in a designated directory or under a modified filename. You can do that from within the development tool, using File / Save As, and that will guarantee that you will copy both the associated files. You can always incorporate source control later, when you are fully working in a team.

Hope this helps.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
Thanks Mike - really appreciate the tips and advice! I am in a situation where the previous owners are helping me out with some of the more complex code changes and we are starting to trip over each other's feet just a little which is why I wanted to go with a source control system! The software application is set up as a project so I'll read up on the source control in the help file too!

Steve
 
Welcome to the VFP world.

Since you are new to VFP you might want to take some time looking over the free on-line VFP tutorial videos at:
There are a few other good ones at:

While these do not cover Source Code Control, they might help you move away from having to use the previous owners as much.

Good Luck,
JRB-Bldr
 
In regard to VFP with Mercurial, you'll find this helpful: [link stackoverflow.com/questions/8995078/visual-foxpro-with-mercurial][/url], more specifically the mentioned slides at [link bit.ly/IgXzhM][/url].

In regard to skipping files from version control: There are only few to skip, eg BAK files, but really not much, even the generated files contain your code or design, as in case of the FRXes. You can see inside them, as they simply are foxpro tables, eg you can USE your.frx to see the generated data. But add a report control and this will add a record there, so your changes are reflected in that file, which makes it a file you also want to add to the versioning control system.

Most of those files don't come alone, eg an FRX also has a FRT files, that's the same pair of files as DBF and FPT. You have to treat them as binary files to mercurial, but you shouldn't skip them.

Bye, Olaf.
 
Actually it#s not just some slides, though it was created for the southwest conference...you'll like it. It should cover all questions regarding VFP with Mercurial.

Bye, Olaf.
 
Beautiful - thanks Olaf and JRB-Bldr! I'm going to be watching those videos this week! Appreciate the pointers!

Steve
 
You can't integrate Mercurial with VFP, but because it's a distributed source control system, you don't need to explicitly check files in and out. I'm using it on a couple of projects and finding it works out well. This is the first source control system that's been easy enough to use that I do it.

Rick Borup's white paper that you've been pointed to is a terrific resource for using Mercurial with VFP. He'll be doing an advanced session on that topic at this year's Southwest Fox.

Tamar
 
I didn't see DBF, FPT, and CDX files listed. Personally, I don't think they should be saved, but you should know how to recreate them in code. If you're connecting to SQL Server or another server-based database, you'll need script files for it to recreate the database, logins, stored procs, etc. Also, any development documentation such as .doc, .docx, .txt, Visio, etc should be stored. If you create help files with a program such as DocToHelp, HTMLHelpBUilder, etc, the source files for those should be kept too.

Craig Berntson
MCSD, Visual C# MVP,
 
I don't store DBFs, FPTs or CDXs under source control, but I do store the scripts that I use to create them.

I would also add to the list the source files for your setup system. I use Inno Setup, so I keep ISS files under source control.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top