What constitutes the "identity" of a changeset?

Aaron Bentley aaron at aaronbentley.com
Fri Mar 28 20:59:37 GMT 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Paul Moore wrote:
> There's the point, though. If revision identity is encapsulated in the
> ID, and the ID is arbitrary, how can I say if 2 revisions are
> identical.

If they have the same ID, they are identical.  If they have different
IDs, they are not identical.

> In reality, the ID *isn't* arbitrary, precisely because you
> can reason sanely about revision identity, but the rules aren't
> written up anywhere.

No, the revision ID *is* arbitrary.  Here are the rules for generating a
revision ID, but bear in mind that they apply only to revision IDs
generated by Bazaar itself:

1. take a username and optionally a timestamp
2. if the username contains an email address, use that in place of the
   username
3. force it to lowercase.
4. replace spaces with underscores
5. remove any characters maching this regular expression:
   [^-\w.+@]
6. generate 16 pseudorandom characters
7. if no timestamp was supplied, use the current time
8. format it in a particular way (see osutils.compact_date)
9. combine username, date, and random characters using hypens between them.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFH7Vw50F+nu1YWqI0RAtvuAJ9oDHYnEqb5KqIRZi9qFPn3XwAkWQCeKPW7
CwXuzNQoTn47nR6J7S1jX/4=
=0yfQ
-----END PGP SIGNATURE-----



More information about the bazaar mailing list