Storage internals: UUID

Daniel Carrera dcarrera at
Fri Jun 8 00:32:01 UTC 2012

Hi Neil,

On Friday, June 08, 2012 at 1:34 AM, Neil Martinsen-Burrell <nmb at> wrote:

> Bazaar has a facility for defining new "revisionspecs" in plugins.
> This means that you could define a way to specify revisions using 
> the "-r sha:165c2a8" syntax. See the code in bzrlib/ for
> examples of how the existing "-r <type>:" revision specs work.  The
> important method to define in your subclass of RevisionSpec is
> RevisionSpec._as_revision_id(self, context_branch).  Then, register
> your class with bzrlib.revisionspec.revspec_registry.register('sha',
> revspec_subclass).

Cool. I hadn't realized that the Bzr API was that flexible. Just a few questions:

1. Is the "sha1:" part necessary?

2. I need a way to search revisions according to the testament. One way I could do it is by producing a history log and doing a text search, but I wonder if there is a cleaner way to do that.

I will be happy to write a plugin for this. It will be a long time in coming because (a) I'm going away for two weeks and (b) I don't know a lot about Python or bzr. But this sounds like a straight forward plugin, so I'll do it.


More information about the bazaar mailing list