[RFC][PATCH] New style of revision id

Martin Pool mbp at canonical.com
Fri Oct 27 10:48:47 BST 2006


On 25 Oct 2006, Goffredo Baroncelli <kreijack at alice.it> wrote:
> Hi all,
> 
> I hacked a bit bazaar and now I added the support for revision-id with 
> checksum ( as git and/or hgweb ). John made some suggestions and now that is 
> the result.

Yes, I can definitely see the value in such a thing - short
abbreviations, verifications, and so on.  It was a bit of an arbitrary
choice in early bzr days to use random ids, and we can still consider
it.

> The new revision-id is in the form:
> 
> <user>@<host>-<yyyymmddhhmmss>-<sha1sum>
> 
> The checksum is computed on the testament without the revision-id. In fact the 
> following field are evaluated [*]:
> 
> - commiter
> - comment
> - revision-properties
> - timestamp/timezone
> - parents
> - inventory ( path, file_id, kind, sha1 for the text or the target for the
>   symlink )

Like others have said, if we are going to do this we should put the hex
at the start so it's easier to abbreviate to a proper prefix.

If this is going to be the main mechanism then I think we should go the
whole way and make it actually the hash of the revision as stored, to
avoid the extra translation to and from testaments.

Doing so means that the revision-id depends on the representation of the
revision, and that representation needs to stay supported in future
versions.  Of course we would still have the option to record different
types of revision in the future.

The behaviour of upgrade on a repository would be somewhat different: it
could rewrite the container format, but not the contents of the
revisions.

As a concrete example, we could stop recording revisions in XML, but
we'd have to still be able to read all the old ones.

-- 
Martin




More information about the bazaar mailing list