How To Use Gnu Arch

Table of Contents

Documents

arch is a Version Control System (VCS).

I suggest you move to git instead.

Register an ID to use Arch

$ tla my-id "FirstName LastName <email@address>"

Register An Archive Location

$ tla register-archive http://davuser:davpassword@arch.tuxee.net/archives
Registering archive: frederic@jolliton.com--2004-main

List Registered Archives

$ tla archives
frederic@jolliton.com--2004-main
    http://davuser:davpassword@arch.tuxee.net/archives

Setting The Default Archive

$ tla my-default-archive frederic@jolliton.com--2004-main

Get a project

$ tla get bzmap--main

Commit change

First create a log file with:

$ vim `tla make-log`
[tla make-log outputs a filename to edit.]

then commit the change:

$ tla commit
* imported frederic@jolliton.com--2004-main/bzmap--main--0.1

Full example to add and commit some files (here just the README file):

fred@mau ~/projects/bzmap--main--0.1--base-0 $ vim README
fred@mau ~/projects/bzmap--main--0.1--base-0 $ tla add README 
fred@mau ~/projects/bzmap--main--0.1--base-0 $ vim `tla make-log`
fred@mau ~/projects/bzmap--main--0.1--base-0 $ cat theFilenameReturnedByTlaMakeLog
Summary: Added a README file
Keywords: 

Added a README file. Mainly to test arch.
fred@mau ~/projects/bzmap--main--0.1--base-0 $ tla commit
A  .arch-ids/README.id
A  README
* update pristine tree (frederic@jolliton.com--2004-main/bzmap--main--0.1--base-0 => bzmap--main--0.1--patch-1)
* committed frederic@jolliton.com--2004-main/bzmap--main--0.1--patch-1
fred@mau ~/projects/bzmap--main--0.1--base-0 $  

Creating and Using Mirror Archives

I like to have the original source archive registered with it's regular name. The mirror archive is then registered under a different name.

The mirror archive can be one of two types:

  • Push mirror (you copy data from a local source archive to a remote mirror of the archive)
  • Pull mirror (you copy data form a remote source archive to a local mirror)

Push Mirrors

Register your source archive

$ tla register-archive bernt@norang.ca--2004-laptop /home/bernt/{archives}/2005-laptop

Register the mirror archive to copy to

$ tla register-archive bernt@norang.ca--2004-laptop-MIRROR http://user:password@arch.norang.ca/2005-laptop

To update the mirror use

$ tla archive-mirror bernt@norang.ca--2004-laptop

Pull Mirrors

Register your direct access to the source mirror

$ tla register-archive frederic@jolliton.com--2004-main http://user:password@arch.tuxee.net/2004

Now register your mirror archive

$ tla register-archive frederic@jolliton.com--2004-main-mirror http://user:password@arch.norang.ca/fj-2004-main

Reregister the source archive as the mirror source archive

$ tla register-archive frederic@jolliton.com--2004-main-mirror-SOURCE http://user:password@arch.tuxee.net/2004

This allows you to commit changes to the remote source archive when you have internet access to it. It also allows you to tag changes from your local mirror when the source is unavailable. You can then commit changes to your local work archive and later update the source mirror when it is available.

Update the mirror from the source using

$ tla archive-mirror frederic@jolliton.com--2004-main-mirror

Update the Mirror Archive

Finally, copy data from the remote archive:

% tla archive-mirror lord@emf.net--2003b

Creating a New Project

# creating a new project
mkdir niftyprogram && cd niftyprogram
tla init-tree niftyprogram--mainline--0.1 # make this a project tree
vim niftyprogram.py              # make files
vim README                       #
tla add niftyprogram.py README   # tell tla these are source
tla tree-lint                    # make sure nothing was forgotten
tla import -S                    # create niftyprogram--mainline--0.1--base-0

Creating a Branch

To branch a project to tag an existing archive into a new project.

If you have an existing project proj1--main--1.0.0 that you want to branch into proj1--main--1.1.0 create the new project as a tag from the old project.

tla tag -S proj1--main--1.0.0 proj1--main--1.1.0

You then check out proj1–main–1.1.0 into a new project directory and work on the files normally.

Author: Bernt Hansen