~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/diff.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-09-01 08:02:42 UTC
  • mfrom: (5390.3.3 faster-revert-593560)
  • Revision ID: pqm@pqm.ubuntu.com-20100901080242-esg62ody4frwmy66
(spiv) Avoid repeatedly calling self.target.all_file_ids() in
 InterTree.iter_changes. (Andrew Bennetts)

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
 
        try:
424
 
            from bzrlib.builtins import safe_relpath_files
425
 
            other_paths = safe_relpath_files(working_tree, other_paths,
 
423
        other_paths = working_tree.safe_relpath_files(
 
424
            other_paths,
426
425
            apply_view=apply_view)
427
 
        except errors.FileInWrongBranch:
428
 
            raise errors.BzrCommandError("Files are in different branches")
429
426
    specific_files.extend(other_paths)
430
427
    if len(specific_files) == 0:
431
428
        specific_files = None
739
736
                     path_encoding)
740
737
 
741
738
    @classmethod
742
 
    def make_from_diff_tree(klass, command_string):
 
739
    def make_from_diff_tree(klass, command_string, external_diff_options=None):
743
740
        def from_diff_tree(diff_tree):
744
 
            return klass.from_string(command_string, diff_tree.old_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,
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)]
 
918
            extra_factories = [DiffFromTool.make_from_diff_tree(using, external_diff_options)]
919
919
        else:
920
920
            extra_factories = []
921
921
        if external_diff_options: