Storage internals: UUID

Neil Martinsen-Burrell nmb at wartburg.edu
Thu Jun 7 23:34:19 UTC 2012


On Thu, Jun 7, 2012 at 6:15 PM, Daniel Carrera <dcarrera at hush.com> wrote:

[...]

> bzr update -r 165c2a8
>
> bzr branch -r165c2a8
>
> etc.
>
> You get the idea. As in other VCS's, you don't have to enter the entire SHA1 as long as what you provide is unique. I think it would be cool if at every place where you normally insert a revision id, you had the option of entering the SHA1 of the testament instead. For my daily work I would use the convenient "-r 5" type revision number, but when I publish a release, I would probably give instructions based on the hash.
>
> In addition, with this feature you would add one more "workflow" choice for Bazaar. People who actually prefer to refer to revisions by hash (perhaps refugees from Git or Hg) have an option to continue working just the way they like it, and have basically the same cryptographic assurance that they get from Git and Hg.
>
> What do you think? Do you think this is doable? Easy?

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/revisionspec.py 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).

-Neil



More information about the bazaar mailing list