[MERGE][bug #172649] 'bzr uncommit' avoids 'branch.revision_history()'

John Arbash Meinel john at arbash-meinel.com
Fri May 23 07:01:37 BST 2008


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

This patch updates 'bzr uncommit' to avoid ever accessing
'Branch.revision_history()'. This saves a lot of time, and makes the command
much more interactive.

It also rewrites one of the 'log' helper functions (because uncommit uses it),
to do the same.

In my testing if I do:

~ time bzr uncommit

And hit "N<enter>" without waiting for the prompt, the timing difference is:

$ time bzr.dev uncommit
real    0m1.810s

$ time ./bzr uncommit
real    0m0.461s


It even slightly helps things like 'bzr log --short'

$ time bzr.dev log --short -r -10..-1
real    0m1.780s

$ time ./bzr log --short -r -10..-1
real    0m1.568s

The reason it isn't better is because cmd_log uses 'in_history()' to resolve the
RevisionSpecs. And in_history() still grabs the full revision_history to pass it
down to the lower function (which often ignores it). We do that partially
because the 'bzrlib.log.*' functions expect a RevisionInfo, and generally aren't
structured very well.

I'd *like* to see 'log' fixed to use stuff like
'Graph.find_unique_ancestors(tip, [base])', possibly with a different function
when we know we are only dealing with left-hand ancestors (--short).

At the very least, this is a definite step in the right direction, and enough
for me to consider

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

iEYEARECAAYFAkg2XcEACgkQJdeBCYSNAANOcACbBQGpwKF8ZXvP3reJQ5PFYzp6
giAAoMvfMi6BFBuIxu5gPWgBk5BsHbZq
=gGAK
-----END PGP SIGNATURE-----
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: uncommit_perf.patch
Url: https://lists.ubuntu.com/archives/bazaar/attachments/20080523/290b8199/attachment-0001.diff 


More information about the bazaar mailing list