/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/diff.py

  • Committer: John Arbash Meinel
  • Date: 2010-08-13 19:08:57 UTC
  • mto: (5050.17.7 2.2)
  • mto: This revision was merged to the branch mainline in revision 5379.
  • Revision ID: john@arbash-meinel.com-20100813190857-mvzwnimrxvm0zimp
Lots of documentation updates.

We had a lot of http links pointing to the old domain. They should
all now be properly updated to the new domain. (only bazaar-vcs.org
entry left is for pqm, which seems to still reside at the old url.)

Also removed one 'TODO' doc entry about switching to binary xdelta, since
we basically did just that with groupcompress.

Show diffs side-by-side

added added

removed removed

Lines of Context:
99
99
    if sequence_matcher is None:
100
100
        sequence_matcher = patiencediff.PatienceSequenceMatcher
101
101
    ud = patiencediff.unified_diff(oldlines, newlines,
102
 
                      fromfile=old_filename.encode(path_encoding),
103
 
                      tofile=new_filename.encode(path_encoding),
 
102
                      fromfile=old_filename.encode(path_encoding, 'replace'),
 
103
                      tofile=new_filename.encode(path_encoding, 'replace'),
104
104
                      sequencematcher=sequence_matcher)
105
105
 
106
106
    ud = list(ud)
706
706
        """
707
707
        def _get_text(tree, file_id, path):
708
708
            if file_id is not None:
709
 
                return tree.get_file(file_id, path).readlines()
 
709
                return tree.get_file_lines(file_id, path)
710
710
            else:
711
711
                return []
712
712
        try:
713
713
            from_text = _get_text(self.old_tree, from_file_id, from_path)
714
714
            to_text = _get_text(self.new_tree, to_file_id, to_path)
715
715
            self.text_differ(from_label, from_text, to_label, to_text,
716
 
                             self.to_file)
 
716
                             self.to_file, path_encoding=self.path_encoding)
717
717
        except errors.BinaryFile:
718
718
            self.to_file.write(
719
719
                  ("Binary files %s and %s differ\n" %
720
 
                  (from_label, to_label)).encode(self.path_encoding))
 
720
                  (from_label, to_label)).encode(self.path_encoding,'replace'))
721
721
        return self.CHANGED
722
722
 
723
723
 
920
920
            extra_factories = []
921
921
        if external_diff_options:
922
922
            opts = external_diff_options.split()
923
 
            def diff_file(olab, olines, nlab, nlines, to_file):
 
923
            def diff_file(olab, olines, nlab, nlines, to_file, path_encoding=None):
 
924
                """:param path_encoding: not used but required
 
925
                        to match the signature of internal_diff.
 
926
                """
924
927
                external_diff(olab, olines, nlab, nlines, to_file, opts)
925
928
        else:
926
929
            diff_file = internal_diff