Version Control and Altium Designer

Old Content - visit altium.com/documentation

One of the greatest strengths of an electronic authoring and editing environment is the ease with which you can create and modify a file. This capability means that ideas can be captured, explored and matured quickly – be it code, user documentation, an image, or your next presentation. It also means that it can be very difficult to keep track of changes made to your valuable files. This need to keep track of changes made to a file, combined with the need for a systematic solution for managing source captured in an electronic form, has given rise to Version Control Systems. Version control systems are software tools that are not only able to maintain a history of the various versions of a file, they also support opening any revision of that file, as well as for ASCII files, comparing changes made between any two versions of the file.

Version Control Systems can be operated completely independently of the authoring and editing environment used to create a file. There is an interface that allows you to check files into a central storage area called the repository, a check-out feature to copy a file from the repository to a working folder, an update feature to check back in any changes, and a method of logging information about a change. Typically a version control system will also handle the situation where a file has been checked-out and modified by multiple people, who could then check their changes in on top of each other, potentially losing someone's work from the latest revision. Dealing with this requires tools to compare versions of the file to detect differences, and an interactive tool to merge the differences back into a single version of the file.

It is important to understand the terminology used with version control systems. Even though there are numerous systems available, they generally all use similar terms to describe their functionality.

Version Control Basics

The basic approach to working with a version control system is to "update", or "check-out", the project files that you want to work on, from the repository, into a working folder. These can then be modified and saved, and when you decide it is appropriate, the updated files can be "committed", or "checked in" to the VCS's repository. Check-out and check-in is performed through a version control system interface, which Altium Designer has built into its Storage Manager panel and Projects panel.

Simple diagram of how Altium Designer interfaces to a Version Control System (VCS)

The key to how a version control system works is that it monitors the status of files that have been checked-out of the central repository. This means that the VCS knows that a file has been checked-out into your working folder, what revision was checked-out, and if it has been modified since it was checked-out. Each VCS uses its own approach to monitoring files, refer to the VCS documentation if you need further information about this.

The figure above shows the 3 files in the project My.PrjPcb. All the various revisions of each file are shown in the repository, with the latest checked-out copy in the working folder. When the project in the working folder is opened in the Altium Designer environment, Altium Designer recognizes that the project files are under version control, with the current version control status of each file being shown in both the Storage Manager and Projects panel.

The right-click menu in the Storage Manager panel allows you to a perform standard VCS actions, such as checking in a changed file. When you right-click and select Commit the VCS takes a copy of the file from your working folder, increments the revision number (stored internally in the VCS), and stores the copy of the file in its repository, along with a log message that you can enter to describe the changes made to the file. Most VCS systems do not store the entire file with every commit, instead they store the differences from the previous version.

Accessing Files under Version Control

There are essentially two different approaches to giving multiple team members access to the same set of files. You can either:

  • Allow multiple check-outs (referred to as the unreserved check-out model)
  • Restrict file access to one person at a time (referred to as the lock-modify-unlock, or the exclusive check-out model)

Allowing multiple check-outs is ideal as it allows your different team members to continue working independently, without having to wait for someone else to check a file back in before they can work on it. However, it does require that you have tools and techniques to resolve the inevitable situation where two people have modified the same file. There are excellent Merge tools available for merging changes in ASCII files, but generally there is not a lot of support for merging changes in binary files. Altium Designer includes schematic and PCB comparison (or 'diff') capabilities. While Altium Designer can detect differences between two revisions of a schematic or two revisions of a PCB, it currently does not support Merging, so resolving any differences must be done manually.

See Also

References

SVN community website http://subversion.apache.org/
SVN online manual http://svnbook.red-bean.com/
CVS community website https://www.cvshome.org/
CVS installation tips http://www.cvsnt.org/wiki/InstallationTips
CVS manual (known as the Cederqvist, after the author) https://www.cvshome.org/docs/manual/
Using and administering CVS http://cvsbook.red-bean.com/cvsbook.html
Alternate CVS download site http://www.cvsnt.com
Source Control How-to, by Eric Sink http://www.ericsink.com/scm/source_control.html

You are reporting an issue with the following selected text and/or image within the active document: