[MERGE] RevisionSpec.as_revision_id()

Aaron Bentley aaron at aaronbentley.com
Sun Mar 30 20:48:07 BST 2008


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

John Arbash Meinel wrote:
> John Arbash Meinel wrote:
> ...
> 
> |
> | I'm happy to add those tests.
> |
> | John
> | =:->
> 
> The basic changes should be done in the attached patch. I didn't make
> some of
> the changes that I disagreed with, but I did add the tests and I tried
> to at
> least add comments to make it clearer what is going on.

It's a pity you didn't see my message where I said I'd take over since
you were on vacation.

I've come up with a version I feel is much cleaner.

The key thing is does is make the partial_revision_history_cache the
primary cache for format-6 branches.  This means that whenever there's a
full-history cache, there's also a partial-history cache which contains
the full history.  This removes the need for two codepaths-- branch6
branches can use the partial cache always.

I've added _extend_partial_history, which extends the partial history,
optionally stopping once it's reached a particular index.  This means
that determining a previously-found revid is still done using [].index.
 It also avoids doing more iteration, though frankly I don't think that
would have a significant cost.

This will also be easy to extend to revision_id_to_revno.  I have a
branch that does it, but it causes lock tests to fail.  I haven't
determined yet whether the failure is spurious.

Time for "bzr tag -r -2 foo" on the Emacs import (best of 4):
Your version
============
real	0m0.428s
user	0m0.316s
sys	0m0.076s

My version
==========
real	0m0.324s
user	0m0.260s
sys	0m0.052s
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFH7+530F+nu1YWqI0RAppNAJ9pKXUeq8t+yvSwmAKNjUPZOIAXkQCfUKwq
JSrGth+Ke0oSxNUw6kDlrUQ=
=UjWa
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: as_revision_id_1.patch
Type: text/x-diff
Size: 51386 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20080330/16b2aab9/attachment-0001.bin 


More information about the bazaar mailing list