[merge] accept LogFormatter instances in cmd_log.run
Aaron Bentley
aaron.bentley at utoronto.ca
Fri Jul 28 15:35:20 BST 2006
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Adeodato Simó wrote:
> * Aaron Bentley [Fri, 28 Jul 2006 09:40:32 -0400]:
>>In general, you shouldn't be calling cmd_log.run.
>
>
> Hm. "I", as in "a plugin", shouldn't be calling cmd_log.run ?
Yeah. It's slow, and it means you don't really know what your plugin
does.
Invoking cmd_log and cmd_diff repeatedly is going to be highly
inefficient. It will lock and unlock the branch twice for every
revision in the loop.
Implementing this plugin as a log formatter looks like a better approach.
> Yes, but that decoding has a lot of logic that a wrapper plugin may not
> want to duplicate. I know wrappeability is crucial for me (*), and I can't
> see that providing it for those who _want_ to use it is a bad thing?
More code is more code. Supplying functionality that will only be used
by those who abuse the API means that it will be only lightly tested,
but must be maintained.
> (*) Either because is the easiest way to code a plugin, or because I'm
> unable to find another more elgant or proper way to do it. Consider
> for example cmd_logdiff.py [1], which is what prompted me to propose
I agree that argument parsing is too hard right now. But I don't think
you need to write a command to get the functionality you want.
Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFEyiCo0F+nu1YWqI0RAvryAJ9kxG0OH0NwSAVnYNvXw4dT+C6B7gCbBDv6
uHvK2BP3oMqFLomT43jcVHc=
=GV9Y
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list