~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/diff.py

  • Committer: Gary van der Merwe
  • Date: 2010-08-02 19:56:52 UTC
  • mfrom: (5050.3.18 2.2)
  • mto: (5050.3.19 2.2)
  • mto: This revision was merged to the branch mainline in revision 5371.
  • Revision ID: garyvdm@gmail.com-20100802195652-o1ppjemhwrr98i61
MergeĀ lp:bzr/2.2.

Show diffs side-by-side

added added

removed removed

Lines of Context:
420
420
 
421
421
    # Get the specific files (all files is None, no files is [])
422
422
    if make_paths_wt_relative and working_tree is not None:
423
 
        other_paths = working_tree.safe_relpath_files(
424
 
            other_paths,
 
423
        try:
 
424
            from bzrlib.builtins import safe_relpath_files
 
425
            other_paths = safe_relpath_files(working_tree, other_paths,
425
426
            apply_view=apply_view)
 
427
        except errors.FileInWrongBranch:
 
428
            raise errors.BzrCommandError("Files are in different branches")
426
429
    specific_files.extend(other_paths)
427
430
    if len(specific_files) == 0:
428
431
        specific_files = None
736
739
                     path_encoding)
737
740
 
738
741
    @classmethod
739
 
    def make_from_diff_tree(klass, command_string, external_diff_options=None):
 
742
    def make_from_diff_tree(klass, command_string):
740
743
        def from_diff_tree(diff_tree):
741
 
            full_command_string = [command_string]
742
 
            if external_diff_options is not None:
743
 
                full_command_string += ' ' + external_diff_options
744
 
            return klass.from_string(full_command_string, diff_tree.old_tree,
 
744
            return klass.from_string(command_string, diff_tree.old_tree,
745
745
                                     diff_tree.new_tree, diff_tree.to_file)
746
746
        return from_diff_tree
747
747
 
915
915
        :param using: Commandline to use to invoke an external diff tool
916
916
        """
917
917
        if using is not None:
918
 
            extra_factories = [DiffFromTool.make_from_diff_tree(using, external_diff_options)]
 
918
            extra_factories = [DiffFromTool.make_from_diff_tree(using)]
919
919
        else:
920
920
            extra_factories = []
921
921
        if external_diff_options: