Merge lp:~baztian/bzr-difftools/rename-to-extdiff into lp:bzr-difftools

Proposed by Bastian
Status: Needs review
Proposed branch: lp:~baztian/bzr-difftools/rename-to-extdiff
Merge into: lp:bzr-difftools
Diff against target: 72 lines (+15/-13)
1 file modified
__init__.py (+15/-13)
To merge this branch: bzr merge lp:~baztian/bzr-difftools/rename-to-extdiff
Reviewer Review Type Date Requested Status
Stephen Ward Pending
Review via email: mp+68055@code.launchpad.net

Description of the change

Renamed command from diff to extdiff to don't interfere with diff's original --using

To post a comment you must log in.

Unmerged revisions

42. By Bastian

Renamed command from diff to extdiff to don't interfere with diff's original --using

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file '__init__.py'
--- __init__.py 2007-09-30 18:13:15 +0000
+++ __init__.py 2011-07-15 08:36:02 +0000
@@ -5,10 +5,11 @@
5"""5"""
6External diff tools plugin for Bazaar6External diff tools plugin for Bazaar
77
8This plugin overrides the default 'bzr diff' command to add a new option8This plugin overrides the default 'bzr diff' command to provide a new
9'--using', which is used to specify an external diff tool to run in place9command 'bzr extdiff' and to add a new option '--using', which is used
10of the builtin implementation. Usually, this will be some form of 10to specify an external diff tool to run in place of the builtin
11graphical diff tool.11implementation. Usually, this will be some form of graphical diff
12tool.
1213
13If the '--using' option is not provided, the original builtin 'bzr diff'14If the '--using' option is not provided, the original builtin 'bzr diff'
14behavior is used.15behavior is used.
@@ -27,10 +28,11 @@
27safely. So this option can potentially be used for both external diff28safely. So this option can potentially be used for both external diff
28tools and alternate internal diff algorithms.29tools and alternate internal diff algorithms.
2930
30The 'cmd_diff' class, defined here, is a minimalist command extension; most31The 'cmd_extdiff' class, defined here, is a minimalist command
31of the actual work is delegated to the Controller class instead. The 32extension; most of the actual work is delegated to the Controller
32purpose of this separation is to minimize the startup overhead, by deferring33class instead. The purpose of this separation is to minimize the
33most of the 'import' processing until the command is actually executed.34startup overhead, by deferring most of the 'import' processing until
35the command is actually executed.
3436
35Note that this extension is not truly a decorator for the 'diff' command,37Note that this extension is not truly a decorator for the 'diff' command,
36because it does not always call the builtin 'diff' command. This could 38because it does not always call the builtin 'diff' command. This could
@@ -45,7 +47,7 @@
45 option,47 option,
46 )48 )
4749
48class cmd_diff(builtins.cmd_diff):50class cmd_extdiff(builtins.cmd_diff):
49 """51 """
50 The '--using TOOL' option can be used to run an external diff tool.52 The '--using TOOL' option can be used to run an external diff tool.
5153
@@ -78,7 +80,7 @@
78 return Controller().run(*args, **kwargs)80 return Controller().run(*args, **kwargs)
79 else:81 else:
80 # Run the builtin diff command normally:82 # Run the builtin diff command normally:
81 return super(cmd_diff, self).run(*args, **kwargs)83 return super(cmd_extdiff, self).run(*args, **kwargs)
8284
8385
84 def help(self):86 def help(self):
@@ -86,15 +88,15 @@
86 Return help message for this class, including text from superclass.88 Return help message for this class, including text from superclass.
87 """89 """
88 from inspect import getdoc90 from inspect import getdoc
89 return getdoc(super(cmd_diff, self)) + '\n\n' + getdoc(self)91 return getdoc(super(cmd_extdiff, self)) + '\n\n' + getdoc(self)
9092
91 # End class cmd_diff93 # End class cmd_extdiff
9294
9395
94# Initialize the plugin:96# Initialize the plugin:
95version_info = (0, 91, 0, 'final', 0)97version_info = (0, 91, 0, 'final', 0)
9698
97# Register the new command provided by this plugin:99# Register the new command provided by this plugin:
98commands.register_command(cmd_diff, decorate=False)100commands.register_command(cmd_extdiff, decorate=False)
99101
100# The End.102# The End.

Subscribers

People subscribed via source and target branches

to all changes:
to status/vote changes: