~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/diff.py

  • Committer: Matthäus G. Chajdas
  • Date: 2010-07-19 18:16:56 UTC
  • mto: (5383.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 5384.
  • Revision ID: dev@anteru.net-20100719181656-snkiywdjtpfgtdgh
Allow both --using and --diff-options.

Added an example to the diff documentation to showcase how to use --using and --diff-options. Change the test to use /usr/bin/diff. Update news entry.

Show diffs side-by-side

added added

removed removed

Lines of Context:
739
739
                     path_encoding)
740
740
 
741
741
    @classmethod
742
 
    def make_from_diff_tree(klass, command_string):
 
742
    def make_from_diff_tree(klass, command_string, external_diff_options=None):
743
743
        def from_diff_tree(diff_tree):
744
 
            return klass.from_string(command_string, diff_tree.old_tree,
 
744
            full_command_string = [command_string]
 
745
            if external_diff_options is not None:
 
746
                full_command_string += ' ' + external_diff_options
 
747
            return klass.from_string(full_command_string, diff_tree.old_tree,
745
748
                                     diff_tree.new_tree, diff_tree.to_file)
746
749
        return from_diff_tree
747
750
 
915
918
        :param using: Commandline to use to invoke an external diff tool
916
919
        """
917
920
        if using is not None:
918
 
            extra_factories = [DiffFromTool.make_from_diff_tree(using)]
 
921
            extra_factories = [DiffFromTool.make_from_diff_tree(using, external_diff_options)]
919
922
        else:
920
923
            extra_factories = []
921
924
        if external_diff_options: