difftools - Show differences using external GUI toolsΒΆ

Version 0.91.0
Branch lp:bzr-difftools
Home page https://launchpad.net/bzr-difftools
Downloads http://mysite.verizon.net/sward.dev/projects/bzr_difftools.tar.gz
Owner sward-dev
GNU/Linux Yes
Windows Yes
Mac OS X Yes

External diff tools plugin for Bazaar

This plugin overrides the default ‘bzr diff’ command to add a new option ‘–using’, which is used to specify an external diff tool to run in place of the builtin implementation. Usually, this will be some form of graphical diff tool.

If the ‘–using’ option is not provided, the original builtin ‘bzr diff’ behavior is used.

The default behavior for an external diff tool is encapsulated in the DiffTool class (difftool.py). This class can be extended in order to customize the behavior for a particular tool.

There are at least two distinct use models for a diff tool: a recursive tree diff (where the external tool is in control, once the revisions have been extracted from ‘bzr’), and an iterative diff (where ‘bzr’ is in control). Both are supported here.

If some ‘–using’ options were handled internally by bzrlib (e.g. ‘–using patience-diff’), then these could be delegated to the superclass safely. So this option can potentially be used for both external diff tools and alternate internal diff algorithms.

The ‘cmd_diff’ class, defined here, is a minimalist command extension; most of the actual work is delegated to the Controller class instead. The purpose of this separation is to minimize the startup overhead, by deferring most of the ‘import’ processing until the command is actually executed.

Note that this extension is not truly a decorator for the ‘diff’ command, because it does not always call the builtin ‘diff’ command. This could be changed, if it became necessary to combine this extension with another ‘diff’ decorator, by calling the builtin version in addition to the external tool (and by changing the ‘decorate’ option on register_command).

Previous topic

extmerge - Merge using external GUI tools

Next topic

gtk - GTK dialogs for many Bazaar commands

This Page