• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python cmdutil.changeset_templater函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: maketemplater

def maketemplater(ui, repo, tmpl):
    tmpl = templater.parsestring(tmpl, quoted=False)
    try:
        t = cmdutil.changeset_templater(ui, repo, False, None, tmpl,
                                        None, False)
    except SyntaxError, inst:
        raise util.Abort(inst.args[0])
开发者ID:RayFerr000,项目名称:PLTL,代码行数:7,代码来源:churn.py


示例2: update

    def update(self, bugid, ctx):
        '''update bugzilla bug with reference to changeset.'''

        def webroot(root):
            '''strip leading prefix of repo root and turn into
            url-safe path.'''
            count = int(self.ui.config('bugzilla', 'strip', 0))
            root = util.pconvert(root)
            while count > 0:
                c = root.find('/')
                if c == -1:
                    break
                root = root[c+1:]
                count -= 1
            return root

        mapfile = self.ui.config('bugzilla', 'style')
        tmpl = self.ui.config('bugzilla', 'template')
        t = cmdutil.changeset_templater(self.ui, self.repo,
                                        False, None, mapfile, False)
        if not mapfile and not tmpl:
            tmpl = _('changeset {node|short} in repo {root} refers '
                     'to bug {bug}.\ndetails:\n\t{desc|tabindent}')
        if tmpl:
            tmpl = templater.parsestring(tmpl, quoted=False)
            t.use_template(tmpl)
        self.ui.pushbuffer()
        t.show(ctx, changes=ctx.changeset(),
               bug=str(bugid),
               hgweb=self.ui.config('web', 'baseurl'),
               root=self.repo.root,
               webroot=webroot(self.repo.root))
        data = self.ui.popbuffer()
        self.add_comment(bugid, data, util.email(ctx.user()))
开发者ID:Nurb432,项目名称:plan9front,代码行数:34,代码来源:bugzilla.py


示例3: __init__

    def __init__(self, ui, repo, hooktype):
        self.ui = ui
        cfg = self.ui.config('notify', 'config')
        if cfg:
            self.ui.readconfig(cfg, sections=['usersubs', 'reposubs'])
        self.repo = repo
        self.stripcount = int(self.ui.config('notify', 'strip', 0))
        self.root = self.strip(self.repo.root)
        self.domain = self.ui.config('notify', 'domain')
        self.mbox = self.ui.config('notify', 'mbox')
        self.test = self.ui.configbool('notify', 'test', True)
        self.charsets = mail._charsets(self.ui)
        self.subs = self.subscribers()
        self.merge = self.ui.configbool('notify', 'merge', True)

        mapfile = self.ui.config('notify', 'style')
        template = (self.ui.config('notify', hooktype) or
                    self.ui.config('notify', 'template'))
        self.t = cmdutil.changeset_templater(self.ui, self.repo,
                                             False, None, mapfile, False)
        if not mapfile and not template:
            template = deftemplates.get(hooktype) or single_template
        if template:
            template = templater.parsestring(template, quoted=False)
            self.t.use_template(template)
开发者ID:Pelonza,项目名称:Learn2Mine-Main,代码行数:25,代码来源:notify.py


示例4: __init__

    def __init__(self, ui, repo):
        self.ui = ui
        self.repo = repo

        self.ciaurl = self.ui.config('cia', 'url', 'http://cia.vc')
        self.user = self.ui.config('cia', 'user')
        self.project = self.ui.config('cia', 'project')
        self.module = self.ui.config('cia', 'module')
        self.diffstat = self.ui.configbool('cia', 'diffstat')
        self.emailfrom = self.ui.config('email', 'from')
        self.dryrun = self.ui.configbool('cia', 'test')
        self.url = self.ui.config('web', 'baseurl')
        # Default to -1 for backward compatibility
        self.stripcount = int(self.ui.config('cia', 'strip', -1))
        self.root = self.strip(self.repo.root)

        style = self.ui.config('cia', 'style')
        template = self.ui.config('cia', 'template')
        if not template:
            template = self.diffstat and self.dstemplate or self.deftemplate
        template = templater.parsestring(template, quoted=False)
        t = cmdutil.changeset_templater(self.ui, self.repo, False, None,
                                        style, False)
        t.use_template(template)
        self.templater = t
开发者ID:32bitfloat,项目名称:intellij-community,代码行数:25,代码来源:hgcia.py


示例5: kwsub

 def kwsub(mobj):
     kw = mobj.group(1)
     ct = cmdutil.changeset_templater(self.ui, self.repo, False, None, self.templates[kw], "", False)
     self.ui.pushbuffer()
     ct.show(ctx, root=self.repo.root, file=path)
     ekw = templatefilters.firstline(self.ui.popbuffer())
     return "$%s: %s $" % (kw, ekw)
开发者ID:pierfort123,项目名称:mercurial,代码行数:7,代码来源:keyword.py


示例6: maketemplater

def maketemplater(ui, repo, tmpl):
    try:
        t = cmdutil.changeset_templater(ui, repo, False, None, tmpl,
                                        None, False)
    except SyntaxError as inst:
        raise util.Abort(inst.args[0])
    return t
开发者ID:pierfort123,项目名称:mercurial,代码行数:7,代码来源:churn.py


示例7: __init__

    def __init__(self, ui, repo):
        self.ui = ui
        self.repo = repo
        self.match = match.match(repo.root, '', [],
                                 kwtools['inc'], kwtools['exc'])
        self.restrict = kwtools['hgcmd'] in restricted.split()

        kwmaps = self.ui.configitems('keywordmaps')
        if kwmaps: # override default templates
            self.templates = dict((k, templater.parsestring(v, False))
                                  for k, v in kwmaps)
        escaped = map(re.escape, self.templates.keys())
        kwpat = r'\$(%s)(: [^$\n\r]*? )??\$' % '|'.join(escaped)
        self.re_kw = re.compile(kwpat)

        templatefilters.filters['utcdate'] = utcdate
        self.ct = cmdutil.changeset_templater(self.ui, self.repo,
                                              False, None, '', False)
开发者ID:iluxa-c0m,项目名称:mercurial-crew-tonfa,代码行数:18,代码来源:keyword.py


示例8: __init__

    def __init__(self, ui, repo, inc, exc):
        self.ui = ui
        self.repo = repo
        self.matcher = util.matcher(repo.root, inc=inc, exc=exc)[1]
        self.restrict = kwtools['hgcmd'] in restricted.split()

        kwmaps = self.ui.configitems('keywordmaps')
        if kwmaps: # override default templates
            kwmaps = [(k, templater.parsestring(v, quoted=False))
                      for (k, v) in kwmaps]
            self.templates = dict(kwmaps)
        escaped = map(re.escape, self.templates.keys())
        kwpat = r'\$(%s)(: [^$\n\r]*? )??\$' % '|'.join(escaped)
        self.re_kw = re.compile(kwpat)

        templatefilters.filters['utcdate'] = utcdate
        self.ct = cmdutil.changeset_templater(self.ui, self.repo,
                                              False, '', False)
开发者ID:c0ns0le,项目名称:cygwin,代码行数:18,代码来源:keyword.py


示例9: __init__

    def __init__(self, ui, repo):
        self.ui = ui
        self.repo = repo

        self.ciaurl = self.ui.config("cia", "url", "http://cia.vc")
        self.user = self.ui.config("cia", "user")
        self.project = self.ui.config("cia", "project")
        self.module = self.ui.config("cia", "module")
        self.diffstat = self.ui.configbool("cia", "diffstat")
        self.emailfrom = self.ui.config("email", "from")
        self.dryrun = self.ui.configbool("cia", "test")
        self.url = self.ui.config("web", "baseurl")

        style = self.ui.config("cia", "style")
        template = self.ui.config("cia", "template")
        if not template:
            template = self.diffstat and self.dstemplate or self.deftemplate
        template = templater.parsestring(template, quoted=False)
        t = cmdutil.changeset_templater(self.ui, self.repo, False, None, style, False)
        t.use_template(template)
        self.templater = t
开发者ID:helloandre,项目名称:cr48,代码行数:21,代码来源:hgcia.py


示例10: __init__

    def __init__(self, ui, repo):
        self.ui = ui
        self.repo = repo

        self.ciaurl = self.ui.config("cia", "url", "http://cia.vc")
        self.user = self.ui.config("cia", "user")
        self.project = self.ui.config("cia", "project")
        self.module = self.ui.config("cia", "module")
        self.diffstat = self.ui.configbool("cia", "diffstat")
        self.emailfrom = self.ui.config("email", "from")
        self.dryrun = self.ui.configbool("cia", "test")
        self.url = self.ui.config("web", "baseurl")
        # Default to -1 for backward compatibility
        self.stripcount = int(self.ui.config("cia", "strip", -1))
        self.root = self.strip(self.repo.root)

        style = self.ui.config("cia", "style")
        template = self.ui.config("cia", "template")
        if not template:
            template = self.diffstat and self.dstemplate or self.deftemplate
        template = templater.parsestring(template, quoted=False)
        t = cmdutil.changeset_templater(self.ui, self.repo, False, None, template, style, False)
        self.templater = t
开发者ID:ZanderZhang,项目名称:Andriod-Learning,代码行数:23,代码来源:hgcia.py


示例11: maketemplater

def maketemplater(ui, repo, tmpl):
    return cmdutil.changeset_templater(ui, repo, False, None, tmpl, None, False)
开发者ID:motlin,项目名称:cyg,代码行数:2,代码来源:churn.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python cmdutil.checkunfinished函数代码示例发布时间:2022-05-27
下一篇:
Python cmdutil.bailifchanged函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap