~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to patchsource.py

  • Committer: Aaron Bentley
  • Date: 2006-12-04 14:32:43 UTC
  • Revision ID: abentley@panoramicfeedback.com-20061204143243-i28ph41mdgbsofev
Fixed handling of pipe errors when writing to patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
import re
2
 
 
3
 
from bzrlib import (
4
 
    patches,
5
 
    workingtree,
6
 
    )
7
 
 
8
 
from bzrlib.plugins.bzrtools import errors
 
1
from bzrlib import patches
9
2
 
10
3
class PatchSource(object):
11
4
    def __iter__(self):
31
24
 
32
25
class BzrPatchSource(PatchSource):
33
26
    def __init__(self, revision=None, file_list=None):
34
 
        open_containing_paths = workingtree.WorkingTree.open_containing_paths
35
 
        self.tree, self.file_list = open_containing_paths(file_list)
 
27
        from bzrlib.builtins import tree_files
 
28
        self.tree, self.file_list = tree_files(file_list)
36
29
        self.base = self.tree.basedir
37
30
        self.revision = revision
38
31
 
58
51
 
59
52
        show_diff_trees(self.old_tree, self.tree, f, self.file_list,
60
53
                        old_label='', new_label='')
61
 
        if re.search('Binary files .* differ', f.getvalue()):
62
 
            raise errors.ChangedBinaryFiles()
 
54
 
63
55
        f.seek(0)
64
56
        return f.readlines()