[MERGE] Revisit RevisionSpec.in_history()

John Arbash Meinel john at arbash-meinel.com
Fri May 30 02:03:57 BST 2008


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

So for the most part we avoided the api problems with 'in_history()' by
switching over to RevisionSpec.as_revision_id(). However, log still wants
revnos, and the whole api is still pretty dependent on RevisionInfo having a
.revno when possible.

However, for evaluating "bzr log -r -10..-1" we don't *need* the full revision
history, we can quickly iterate to find what '-10' represents.

With my uncommit changes (which are in pqm now), the attached patch finishes the
modifications so that 'bzr log --short -r -10..-1' never calls
'branch.revision_history()'.

In my testing, that changes the time from:

bzr.dev    1.9s
uncommit   1.7s
in_history 0.483s

So it is a pretty big win. (And as it is something that *I* use several times a
day, it is a big win for me.)

For an even more obvious difference

time ./bzr log http://bazaar-vcs.org/bzr/bzr.dev --short -r -10..-1
24.5s

time bzr.dev log ...
56.3s

Both are a bit too long, but at least it is a clear step in the right direction.

Anyway, this introduces a new class variable for RevisionSpecs for them to
indicate that they don't need to be passed the revision_history of the branch in
their _match_on function. It should be generally api compatible, as the base
class leaves it turned on.

There are other ways to do it, though.

1) Have RevisionSpec_revno override in_history() itself, and do the same work.
At the moment, I only really care about _revno, because that is what I use all
the time. However, I don't think we want to end up rewriting in_history() for
*all* of the RevisionSpecs that we fix.

2) Evolve to some different api

I pretty much prefer this because it allows me to slowly migrate revision specs,
and is generally api compatible. Plus it was easy and it solves my personal
problem. (next I'm going to try to get 'bzr log --long -r -1' to be fast when
there are no merges because this effects bzr-email every time I commit.)

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

iEYEARECAAYFAkg/Un0ACgkQJdeBCYSNAAN2rgCgihamRHGGEGg08J/x7SlAnySu
IX4Aniy45SW8ZisSXsyNHv5uzhH5z7x8
=YVZL
-----END PGP SIGNATURE-----
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: revno_no_history.patch
Url: https://lists.ubuntu.com/archives/bazaar/attachments/20080529/f79d6656/attachment.diff 


More information about the bazaar mailing list