[ANN][PLUGIN] extending diff with graphical tools

Stephen Ward sward.dev at verizon.net
Sun Apr 30 15:24:22 BST 2006


Hi,

I've extended my 'bzr_kompare' plugin to support multiple graphical diff 
tools, and reworked it to extend the 'bzr diff' command instead of adding a 
new command for each tool.  The new and improved plugin has been renamed to 
'bzr_difftools', and can be downloaded as either a bzr branch or a tarball 
from:

   http://mysite.verizon.net/sward.dev/projects/bzr_difftools
   http://mysite.verizon.net/sward.dev/projects/bzr_difftools.tar.gz
   http://mysite.verizon.net/sward.dev/projects/bzr_difftools.tar.bz2

I've update the plugin registry accordingly.

With this extension, the 'bzr diff' command now supports a '--using TOOL' 
option, like:

   bzr diff --using kdiff3 [FILES...]

I've tested it with fldiff, kdiff3, kompare, meld, vimdiff, and xxdiff.  Most 
diff tools will run without any need for customization; for the rare cases 
where additional options are needed, they can be added like this:

   register_diff_tool(DiffTool('xxdiff', diff_options='--exclude=.bzr*'))

and more complicated customizations can be made by sub-classing DiffTool.


Possible future work:

* integrating this into the bzrlib core, as Martin suggested.  I  chose the 
plugin approach for now because of the 0.8 feature freeze.

* extending this to 3-way diffs, which most of these tools support.  However, 
this does not fit well with 'bzr diff' usage, so perhaps it would be better 
to ...

* extend this to 'bzr merge', possibly combine with the 'extmerge' plugin

* add hooks for the new '--diff-prefix' option


Let me know if you have any other suggestions for improvements.

-- Steve




More information about the bazaar mailing list