[MERGE][bug #6700] diff on branches without working trees
Aaron Bentley
aaron.bentley at utoronto.ca
Mon Dec 17 05:17:41 GMT 2007
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Ian Clatworthy wrote:
>> ^^^ technically, you could try WorkingTree.revision_tree before falling
>> back to Repository.revision_tree. But that would only accelerate diff
>> -r -1, which is rarely used.
>
> Interesting. How would you change that bit of code to do that? LBYL? I
> don't want to make the code more complex that it need be or risk slowing
> down common cases, but I'm happy to tweak it if you think it's worth it.
I don't think it's worth it. But it would be:
try:
return tree.revision_tree(revision_id)
except errors.NoSuchRevision:
return rev_branch.repository.revision_tree(revision_id)
The expense of generating a RevisionTree dwarfs the expense of catching
the exception.
Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFHZgZ10F+nu1YWqI0RAtOMAJ9Cqmlqk8vYqMCgT8fOfiEyauWDngCbB68z
WMNwREqELGHYj+oVpZReSg8=
=0a7z
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list