Merge lp:~janos-gyerik/bzr-oodiff/fixes-for-bzr2.5 into lp:~ollie-petch/bzr-oodiff/trunk

Proposed by Janos Gyerik
Status: Needs review
Proposed branch: lp:~janos-gyerik/bzr-oodiff/fixes-for-bzr2.5
Merge into: lp:~ollie-petch/bzr-oodiff/trunk
Diff against target: 45 lines (+5/-7)
2 files modified
__init__.py (+1/-3)
oo_diff.py (+4/-4)
To merge this branch: bzr merge lp:~janos-gyerik/bzr-oodiff/fixes-for-bzr2.5
Reviewer Review Type Date Requested Status
ollie Pending
Review via email: mp+157959@code.launchpad.net

Description of the change

Fixed some bugs that prevented this plugin from working with Bazaar 2.5 (the current version).

I also removed the global `--wdiff` option, as it was polluting all other commands too.

To post a comment you must log in.

Unmerged revisions

8. By Janos Gyerik <janos@axiom>

removed global --wdiff option

7. By Janos Gyerik <janos@axiom>

diff_text function arguments were in the wrong order

6. By Janos Gyerik <janos@axiom>

wdiff_dir and wdiff_file should be used only after wdiff is confirmed

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file '__init__.py'
--- __init__.py 2009-04-22 15:54:05 +0000
+++ __init__.py 2013-04-09 21:13:24 +0000
@@ -28,11 +28,9 @@
28from oo_diff import OODiffer28from oo_diff import OODiffer
2929
3030
31_standard_option('wdiff')
32
33class cmd_oodiff(Command):31class cmd_oodiff(Command):
34 takes_args = ['file_to_diff+']32 takes_args = ['file_to_diff+']
35 takes_options = ['revision', 'wdiff']33 takes_options = ['revision']
36 def run(self, file_to_diff_list, revision=None, wdiff=None):34 def run(self, file_to_diff_list, revision=None, wdiff=None):
37 for file_to_diff in file_to_diff_list:35 for file_to_diff in file_to_diff_list:
38 from bzrlib.workingtree import WorkingTree36 from bzrlib.workingtree import WorkingTree
3937
=== modified file 'oo_diff.py'
--- oo_diff.py 2009-04-22 15:54:05 +0000
+++ oo_diff.py 2013-04-09 21:13:24 +0000
@@ -84,14 +84,14 @@
84 return list;84 return list;
8585
86 86
87 def diff_text(self, to_file = None, from_file = None):87 def diff_text(self, from_file = None, to_file = None):
88 """Feed's the contents of the given lists through the bazaar diff algorithm 88 """Feed's the contents of the given lists through the bazaar diff algorithm
89 :param from_text: The text from the from file 89 :param from_text: The text from the from file
90 :param to_text: The text from the to file.90 :param to_text: The text from the to file.
91 """91 """
92 wdiff_dir = bzrlib.plugin.get_default_plugin_path() + "/wdiff/"
93 wdiff_file = "wdiff.py"
94 if self.wdiff == True:92 if self.wdiff == True:
93 wdiff_dir = bzrlib.plugin.get_default_plugin_path() + "/wdiff/"
94 wdiff_file = "wdiff.py"
95 if os.path.exists(wdiff_dir):95 if os.path.exists(wdiff_dir):
96 sys.path.append(wdiff_dir)96 sys.path.append(wdiff_dir)
97 from wdiff import Differ97 from wdiff import Differ
@@ -145,4 +145,4 @@
145 def __init__(self, from_tree = None, to_tree= None, wdiff=None): pass145 def __init__(self, from_tree = None, to_tree= None, wdiff=None): pass
146 146
147 def diff_text(self, to_file = None, from_file = None):147 def diff_text(self, to_file = None, from_file = None):
148 print "Error: File Format is non ODF standard"
149\ No newline at end of file148\ No newline at end of file
149 print "Error: File Format is non ODF standard"

Subscribers

People subscribed via source and target branches