# -*- encoding: utf-8 -*-
# Copyright (c) 2006, 2007 Adeodato Simó (dato@net.com.org.es)
# Licensed under the terms of the MIT license.

from bzrlib.option import _parse_change_str
from bzrlib.commands import register_command
from bzrlib.builtins import cmd_diff as orig_cmd_diff

class cmd_diff(orig_cmd_diff):
    __doc__ = orig_cmd_diff.__doc__ + """
    IMPORTANT NOTE:

        This is a NON-STANDARD modified version of `bzr diff` in which
        "-r X" means "-c X" rather than "-r N..".
    """

    def run(self, revision=None, **kwargs):
        if revision is not None and len(revision) == 1:
            revstr = (revision[0].prefix or '') + revision[0].spec
            revision = _parse_change_str(revstr)

        orig_cmd_diff.run(self, revision=revision, **kwargs)

register_command(cmd_diff, True)
