コード例 #1
0
ファイル: extdiff.py プロジェクト: michalliu/MyCygwin
        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
コード例 #2
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 + 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
コード例 #3
0
ファイル: extdiff.py プロジェクト: seewindcn/tortoisehg
        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
コード例 #4
0
ファイル: extdiff.py プロジェクト: Nurb432/plan9front
        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
コード例 #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
コード例 #6
0
ファイル: extdiff.py プロジェクト: nedmiz-6habsu-zyJcog/hg
        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
コード例 #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
コード例 #8
0
ファイル: extdiff.py プロジェクト: motlin/cyg
 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