3.5.3 Use cases and phases
These tables show what exists in the MetaEdit+ repository
(db), VCS working directory (versionedDB, local .git/.svn cache, and its HEAD
pointer), and remote VCS repository, at each stage of an operation. At the
start, i.e. in the first row, a green background shows that element exists
already. A blue background in a subsequent row shows a change in that element,
and a gray background that the element continues unchanged. Bold texts are user
operations, and arrows show the direction in which information is flowing or is
copied. Most tables end in a row with
Save Version, which you can do
whenever you have new changes you want to version: see Section
3.5.4 for details of what Save Version
does.
The other VCS actions below can be run from the Changes
& Version Tool’s
Extra VCS Commands menu, e.g.
Init, or
from a Generator Editor on Graph, by running the corresponding generator
manually, e.g.
_vcsInit().
Starting from a MetaEdit+ db, set up versioning:
Init
MetaEdit+ db
|
versionedDB
|
local cache .git/.svn
|
pointers HEAD
|
remote VCS
|
yes
|
|
|
|
|
|
|
|
|
manual create
|
_vcsInit()
|
|
→
|
→
|
|
Save Version
|
→
|
→
|
→
|
→
|
See Section
3.5.2
for more details.
Starting from a version in VCS, get a MetaEdit+ db:
InitClone
MetaEdit+ db
|
versionedDB
|
local cache .git/.svn
|
pointers HEAD
|
remote VCS
|
|
|
|
|
yes
|
_vcsInitClone()
|
←
|
←
|
←
|
←
|
Save Version
|
→
|
→
|
→
|
→
|
Unlike other commands, InitClone is often run when you do not
already have the MetaEdit+ db on disk. This raises the question of where to run
it from, since generally to run a MetaEdit+ command you need to be logged in to
MetaEdit+. For a single user MetaEdit+ db, there are three ways:
| Log
in to an existing, different db, and temporarily change the
$dbName and other variables in VCS
Settings | Paths.... Run InitClone with those settings, then
Abandon to return that db to its normal settings, Logout, and Login to
the newly cloned
db. |
| Log
in to an existing, different db, and override the
dbName and other values from
_vcsPaths() with a
.vcsPaths file:
see Section 3.5.6. Run
InitClone with those settings, then Logout and revert
dbName and any other temporary changes
in .vcsPaths, then Login to the newly
cloned
db. |
| Without
logging in, set the git/svnBaseURL in
.vcsPaths (see
Section 3.5.6) and supply the
dbName (and if different, desired local
directory name) as an argument to
_vcsInitClone() in a
textForMERL: parameter on the MetaEdit+
command line:
mep55.exe textForMERL:
"_vcsInitClone('mydb')"
When the cloning has finished, close that MetaEdit+, start a new one and
Login. |
If the MetaEdit+ db already exists on
disk at $dbName in
$dbBaseDir, InitClone will not
overwrite it. This makes InitClone
also suitable for calling by a user logged in for the first time to
an existing versioned multi-user MetaEdit+ db, to set up the local VCS
directories.
In the single user version after
InitClone, if your
first login is with a different MetaEdit+ user account from the one that made
that version, you will receive a warning about the other user having been logged
in. You can ignore the warning and continue.
With a MetaEdit+ db copy that may be older than in VCS, update the db:
Sync
MetaEdit+ db
|
versionedDB
|
local cache .git/.svn
|
pointers HEAD
|
remote VCS
|
yes – old?
|
yes – old?
|
yes – old?
|
yes – old?
|
yes – latest?
|
_vcsSync()
|
←
|
←
|
←
|
← / →
|
Save Version
|
→
|
→
|
→
|
→
|
This can be run after login to help you ensure you are not
editing an outdated local copy, allowing you to keep the same single user db on
multiple PCs (for how to have different settings per PC, see
.vcsPaths in
Section
3.5.6). Sync will warn you if
it needs to update your db. (Note that Sync is not necessary within a multi-user
MetaEdit+ db, only when there is more than one copy of the same
repository.)
Take a look at an old version of a MetaEdit+ db:
CheckOut
MetaEdit+ db
|
versionedDB
|
local cache .git/.svn
|
pointers HEAD
|
remote VCS
|
yes - latest
|
|
|
|
yes – latest
|
_vcsCheckOut()
|
←
|
←
|
←
|
← old version
|
opens db copy in a new process
|
NO Save Version there
|
NO Save Version there
|
NO Save Version there
|
NO Save Version there
|
Note that your initial MetaEdit+ db will remain the current
working copy and HEAD: the old db is checked out alongside it, leaving VCS
contents and state unchanged. A new copy of MetaEdit+ will be started and will
try to login to the checked out repository as the same user.
In the single user version after CheckOut, if your
first login is with a different MetaEdit+ user account from the one that made
that version, you will receive a warning about the other user having been logged
in. You can ignore the warning and continue.
In the multi-user version after
CheckOut, you will
need to add an entry for the repository in the Startup Launcher, and start that
repository in a MetaEdit+ server process before being able to log
in.