Storage internals: UUID

John Arbash Meinel john at arbash-meinel.com
Fri Jun 8 07:08:43 UTC 2012


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

On 6/7/2012 5:50 PM, Daniel Carrera wrote:
> Hello all,
> 
> I am learning about "bzr testament". It seems to already do a lot
> of what I like. For example, on the Inkscape tree:
> 
> % bzr testament -r 6372 bazaar-ng testament short form 1 
> revision-id:
> johanengelen at users.sourceforge.net-20080720184127-vb3nb0e82mamq2m6 
> sha1: 165c2a8e46025aa7c1d545115fecd69f6217a34b
> 
> 
> Now, I have a few questions:
> 
> 1. What does this SHA1 sum include? I can see that if I run "bzr
> testament --verbose" I get SHA1 sums for every file, so I assume
> that the SHA1 in the short-form testament must combine these in
> some way... Can anyone give me details.
> 

Essentially, if you do:

bzr testament --long | sha1sum

You should get the same value that you see in:
bzr testament

Note I just found a bug on Windows, where we weren't setting the
O_BINARY flag on stdout for 'bzr testament'. Which I've submitted a
fix for. (bug #1010339)


> 
> 2. Are the SHA1 sums from the testament actually stored anywhere or
> are they computed on the fly? If they are stored, where can I find
> them?
> 
> 
> Cheers, Daniel.
> 

We do store the sha1 sum in the inventory code, but I don't think we
expose it in the command line UI.

If you do something like:

from bzrlib import branch
b = branch.Branch.open('.')
b.lock_read()
rt = b.repository.revision_tree(b.last_revision())
ie = rt.inventory[rt.path2id('filename')]
ie.text_sha1

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk/RpPsACgkQJdeBCYSNAAN7EQCgguLa9JUd38XWcSCdPs+ERXD4
KEcAn3R89bNnYTAVWdrqHy+bWQnsrItw
=CAfR
-----END PGP SIGNATURE-----



More information about the bazaar mailing list