~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Jelmer Vernooij
  • Date: 2010-04-05 21:47:13 UTC
  • mto: This revision was merged to the branch mainline in revision 5132.
  • Revision ID: jelmer@samba.org-20100405214713-uohbdzm7eky5kn4e
Add --format option to 'bzr diff'.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1954
1954
            help='Use this command to compare files.',
1955
1955
            type=unicode,
1956
1956
            ),
 
1957
        RegistryOption('format',
 
1958
            help='Diff format to use.',
 
1959
            lazy_registry=('bzrlib.diff', 'format_registry'),
 
1960
            value_switches=True, title='Diff format'),
1957
1961
        ]
1958
1962
    aliases = ['di', 'dif']
1959
1963
    encoding_type = 'exact'
1960
1964
 
1961
1965
    @display_command
1962
1966
    def run(self, revision=None, file_list=None, diff_options=None,
1963
 
            prefix=None, old=None, new=None, using=None):
1964
 
        from bzrlib.diff import get_trees_and_branches_to_diff, show_diff_trees
 
1967
            prefix=None, old=None, new=None, using=None, format=None):
 
1968
        from bzrlib.diff import (get_trees_and_branches_to_diff,
 
1969
            show_diff_trees)
1965
1970
 
1966
1971
        if (prefix is None) or (prefix == '0'):
1967
1972
            # diff -p0 format
1989
1994
                               specific_files=specific_files,
1990
1995
                               external_diff_options=diff_options,
1991
1996
                               old_label=old_label, new_label=new_label,
1992
 
                               extra_trees=extra_trees, using=using)
 
1997
                               extra_trees=extra_trees, using=using,
 
1998
                               format_cls=format)
1993
1999
 
1994
2000
 
1995
2001
class cmd_deleted(Command):