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


Python GitHandler.map_git_get方法代码示例

本文整理汇总了Python中git_handler.GitHandler.map_git_get方法的典型用法代码示例。如果您正苦于以下问题:Python GitHandler.map_git_get方法的具体用法?Python GitHandler.map_git_get怎么用?Python GitHandler.map_git_get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在git_handler.GitHandler的用法示例。


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

示例1: write

# 需要导入模块: from git_handler import GitHandler [as 别名]
# 或者: from git_handler.GitHandler import map_git_get [as 别名]
 def write(self, *args, **kwargs):
     super(ext_ui, self).write(*args, **kwargs)
     # Changesets are printed twice in the current hg code, always with label log.changeset
     if kwargs.has_key('label') and kwargs['label'] == 'log.changeset' and len(args) and cached_repo:
         global changeset_re
         global cached_git
         if not changeset_re:
             changeset_re = re.compile('(\d+):\w+(\s*)$')
         match = changeset_re.search(args[0])
         if match:
             # Parse out from the changeset string: The numeric local rev, and the line terminator
             # (So that we know if we need to print the git revision with a newline or not)
             rev, terminator = match.group(1,2)
             try:        # Works in Mercurial 1.9.x
                 from mercurial.templatefilters import hexfilter, short
             except:     # Works in Mercurial 1.8.x
                 from mercurial.templatefilters import filters
                 hexfilter = filters["hex"]
                 short = filters["short"]
             hgsha = cached_repo.lookup(int(rev)) # Ints are efficient on lookup
             if (hgsha):
                 hgsha = hexfilter(hgsha)
                 if not cached_git:
                     cached_git = GitHandler(cached_repo, self)
                 gitsha = cached_git.map_git_get(hgsha)
             else: # Currently this case is hit when you do hg outgoing. I'm not sure why.
                 gitsha = None
             
             if gitsha:
                 if terminator == '\n': # hg log, etc
                     output = _("git-rev:     %s\n")
                 else:                  # hg sum
                     output = "git:%s "
                 super(ext_ui, self).write(output % (short(gitsha)), label='log.gitchangeset')
开发者ID:mcclure,项目名称:hg-git,代码行数:36,代码来源:__init__.py

示例2: revset_fromgit

# 需要导入模块: from git_handler import GitHandler [as 别名]
# 或者: from git_handler.GitHandler import map_git_get [as 别名]
def revset_fromgit(repo, subset, x):
    '''``fromgit()``
    Select changesets that originate from Git.
    '''
    args = revset.getargs(x, 0, 0, "fromgit takes no arguments")
    git = GitHandler(repo, repo.ui)
    return [r for r in subset if git.map_git_get(repo[r].hex()) is not None]
开发者ID:CSRedRat,项目名称:hg-git,代码行数:9,代码来源:__init__.py

示例3: gitnodekw

# 需要导入模块: from git_handler import GitHandler [as 别名]
# 或者: from git_handler.GitHandler import map_git_get [as 别名]
def gitnodekw(**args):
    """:gitnode: String.  The Git changeset identification hash, as a 40 hexadecimal digit string."""
    node = args['ctx']
    repo = args['repo']
    git = GitHandler(repo, repo.ui)
    gitnode = git.map_git_get(node.hex())
    if gitnode is None:
        gitnode = ''
    return gitnode
开发者ID:CSRedRat,项目名称:hg-git,代码行数:11,代码来源:__init__.py

示例4: gsummary

# 需要导入模块: from git_handler import GitHandler [as 别名]
# 或者: from git_handler.GitHandler import map_git_get [as 别名]
def gsummary(ui, repo):
    ctx = repo[None]
    parents = ctx.parents()
    git = GitHandler(repo, ui)
    for p in parents:
        repo.ui.status(_('git-rev: %s\n') % git.map_git_get(p.hex()))
开发者ID:mcclure,项目名称:hg-git,代码行数:8,代码来源:__init__.py


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