Revision Control with Arch: Introduction to Arch

 in
Whether you're moving up from CVS or just getting serious about a revision control system, here's a powerful tool that will keep records of changes and keep your projects under control.
Obtaining tla

Arch was originally a set of shell scripts and wrappers around Tom Lord's hackerlabs libraries. The name of the program in those days was larch, and it was more than a little clumsy to use. The client now has been entirely rewritten in C and is called tla, which stands for Tom Lord's Arch. The interface is still not perfect, but it is good enough for regular use by a skilled developer. Packages of tla are available for most GNU/Linux distributions (see the on-line Resources).

Checking Out a Read-Only Project

Once you have tla installed, it's good to test it by checking out some code. Arch stores your data in a directory known as an archive. Within the archive, data is organized into nested categories: projects (the name of the work as a whole), branches (a particular thread of development or other descriptive term) and versions (a simple numerical indicator you can use to indicate how far a specific branch has progressed).

The first step to getting some code is to register a public archive so that Arch associates a name with the archive location:

$ tla register-archive http://www.lnx-bbc.org/arch

You should now see the lnx-bbc-devel@zork.net--gar archive listed when you run tla archives. If you're curious about what projects are stored in there, you can use the tla abrowse command to get a full list:

$ tla abrowse lnx-bbc-devel@zork.net--gar
lnx-bbc-devel@zork.net--gar
  lnx-bbc
    lnx-bbc--research
      lnx-bbc--research--0.0
        base-0 .. patch-10

    lnx-bbc--stable
      lnx-bbc--stable--2.1
        base-0 .. patch-29

  scripts
    scripts--gargoyle-bin
      scripts--gargoyle-bin--1.0
        base-0 .. patch-7

This listing tells us that the lnx-bbc-devel@zork.net--gar archive has two projects, lnx-bbc and scripts. The lnx-bbc project has two branches, research and stable. The lnx-bbc--research branch has only one version (0.0) and that version has had ten changes recorded in the archive. The lnx-bbc--stable branch has only one version (2.1) with 29 changesets.

Because you now have the LNX-BBC public archive registered in your local listing, you can check out a copy of the LNX-BBC stable branch:

$ tla get \
lnx-bbc-devel@zork.net--gar/lnx-bbc--stable lnxbbc

Once it finishes downloading and applying patchsets, you should have a directory named lnxbbc/ that is full of files. To simulate a change in the code, cd into lnxbbc/ and edit robots.txt to add a new comment somewhere.

Contributing Changes

Now that you have made a change, running tla what-changed should print M robots.txt to indicate that robots.txt has been modified. To get the details of the change, you can run tla what-changed --diffs, which should print out a diff file ready to be sent back to the project's development group:

--- orig/robots.txt
+++ mod/robots.txt
@@ -1,3 +1,5 @@
+# Welcome, robots!
+
 User-agent: *
 Disallow: /garchive/
 Disallow: /cgi-bin/

The drawback to this is that the diff does not indicate metadata changes. Moved files will not be listed, and new files will not be created when another developer runs this diff through patch. In order to submit a more complicated change to the project maintainers, you must generate a changeset.

In Arch, a changeset is represented as a directory tree full of bookkeeping files, patches, new files and removed files. The best contribution technique is to create a changeset directory and then tar it up for delivery:

$ tla changes -o ,,new-robot-comment
$ tar czvf my-changes.tar.gz ,,new-robot-comment/

Arch ignores files beginning with two commas, an equal sign and a few other special characters. By using a ,, at the start of our changeset directory name, we avoid the annoyance of Arch complaining that our new directory doesn't exist in the archive. It is probably good practice to use your e-mail address or some other identifier in the tarball filename and changeset directory name.

Keeping Up to Date

Now and then you'll want to download the latest changes to the project. This is as simple as running tla update from inside the checked-out copy.

Arch first runs tla undo to set aside your local changes before applying new changesets. Once all the patches have been applied, it runs tla redo to re-apply your local changes.

All of the tla commands introduced above require a functioning network connection to the lnx-bbc.org system that hosts the archive. For disconnected use, you need to create a local archive and then make a branch within it.

______________________

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Larry McVoy at SCALE 3x

Anonymous's picture

If you're interested in revision control software Larry McVoy of BitKeeper fame, will be speaking about distributed revision control systems at the upcoming Southern California Linux Expo

Re: Revision Control with Arch: Introduction to Arch

Anonymous's picture

Posted on Monday, November 01, 2004 by Nick Moffitt

Damn lag...

Re: Revision Control with Arch: Introduction to Arch

Anonymous's picture

I thought TLA was Three Letter Acronym.

Re: Revision Control with Arch: Introduction to Arch

f15_eagle's picture

I had played around with arch (and arx) a while ago and also found it fairly confusing. I was reading this hoping that things have changed for the better, but it doesn't sound like it has.

Reason being that I've got two areas I do development on that can't talk to one another via a network, yet I'd like to keep their CVS repositories sync'd up. One option would be to copy the repositories over, but I didn't start out that way. I made two separate repositories and just grab snapshots from one and integrate it to the other using CVS tags to manage revisions.

This works ok, but seems a little clunky. If I'm reading it right, arch be a natural for such an environment, once I get past the initial learning curve.

Any thoughts?

Re: Revision Control with Arch: Introduction to Arch

Anonymous's picture

I am pretty sure Arch would be a good fit. You'd probably do something like this:

Create an Arch archive at Site A and an Arch archive at Site B. Commit any changes into the archive where you are at.

Create an Arch archive on a USB stick. Use 'tla star-merge' to merge the site archive with the USB stick archive.

Re: Revision Control with Arch: Introduction to Arch

Anonymous's picture

well, I tried tla. It's horrible complicated. Until you find out how it works, you have set up 10 local subversions. Seriously. I think its not worth, even if subversion might have some downsides.

Re: Revision Control with Arch: Introduction to Arch

Anonymous's picture

So a GUI arch is needed.

Not a GUI, just a sane interf

Anonymous's picture

Not a GUI, just a sane interface.

Re: Revision Control with Arch: Introduction to Arch

Anonymous's picture

Actually, "tla" stands for "true love always", not "tom lord's arch"
although the coincidence of acronym there is part of why the
name "tla" was chosen ("tla", as acronym, provides lots of
plausible deniability --- for example, it also stands for "three letter
acronym".)

White Paper
Linux Management with Red Hat Satellite: Measuring Business Impact and ROI

Linux has become a key foundation for supporting today's rapidly growing IT environments. Linux is being used to deploy business applications and databases, trading on its reputation as a low-cost operating environment. For many IT organizations, Linux is a mainstay for deploying Web servers and has evolved from handling basic file, print, and utility workloads to running mission-critical applications and databases, physically, virtually, and in the cloud. As Linux grows in importance in terms of value to the business, managing Linux environments to high standards of service quality — availability, security, and performance — becomes an essential requirement for business success.

Learn More

Sponsored by Red Hat

White Paper
Private PaaS for the Agile Enterprise

If you already use virtualized infrastructure, you are well on your way to leveraging the power of the cloud. Virtualization offers the promise of limitless resources, but how do you manage that scalability when your DevOps team doesn’t scale? In today’s hypercompetitive markets, fast results can make a difference between leading the pack vs. obsolescence. Organizations need more benefits from cloud computing than just raw resources. They need agility, flexibility, convenience, ROI, and control.

Stackato private Platform-as-a-Service technology from ActiveState extends your private cloud infrastructure by creating a private PaaS to provide on-demand availability, flexibility, control, and ultimately, faster time-to-market for your enterprise.

Learn More

Sponsored by ActiveState