In line with the approach taken in the Changes & Versions
Tool, a user can make changes and commit a series of transactions, and when
ready to version, can press the
Save Version
button in the Changes & Versions Tool. The VCS integration puts the current
state into the VCS working directory, and makes a VCS version from
there.
The VCS working directory is kept separate from the
MetaEdit+ directory, because VCSs cannot work sensibly with a live set of
database files. MetaEdit+ copies the repository into the VCS working directory
(using its backup functionality to allow the user to remain logged in). It also
writes the current textual snapshots of each graph, and the metamodel as a
textual snapshot, including generators as separate .rep files. These textual
files add about 10% to the initial size, but as only small parts change in
subsequent versions, the improvement in the ability to compare versions within
the VCS itself is well worth it. The VCS working directory contains the textual
snapshots of the graphs, a
metamodel
subdirectory containing each Graph type’s generators and textual snapshot,
and a
versionedDB
subdirectory containing the MetaEdit+ repository files.
The standard way of using command-line VCSs –
manually change a file, and in a separate command manually tell the VCS that the
file has changed – is not necessary in a situation where a tool can
guarantee that what is in the working directory is the exact state of the next
version. Only a few VCS commands are thus needed, and MetaEdit+ will handle
calling them. The commands are specified in a few MERL generators called by the
various phases of the Save Version action. Having the commands in MERL
generators allows users to tweak the integration if necessary, and also to add
integration for new VCSs. The generators are saved in Graph, as
_vcs*, with a suffix for the VCS name
when necessary – e.g.
_vcsCheckIn_git() checks in the current
working directory contents, adding and committing them locally, and syncing and
pushing them to a remote Git repository if one is
defined.