~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/diff.py

  • Committer: Aaron Bentley
  • Date: 2007-08-15 11:24:06 UTC
  • mfrom: (2702 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2703.
  • Revision ID: aaron.bentley@utoronto.ca-20070815112406-lyv23omlm0wgsu42
Merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
16
 
 
17
import difflib
17
18
import os
18
19
import re
19
20
import sys
48
49
# invoke callbacks on an object.  That object can either accumulate a
49
50
# list, write them out directly, etc etc.
50
51
 
 
52
 
 
53
class _PrematchedMatcher(difflib.SequenceMatcher):
 
54
    """Allow SequenceMatcher operations to use predetermined blocks"""
 
55
 
 
56
    def __init__(self, matching_blocks):
 
57
        difflib.SequenceMatcher(self, None, None)
 
58
        self.matching_blocks = matching_blocks
 
59
        self.opcodes = None
 
60
 
 
61
 
51
62
def internal_diff(old_filename, oldlines, new_filename, newlines, to_file,
52
63
                  allow_binary=False, sequence_matcher=None,
53
64
                  path_encoding='utf8'):