Exemple #1
0
        def save(cmdline):
            '''use closure to save diff command to use'''
            def mydiff(ui, repo, *pats, **opts):
                options = ' '.join(map(util.shellquote, opts['option']))
                if options:
                    options = ' ' + options
                return dodiff(ui, repo, cmdline + options, pats, opts)

            doc = _('''\
use %(path)s to diff repository (or selected files)

    Show differences between revisions for the specified files, using
    the %(path)s program.

    When two revision arguments are given, then changes are shown
    between those revisions. If only one revision is specified then
    that revision is compared to the working directory, and, when no
    revisions are specified, the working directory files are compared
    to its parent.\
''') % {
                'path': util.uirepr(path)
            }

            # We must translate the docstring right away since it is
            # used as a format string. The string will unfortunately
            # be translated again in commands.helpcmd and this will
            # fail when the docstring contains non-ASCII characters.
            # Decoding the string to a Unicode string here (using the
            # right encoding) prevents that.
            mydiff.__doc__ = doc.decode(encoding.encoding)
            return mydiff
        def save(cmd, path, diffopts):
            """use closure to save diff command to use"""

            def mydiff(ui, repo, *pats, **opts):
                return dodiff(ui, repo, path, diffopts + opts["option"], pats, opts)

            doc = (
                _(
                    """\
use %(path)s to diff repository (or selected files)

    Show differences between revisions for the specified files, using
    the %(path)s program.

    When two revision arguments are given, then changes are shown
    between those revisions. If only one revision is specified then
    that revision is compared to the working directory, and, when no
    revisions are specified, the working directory files are compared
    to its parent.\
"""
                )
                % {"path": util.uirepr(path)}
            )

            # We must translate the docstring right away since it is
            # used as a format string. The string will unfortunately
            # be translated again in commands.helpcmd and this will
            # fail when the docstring contains non-ASCII characters.
            # Decoding the string to a Unicode string here (using the
            # right encoding) prevents that.
            mydiff.__doc__ = doc.decode(encoding.encoding)
            return mydiff
Exemple #3
0
        def save(cmdline):
            '''use closure to save diff command to use'''
            def mydiff(ui, repo, *pats, **opts):
                options = ' '.join(map(util.shellquote, opts['option']))
                if options:
                    options = ' ' + options
                return dodiff(ui, repo, cmdline + options, pats, opts)
            doc = _('''\
use %(path)s to diff repository (or selected files)

    Show differences between revisions for the specified files, using
    the %(path)s program.

    When two revision arguments are given, then changes are shown
    between those revisions. If only one revision is specified then
    that revision is compared to the working directory, and, when no
    revisions are specified, the working directory files are compared
    to its parent.\
''') % {'path': util.uirepr(path)}

            # We must translate the docstring right away since it is
            # used as a format string. The string will unfortunately
            # be translated again in commands.helpcmd and this will
            # fail when the docstring contains non-ASCII characters.
            # Decoding the string to a Unicode string here (using the
            # right encoding) prevents that.
            mydiff.__doc__ = doc.decode(encoding.encoding)
            return mydiff
Exemple #4
0
        def save(cmd, path, diffopts):
            '''use closure to save diff command to use'''
            def mydiff(ui, repo, *pats, **opts):
                return dodiff(ui, repo, path, diffopts, pats, opts)
            mydiff.__doc__ = _('''\
use %(path)s to diff repository (or selected files)

    Show differences between revisions for the specified files, using the
    %(path)s program.

    When two revision arguments are given, then changes are shown between
    those revisions. If only one revision is specified then that revision is
    compared to the working directory, and, when no revisions are specified,
    the working directory files are compared to its parent.\
''') % dict(path=util.uirepr(path))
            return mydiff
Exemple #5
0
        def save(cmd, path, diffopts):
            '''use closure to save diff command to use'''
            def mydiff(ui, repo, *pats, **opts):
                return dodiff(ui, repo, path, diffopts, pats, opts)
            mydiff.__doc__ = '''use %(path)s to diff repository (or selected files)

            Show differences between revisions for the specified
            files, using the %(path)s program.

            When two revision arguments are given, then changes are
            shown between those revisions. If only one revision is
            specified then that revision is compared to the working
            directory, and, when no revisions are specified, the
            working directory files are compared to its parent.''' % {
                'path': util.uirepr(path),
                }
            return mydiff
Exemple #6
0
        def save(cmdline):
            '''use closure to save diff command to use'''
            def mydiff(ui, repo, *pats, **opts):
                options = ' '.join(map(util.shellquote, opts['option']))
                if options:
                    options = ' ' + options
                return dodiff(ui, repo, cmdline + options, pats, opts)
            # We can't pass non-ASCII through docstrings (and path is
            # in an unknown encoding anyway)
            docpath = path.encode("string-escape")
            mydiff.__doc__ = '''\
use %(path)s to diff repository (or selected files)

    Show differences between revisions for the specified files, using
    the %(path)s program.

    When two revision arguments are given, then changes are shown
    between those revisions. If only one revision is specified then
    that revision is compared to the working directory, and, when no
    revisions are specified, the working directory files are compared
    to its parent.\
''' % {'path': util.uirepr(docpath)}
            return mydiff
Exemple #7
0
 def __init__(self, path, cmdline):
     # We can't pass non-ASCII through docstrings (and path is
     # in an unknown encoding anyway)
     docpath = util.escapestr(path)
     self.__doc__ = self.__doc__ % {'path': util.uirepr(docpath)}
     self._cmdline = cmdline
Exemple #8
0
 def __init__(self, path, cmdline):
     # We can't pass non-ASCII through docstrings (and path is
     # in an unknown encoding anyway)
     docpath = path.encode("string-escape")
     self.__doc__ = self.__doc__ % {'path': util.uirepr(docpath)}
     self._cmdline = cmdline