Merge lp:~ehbello/bzr-interactive/trunk into lp:bzr-interactive

Proposed by Enrique Hernández Bello
Status: Merged
Approved by: Ali Sabil
Approved revision: 15
Merged at revision: 14
Proposed branch: lp:~ehbello/bzr-interactive/trunk
Merge into: lp:bzr-interactive
Diff against target: 62 lines (+12/-2)
2 files modified
hunk_selector.py (+10/-0)
patchsource.py (+2/-2)
To merge this branch: bzr merge lp:~ehbello/bzr-interactive/trunk
Reviewer Review Type Date Requested Status
Ali Sabil Approve
Review via email: mp+189484@code.launchpad.net

Commit message

Fix crashes with binary patches and bzr 2.6 incompatibilities

To post a comment you must log in.
lp:~ehbello/bzr-interactive/trunk updated
15. By Enrique Hernández Bello

Fixed to work with bzrlib version 2.3b1 and upper.

Revision history for this message
Ali Sabil (asabil) wrote :

Looks good, thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hunk_selector.py'
2--- hunk_selector.py 2008-03-07 11:41:16 +0000
3+++ hunk_selector.py 2013-10-05 21:32:27 +0000
4@@ -77,6 +77,8 @@
5 self.interactor.set_end_callback(self._end_callback)
6
7 for patch in patches:
8+ if type(patch).__name__ == 'BinaryPatch':
9+ continue
10 for hunk in patch.hunks:
11 # everything's selected by default
12 hunk.selected = True
13@@ -126,6 +128,8 @@
14 # The user chooses to invert the selection
15 def _invert(self, hunk):
16 for patch in self.patches:
17+ if type(patch).__name__ == 'BinaryPatch':
18+ continue
19 for hunk in patch.hunks:
20 if hunk.__dict__.has_key('selected'):
21 hunk.selected = not hunk.selected
22@@ -138,6 +142,8 @@
23 def _status(self, hunk=None):
24 print '\nStatus:'
25 for patch in self.patches:
26+ if type(patch).__name__ == 'BinaryPatch':
27+ continue
28 print ' %s' % patch.oldname
29 selected = 0
30 unselected = 0
31@@ -161,6 +167,8 @@
32
33 # Go through each patch and collect all selected/unselected hunks
34 for patch in self.patches:
35+ if type(patch).__name__ == 'BinaryPatch':
36+ continue
37 patch.selected = []
38 patch.unselected = []
39 for hunk in patch.hunks:
40@@ -174,6 +182,8 @@
41 unselected_patches = []
42
43 for patch in self.patches:
44+ if type(patch).__name__ == 'BinaryPatch':
45+ continue
46 if len(patch.selected):
47 tmp = copy.copy(patch)
48 tmp.hunks = tmp.selected
49
50=== modified file 'patchsource.py'
51--- patchsource.py 2007-08-01 15:10:21 +0000
52+++ patchsource.py 2013-10-05 21:32:27 +0000
53@@ -42,8 +42,8 @@
54
55 class BzrPatchSource(PatchSource):
56 def __init__(self, revision=None, file_list=None):
57- from bzrlib.builtins import tree_files
58- self.tree, self.file_list = tree_files(file_list)
59+ from bzrlib.builtins import WorkingTree
60+ self.tree, self.file_list = WorkingTree.open_containing_paths(file_list)
61 self.base = self.tree.basedir
62 self.revision = revision
63

Subscribers

People subscribed via source and target branches