~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Patch Queue Manager
  • Date: 2012-07-28 20:20:38 UTC
  • mfrom: (6524.5.8 context_in_diffs)
  • Revision ID: pqm@pqm.ubuntu.com-20120728202038-cl923dptn267ve1x
(gz) Add option to specify how much context bzr should use in diffs (Paul
 Nixon)

Show diffs side-by-side

added added

removed removed

Lines of Context:
2335
2335
            help='Diff format to use.',
2336
2336
            lazy_registry=('bzrlib.diff', 'format_registry'),
2337
2337
            title='Diff format'),
 
2338
        Option('context',
 
2339
            help='How many lines of context to show.',
 
2340
            type=int,
 
2341
            ),
2338
2342
        ]
2339
2343
    aliases = ['di', 'dif']
2340
2344
    encoding_type = 'exact'
2341
2345
 
2342
2346
    @display_command
2343
2347
    def run(self, revision=None, file_list=None, diff_options=None,
2344
 
            prefix=None, old=None, new=None, using=None, format=None):
 
2348
            prefix=None, old=None, new=None, using=None, format=None, 
 
2349
            context=None):
2345
2350
        from bzrlib.diff import (get_trees_and_branches_to_diff_locked,
2346
2351
            show_diff_trees)
2347
2352
 
2380
2385
                               old_label=old_label, new_label=new_label,
2381
2386
                               extra_trees=extra_trees,
2382
2387
                               path_encoding=path_encoding,
2383
 
                               using=using,
 
2388
                               using=using, context=context,
2384
2389
                               format_cls=format)
2385
2390
 
2386
2391