/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-04-06 01:43:39 UTC
  • mfrom: (5131.1.4 diff-format)
  • Revision ID: pqm@pqm.ubuntu.com-20100406014339-1hnb17m0cytvah0w
(Jelmer) Support --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=False, 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
1981
1986
            raise errors.BzrCommandError('bzr diff --revision takes exactly'
1982
1987
                                         ' one or two revision specifiers')
1983
1988
 
 
1989
        if using is not None and format is not None:
 
1990
            raise errors.BzrCommandError('--using and --format are mutually '
 
1991
                'exclusive.')
 
1992
 
1984
1993
        (old_tree, new_tree,
1985
1994
         old_branch, new_branch,
1986
1995
         specific_files, extra_trees) = get_trees_and_branches_to_diff(
1989
1998
                               specific_files=specific_files,
1990
1999
                               external_diff_options=diff_options,
1991
2000
                               old_label=old_label, new_label=new_label,
1992
 
                               extra_trees=extra_trees, using=using)
 
2001
                               extra_trees=extra_trees, using=using,
 
2002
                               format_cls=format)
1993
2003
 
1994
2004
 
1995
2005
class cmd_deleted(Command):