当前位置: 首页>>代码示例>>Python>>正文


Python cmdutil.command函数代码示例

本文整理汇总了Python中mercurial.cmdutil.command函数的典型用法代码示例。如果您正苦于以下问题:Python command函数的具体用法?Python command怎么用?Python command使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了command函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: scanpatch

# record.py
#
# Copyright 2007 Bryan O'Sullivan <[email protected]>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.

"""commands to interactively select changes for commit/qrefresh"""

from mercurial.i18n import gettext, _
from mercurial import cmdutil, commands, extensions, hg, patch
from mercurial import util
import copy, cStringIO, errno, os, re, shutil, tempfile

cmdtable = {}
command = cmdutil.command(cmdtable)
testedwith = "internal"

lines_re = re.compile(r"@@ -(\d+),(\d+) \+(\d+),(\d+) @@\s*(.*)")

diffopts = [
    ("w", "ignore-all-space", False, _("ignore white space when comparing lines")),
    ("b", "ignore-space-change", None, _("ignore changes in the amount of white space")),
    ("B", "ignore-blank-lines", None, _("ignore changes whose lines are all blank")),
]


def scanpatch(fp):
    """like patch.iterhunks, but yield different events

    - ('file',    [header_lines + fromfile + tofile])
开发者ID:jordigh,项目名称:mercurial-crew,代码行数:31,代码来源:record.py

示例2: debuggethostfingerprint

#
# Copyright 2013, 2014 Yuya Nishihara <[email protected]>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.

import os, socket

from mercurial import cmdutil, commands, extensions, sslutil, util

from tortoisehg.util import hgversion
from tortoisehg.util.i18n import agettext as _

cmdtable = {}
_mqcmdtable = {}
command = cmdutil.command(cmdtable)
mqcommand = cmdutil.command(_mqcmdtable)
testedwith = hgversion.testedwith

@command('debuggethostfingerprint',
    [],
    _('[SOURCE]'),
    optionalrepo=True)
def debuggethostfingerprint(ui, repo, source='default'):
    """retrieve a fingerprint of the server certificate

    The server certificate is not verified.
    """
    source = ui.expandpath(source)
    u = util.url(source)
    scheme = (u.scheme or '').split('+')[-1]
开发者ID:seewindcn,项目名称:tortoisehg,代码行数:31,代码来源:hgcommands.py

示例3: checkargs

                calltree.output(ostream)
            else:
                # format == 'text'
                stats = lsprof.Stats(p.getstats())
                stats.sort()
                stats.pprint(top=10, file=ostream, climit=5)

            if output:
                ostream.close()
    else:
        return checkargs()

qtrun = qtapp.QtRunner()

table = {}
command = cmdutil.command(table)

# common command options

globalopts = [
    ('R', 'repository', '',
     _('repository root directory or symbolic path name')),
    ('v', 'verbose', None, _('enable additional output')),
    ('q', 'quiet', None, _('suppress output')),
    ('h', 'help', None, _('display help and exit')),
    ('', 'debugger', None, _('start debugger')),
    ('', 'profile', None, _('print command execution profile')),
    ('', 'nofork', None, _('do not fork GUI process')),
    ('', 'fork', None, _('always fork GUI process')),
    ('', 'listfile', '', _('read file list from file')),
    ('', 'listfileutf8', '', _('read file list from file encoding utf-8')),
开发者ID:velorientc,项目名称:git_test7,代码行数:31,代码来源:run.py

示例4: hasattr

      <repository root="/foo/bar">
        <manifest revision="1234" path="lib">
          <file name="diff.rb" revision="123" node="34567abc..." time="12345"
                 size="100"/>
          ...
          <dir name="redmine"/>
          ...
        </manifest>
      </repository>
    </rhmanifest>
"""
import re, time, cgi, urllib
from mercurial import cmdutil, commands, node, error, hg, registrar

cmdtable = {}
command = registrar.command(cmdtable) if hasattr(registrar, 'command') else cmdutil.command(cmdtable)

_x = cgi.escape
_u = lambda s: cgi.escape(urllib.quote(s))

def _changectx(repo, rev):
    if isinstance(rev, str):
       rev = repo.lookup(rev)
    if hasattr(repo, 'changectx'):
        return repo.changectx(rev)
    else:
        return repo[rev]

def _tip(ui, repo):
    # see mercurial/commands.py:tip
    def tiprev():
开发者ID:Jinzy,项目名称:redmine,代码行数:31,代码来源:redminehelper.py


注:本文中的mercurial.cmdutil.command函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。