RepoTools

Provides commands to manipulate BZR repositories.

Overview

This plugin provides the following additional functionality to BZR:

Project files.

To check out a copy of the latest code, use bzr co http://linsam.homelinux.com/projs/repotools.

Or, get a snapshot: bzrrepotools-1.tgz

Example usage.

Apart from exploration, the primary use case of this plugin is to recover a branch from a shared repository when the branch directory is lost.

If you have a shared repository at projs/ and a few branches under, named projs/branchA and projs/branchB, and you accidentally delete the directory projs/branchB, but branchB wasn't in the ancestry of branchA, then branchB's data is still in the shared repository, but you no longer have a handle to retrieve it.

You might do a bzr repo-allheads from within the projs directory to list all of the 'heads' in the repository, which might show you this (as a simple example):

prompt $ bzr repo-allheads
user@example.com-20141229050448-y1pwubhb7nm808h4 branchA New file for other info
user@example.com-20141229050505-e07dt4l0m0f0ae1q branchB Added license file

In actuality, you'll also see other abandoned heads, for example, if you run an uncommit.

Next, seeing the head that was nicknamed 'branchB' (second line of the output above), you can create a new branch directory from that revision by copying the revid to the the repo-branchrev command to recover:

prompt$ bzr repo-branchrev user@example.com-20141229050505-e07dt4l0m0f0ae1q branchB

And now, branchB is back! Of course, you can name the new branch anything you want.

Command usage

bzr repo-all-revids

List all revisions in the repository

Output is a newline separated list of revids

This list can be quite long and in itself is not very useful. However, this can be used as the basis for some other command or script to get other information.

bzr repo-allheads

List all revids which are heads, independent of having an actual branch.

Output is a newline separated list of revisions which are heads. Each revision is displayed as a space separated list of revid, branch nickname, and the commit message summary.

This command defines a head as a revision which is not present in the ancestry of any other revision.

bzr repo-branchrev

Create a new branch directory from a revid.

This is similar to a regular "bzr branch" command with the '-r' flag, except that the revid needn't be present in the branch's ancestry. The revid must be present in the repository.

bzr repo-dot

Create a dot file representing all revisions in the repository. Use the graphviz tools to convert this into an image.

The result is somewhat similar to viz from the gtk plugin, but covers /every/ revision in the repository, not just the ancestry of a particular branch.

bzr repo-ls

Like "bzr ls", but works on any revid in the repository, not just a revision in a branch's ancestry.