~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/diff.py

  • Committer: Paul Nixon
  • Date: 2012-07-12 15:59:35 UTC
  • mto: This revision was merged to the branch mainline in revision 6547.
  • Revision ID: pauljnixon@gmail.com-20120712155935-zjhvpontvhkv1e0y
Added tests of configurable context

Show diffs side-by-side

added added

removed removed

Lines of Context:
427
427
                    path_encoding='utf8',
428
428
                    using=None,
429
429
                    format_cls=None,
430
 
                    context):
 
430
                    context=3):
431
431
    """Show in text form the changes from one tree to another.
432
432
 
433
433
    :param to_file: The output stream.
619
619
    # or removed in a diff.
620
620
    EPOCH_DATE = '1970-01-01 00:00:00 +0000'
621
621
 
622
 
    def __init__(self, old_tree, new_tree, to_file, path_encoding='utf-8',
623
 
                 old_label='', new_label='', text_differ=internal_diff,
624
 
                 context_lines):
 
622
    def __init__(self, old_tree, new_tree, to_file, path_encoding='utf-8', 
 
623
                 old_label='', new_label='', text_differ=internal_diff, 
 
624
                 context_lines=3):
625
625
        DiffPath.__init__(self, old_tree, new_tree, to_file, path_encoding)
626
626
        self.text_differ = text_differ
627
627
        self.old_label = old_label
933
933
            extra_factories = []
934
934
        if external_diff_options:
935
935
            opts = external_diff_options.split()
936
 
            def diff_file(olab, olines, nlab, nlines, to_file, path_encoding=None):
 
936
            def diff_file(olab, olines, nlab, nlines, to_file, path_encoding=None, context_lines=None):
937
937
                """:param path_encoding: not used but required
938
938
                        to match the signature of internal_diff.
939
939
                """