/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: Vincent Ladeuil
  • Date: 2010-04-22 14:18:17 UTC
  • mto: (5190.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 5191.
  • Revision ID: v.ladeuil+lp@free.fr-20100422141817-izoao20264ivkauo
Explain that the uncommitted changes are not processed when
issuing the warning.

* bzrlib/mutabletree.py:
(MutableTree.check_changed_or_out_of_date): Use diferent 'more'
arguments depending on whether we issue a warning or an error.

* bzrlib/send.py:
(send): Add the more_warnings argument when calling
check_changed_or_out_of_date.

* bzrlib/foreign.py:
(cmd_dpush.run): Add the more_warnings argument when calling
check_changed_or_out_of_date.

* bzrlib/builtins.py:
(cmd_push.run): Add the more_warnings argument when calling
check_changed_or_out_of_date.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
import difflib
18
18
import os
19
19
import re
 
20
import shutil
20
21
import string
21
22
import sys
22
23
 
99
100
    if sequence_matcher is None:
100
101
        sequence_matcher = patiencediff.PatienceSequenceMatcher
101
102
    ud = patiencediff.unified_diff(oldlines, newlines,
102
 
                      fromfile=old_filename.encode(path_encoding, 'replace'),
103
 
                      tofile=new_filename.encode(path_encoding, 'replace'),
 
103
                      fromfile=old_filename.encode(path_encoding),
 
104
                      tofile=new_filename.encode(path_encoding),
104
105
                      sequencematcher=sequence_matcher)
105
106
 
106
107
    ud = list(ud)
420
421
 
421
422
    # Get the specific files (all files is None, no files is [])
422
423
    if make_paths_wt_relative and working_tree is not None:
423
 
        other_paths = working_tree.safe_relpath_files(
424
 
            other_paths,
 
424
        try:
 
425
            from bzrlib.builtins import safe_relpath_files
 
426
            other_paths = safe_relpath_files(working_tree, other_paths,
425
427
            apply_view=apply_view)
 
428
        except errors.FileInWrongBranch:
 
429
            raise errors.BzrCommandError("Files are in different branches")
426
430
    specific_files.extend(other_paths)
427
431
    if len(specific_files) == 0:
428
432
        specific_files = None
703
707
        """
704
708
        def _get_text(tree, file_id, path):
705
709
            if file_id is not None:
706
 
                return tree.get_file_lines(file_id, path)
 
710
                return tree.get_file(file_id, path).readlines()
707
711
            else:
708
712
                return []
709
713
        try:
710
714
            from_text = _get_text(self.old_tree, from_file_id, from_path)
711
715
            to_text = _get_text(self.new_tree, to_file_id, to_path)
712
716
            self.text_differ(from_label, from_text, to_label, to_text,
713
 
                             self.to_file, path_encoding=self.path_encoding)
 
717
                             self.to_file)
714
718
        except errors.BinaryFile:
715
719
            self.to_file.write(
716
720
                  ("Binary files %s and %s differ\n" %
717
 
                  (from_label, to_label)).encode(self.path_encoding,'replace'))
 
721
                  (from_label, to_label)).encode(self.path_encoding))
718
722
        return self.CHANGED
719
723
 
720
724
 
917
921
            extra_factories = []
918
922
        if external_diff_options:
919
923
            opts = external_diff_options.split()
920
 
            def diff_file(olab, olines, nlab, nlines, to_file, path_encoding=None):
921
 
                """:param path_encoding: not used but required
922
 
                        to match the signature of internal_diff.
923
 
                """
 
924
            def diff_file(olab, olines, nlab, nlines, to_file):
924
925
                external_diff(olab, olines, nlab, nlines, to_file, opts)
925
926
        else:
926
927
            diff_file = internal_diff