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

Python cmdutil.show_changeset函数代码示例

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

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



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

示例1: metadata

        def metadata():
            base = "repo: %s\nnode: %s\nbranch: %s\n" % (hex(repo.changelog.node(0)), hex(node), ctx.branch())

            tags = "".join("tag: %s\n" % t for t in ctx.tags() if repo.tagtype(t) == "global")
            if not tags:
                repo.ui.pushbuffer()
                opts = {"template": "{latesttag}\n{latesttagdistance}", "style": "", "patch": None, "git": None}
                cmdutil.show_changeset(repo.ui, repo, opts).show(ctx)
                ltags, dist = repo.ui.popbuffer().split("\n")
                tags = "".join("latesttag: %s\n" % t for t in ltags.split(":"))
                tags += "latesttagdistance: %s\n" % dist

            return base + tags
开发者ID:songmm19900210,项目名称:galaxy-tools-prok,代码行数:13,代码来源:overrides.py


示例2: graphlog

def graphlog(ui, repo, *pats, **opts):
    """show revision history alongside an ASCII revision graph

    Print a revision history alongside a revision graph drawn with
    ASCII characters.

    Nodes printed as an @ character are parents of the working
    directory.
    """

    revs, expr, filematcher = getlogrevs(repo, pats, opts)
    revs = sorted(revs, reverse=1)
    limit = cmdutil.loglimit(opts)
    if limit is not None:
        revs = revs[:limit]
    revdag = graphmod.dagwalker(repo, revs)

    getrenamed = None
    if opts.get('copies'):
        endrev = None
        if opts.get('rev'):
            endrev = max(scmutil.revrange(repo, opts.get('rev'))) + 1
        getrenamed = templatekw.getrenamedfn(repo, endrev=endrev)
    displayer = show_changeset(ui, repo, opts, buffered=True)
    showparents = [ctx.node() for ctx in repo[None].parents()]
    generate(ui, revdag, displayer, showparents, asciiedges, getrenamed,
             filematcher)
开发者ID:Pelonza,项目名称:Learn2Mine-Main,代码行数:27,代码来源:graphlog.py


示例3: children

def children(ui, repo, file_=None, **opts):
    """show the children of the given or working directory revision

    Print the children of the working directory's revisions. If a
    revision is given via -r/--rev, the children of that revision will
    be printed. If a file argument is given, revision in which the
    file was last changed (after the working directory revision or the
    argument to --rev if given) is printed.

    Please use :hg:`log` instead::

        hg children => hg log -r 'children()'
        hg children -r REV => hg log -r 'children(REV)'

    See :hg:`help log` and :hg:`help revsets.children`.

    """
    rev = opts.get('rev')
    if file_:
        fctx = repo.filectx(file_, changeid=rev)
        childctxs = [fcctx.changectx() for fcctx in fctx.children()]
    else:
        ctx = repo[rev]
        childctxs = ctx.children()

    displayer = cmdutil.show_changeset(ui, repo, opts)
    for cctx in childctxs:
        displayer.show(cctx)
    displayer.close()
开发者ID:seewindcn,项目名称:tortoisehg,代码行数:29,代码来源:children.py


示例4: metadata

        def metadata():
            base = 'repo: %s\nnode: %s\nbranch: %s\n' % (
                hex(repo.changelog.node(0)), hex(node), ctx.branch())

            tags = ''.join('tag: %s\n' % t for t in ctx.tags()
                           if repo.tagtype(t) == 'global')
            if not tags:
                repo.ui.pushbuffer()
                opts = {'template': '{latesttag}\n{latesttagdistance}',
                        'style': '', 'patch': None, 'git': None}
                cmdutil.show_changeset(repo.ui, repo, opts).show(ctx)
                ltags, dist = repo.ui.popbuffer().split('\n')
                tags = ''.join('latesttag: %s\n' % t for t in ltags.split(':'))
                tags += 'latesttagdistance: %s\n' % dist

            return base + tags
开发者ID:jordigh,项目名称:mercurial-crew,代码行数:16,代码来源:overrides.py


示例5: outgoing

	def outgoing(self):
		limit = cmdutil.loglimit(opts)
		dest, revs, checkout = hg.parseurl(
			ui.expandpath(dest or 'default-push', dest or 'default'), opts.get('rev'))
		if revs:
			revs = [repo.lookup(rev) for rev in revs]

		other = hg.repository(cmdutil.remoteui(repo, opts), dest)
		ui.status(_('comparing with %s\n') % url.hidepassword(dest))
		o = repo.findoutgoing(other, force=opts.get('force'))
		if not o:
			ui.status(_("no changes found\n"))
			return 1
		o = repo.changelog.nodesbetween(o, revs)[0]
		if opts.get('newest_first'):
			o.reverse()
		displayer = cmdutil.show_changeset(ui, repo, opts)
		count = 0
		for n in o:
			if count >= limit:
				break
			parents = [p for p in repo.changelog.parents(n) if p != nullid]
			if opts.get('no_merges') and len(parents) == 2:
				continue
			count += 1
			displayer.show(repo[n])
开发者ID:ararog,项目名称:iShareCode,代码行数:26,代码来源:SynchronizeController.py


示例6: graphlog

def graphlog(ui, repo, path=None, **opts):
    """show revision history alongside an ASCII revision graph

    Print a revision history alongside a revision graph drawn with
    ASCII characters.

    Nodes printed as an @ character are parents of the working
    directory.
    """

    check_unsupported_flags(opts)
    limit = cmdutil.loglimit(opts)
    start, stop = get_revs(repo, opts["rev"])
    if start == nullrev:
        return

    if path:
        path = util.canonpath(repo.root, os.getcwd(), path)
    if path: # could be reset in canonpath
        revdag = graphmod.filerevs(repo, path, start, stop, limit)
    else:
        if limit is not None:
            stop = max(stop, start - limit + 1)
        revdag = graphmod.revisions(repo, start, stop)

    displayer = show_changeset(ui, repo, opts, buffered=True)
    showparents = [ctx.node() for ctx in repo[None].parents()]
    generate(ui, revdag, displayer, showparents, asciiedges)
开发者ID:ThissDJ,项目名称:designhub,代码行数:28,代码来源:graphlog.py


示例7: goutgoing

def goutgoing(ui, repo, dest=None, **opts):
    """show the outgoing changesets alongside an ASCII revision graph

    Print the outgoing changesets alongside a revision graph drawn with
    ASCII characters.

    Nodes printed as an @ character are parents of the working
    directory.
    """

    check_unsupported_flags(opts)
    dest = ui.expandpath(dest or 'default-push', dest or 'default')
    dest, branches = hg.parseurl(dest, opts.get('branch'))
    revs, checkout = hg.addbranchrevs(repo, repo, branches, opts.get('rev'))
    other = hg.repository(cmdutil.remoteui(ui, opts), dest)
    if revs:
        revs = [repo.lookup(rev) for rev in revs]
    ui.status(_('comparing with %s\n') % url.hidepassword(dest))
    o = repo.findoutgoing(other, force=opts.get('force'))
    if not o:
        ui.status(_("no changes found\n"))
        return

    o = repo.changelog.nodesbetween(o, revs)[0]
    revdag = graphrevs(repo, o, opts)
    displayer = show_changeset(ui, repo, opts, buffered=True)
    showparents = [ctx.node() for ctx in repo[None].parents()]
    generate(ui, revdag, displayer, showparents, asciiedges)
开发者ID:Frostman,项目名称:intellij-community,代码行数:28,代码来源:graphlog.py


示例8: get_rev_msg

 def get_rev_msg(self, revision_hash, template=TEMPLATE):
     self.displayer = show_changeset(self.ui, self.repo, {'template': template}, False)
     self.ui.pushbuffer()
     rev = self.repo.lookup(revision_hash)
     ctx = context.changectx(self.repo, rev)
     self.displayer.show(ctx)
     msg = self.ui.popbuffer()
     return msg
开发者ID:sphinx-doc,项目名称:bitbucket_issue_migration,代码行数:8,代码来源:hglog2json.py


示例9: incoming

	def incoming(self):
		limit = cmdutil.loglimit(opts)
		source, revs, checkout = hg.parseurl(ui.expandpath(source), opts.get('rev'))
		other = hg.repository(cmdutil.remoteui(repo, opts), source)
		ui.status(_('comparing with %s\n') % url.hidepassword(source))
		if revs:
			revs = [other.lookup(rev) for rev in revs]
		common, incoming, rheads = repo.findcommonincoming(other, heads=revs,
                                                       force=opts["force"])
		if not incoming:
			try:
				os.unlink(opts["bundle"])
			except:
				pass
			ui.status(_("no changes found\n"))
			return 1

		cleanup = None
		try:
			fname = opts["bundle"]
			if fname or not other.local():
				# create a bundle (uncompressed if other repo is not local)

				if revs is None and other.capable('changegroupsubset'):
					revs = rheads

				if revs is None:
					cg = other.changegroup(incoming, "incoming")
				else:
					cg = other.changegroupsubset(incoming, revs, 'incoming')
				bundletype = other.local() and "HG10BZ" or "HG10UN"
				fname = cleanup = changegroup.writebundle(cg, fname, bundletype)
				# keep written bundle?
				if opts["bundle"]:
					cleanup = None
				if not other.local():
					# use the created uncompressed bundlerepo
					other = bundlerepo.bundlerepository(ui, repo.root, fname)

			o = other.changelog.nodesbetween(incoming, revs)[0]
			if opts.get('newest_first'):
				o.reverse()
			displayer = cmdutil.show_changeset(ui, other, opts)
			count = 0
			for n in o:
				if count >= limit:
					break
				parents = [p for p in other.changelog.parents(n) if p != nullid]
				if opts.get('no_merges') and len(parents) == 2:
					continue
				count += 1
				displayer.show(other[n])
		finally:
			if hasattr(other, 'close'):
				other.close()
			if cleanup:
				os.unlink(cleanup)
开发者ID:ararog,项目名称:iShareCode,代码行数:57,代码来源:SynchronizeController.py


示例10: heads

 def heads(self, repo):
     """ Show the head revisions """
     heads = repo.heads()
     repo.ui.pushbuffer()
     displayer = cmdutil.show_changeset(repo.ui, repo, {})
     for n in heads:
         displayer.show(changenode=n)
     text = repo.ui.popbuffer()
     return text
开发者ID:tdjordan,项目名称:tortoisegit,代码行数:9,代码来源:revisions.py


示例11: gincoming

def gincoming(ui, repo, source="default", **opts):
    """show the incoming changesets alongside an ASCII revision graph

    Print the incoming changesets alongside a revision graph drawn with
    ASCII characters.

    Nodes printed as an @ character are parents of the working
    directory.
    """

    check_unsupported_flags(opts)
    source, branches = hg.parseurl(ui.expandpath(source), opts.get('branch'))
    other = hg.repository(cmdutil.remoteui(repo, opts), source)
    revs, checkout = hg.addbranchrevs(repo, other, branches, opts.get('rev'))
    ui.status(_('comparing with %s\n') % url.hidepassword(source))
    if revs:
        revs = [other.lookup(rev) for rev in revs]
    incoming = repo.findincoming(other, heads=revs, force=opts["force"])
    if not incoming:
        try:
            os.unlink(opts["bundle"])
        except:
            pass
        ui.status(_("no changes found\n"))
        return

    cleanup = None
    try:

        fname = opts["bundle"]
        if fname or not other.local():
            # create a bundle (uncompressed if other repo is not local)
            if revs is None:
                cg = other.changegroup(incoming, "incoming")
            else:
                cg = other.changegroupsubset(incoming, revs, 'incoming')
            bundletype = other.local() and "HG10BZ" or "HG10UN"
            fname = cleanup = changegroup.writebundle(cg, fname, bundletype)
            # keep written bundle?
            if opts["bundle"]:
                cleanup = None
            if not other.local():
                # use the created uncompressed bundlerepo
                other = bundlerepo.bundlerepository(ui, repo.root, fname)

        chlist = other.changelog.nodesbetween(incoming, revs)[0]
        revdag = graphrevs(other, chlist, opts)
        displayer = show_changeset(ui, other, opts, buffered=True)
        showparents = [ctx.node() for ctx in repo[None].parents()]
        generate(ui, revdag, displayer, showparents, asciiedges)

    finally:
        if hasattr(other, 'close'):
            other.close()
        if cleanup:
            os.unlink(cleanup)
开发者ID:Frostman,项目名称:intellij-community,代码行数:56,代码来源:graphlog.py


示例12: parents

 def parents(self, repo):
     """ Show the parent revisions """
     p = repo.dirstate.parents()
     repo.ui.pushbuffer()
     displayer = cmdutil.show_changeset(repo.ui, repo, {})
     for n in p:
         if n != nullid:
             displayer.show(changenode=n)
     text = repo.ui.popbuffer()
     return text
开发者ID:tdjordan,项目名称:tortoisegit,代码行数:10,代码来源:revisions.py


示例13: asciiformat

def asciiformat(ui, repo, revdag, opts, parentrepo=None):
    """formats a changelog DAG walk for ASCII output"""
    if parentrepo is None:
        parentrepo = repo
    showparents = [ctx.node() for ctx in parentrepo[None].parents()]
    displayer = show_changeset(ui, repo, opts, buffered=True)
    for (id, type, ctx, parentids) in revdag:
        if type != graphmod.CHANGESET:
            continue
        displayer.show(ctx)
        lines = displayer.hunk.pop(ctx.rev()).split('\n')[:-1]
        char = ctx.node() in showparents and '@' or 'o'
        yield (id, ASCIIDATA, (char, lines), parentids)
开发者ID:wangbiaouestc,项目名称:WindowsMingWMC,代码行数:13,代码来源:graphlog.py


示例14: parents

def parents(orig, ui, repo, *args, **opts):
    """show Mercurial & Subversion parents of the working dir or revision
    """
    if not opts.get('svn', False):
        return orig(ui, repo, *args, **opts)
    meta = repo.svnmeta()
    hashes = meta.revmap.hashes()
    ha = util.parentrev(ui, repo, meta, hashes)
    if ha.node() == node.nullid:
        raise hgutil.Abort('No parent svn revision!')
    displayer = cmdutil.show_changeset(ui, repo, opts, buffered=False)
    displayer.show(ha)
    return 0
开发者ID:chaptastic,项目名称:config_files,代码行数:13,代码来源:wrappers.py


示例15: _showchangesets

def _showchangesets(ui, repo, contexts=None, revs=None):
    """Pretty print a list of changesets. Can take either a list of
       change contexts or a list of revision numbers.
    """
    if contexts is None:
        contexts = []
    if revs is not None:
        contexts.extend(repo[r] for r in revs)
    showopts = {
        'template': '[{shortest(node, 6)}] {if(bookmarks, "({bookmarks}) ")}'
                    '{desc|firstline}\n'
    }
    displayer = cmdutil.show_changeset(ui, repo, showopts)
    for ctx in contexts:
        displayer.show(ctx)
开发者ID:davidshepherd7,项目名称:dotfiles,代码行数:15,代码来源:movement.py


示例16: fxheads

def fxheads(ui, repo, **opts):
    """Show last known head commits for pulled Firefox trees.

    The displayed list may be out of date. Pull before running to ensure
    data is current.
    """
    if not isfirefoxrepo(repo):
        raise util.Abort(_('fxheads is only available on Firefox repos'))

    displayer = cmdutil.show_changeset(ui, repo, opts)
    for tag, node, tree, uri in get_firefoxtrees(repo):
        ctx = repo[node]
        displayer.show(ctx)

    displayer.close()
开发者ID:pombredanne,项目名称:version-control-tools,代码行数:15,代码来源:__init__.py


示例17: browserevs

def browserevs(ui, repo, nodes, opts):
    """interactively transplant changesets"""

    def browsehelp(ui):
        ui.write(
            _(
                "y: transplant this changeset\n"
                "n: skip this changeset\n"
                "m: merge at this changeset\n"
                "p: show patch\n"
                "c: commit selected changesets\n"
                "q: cancel transplant\n"
                "?: show this help\n"
            )
        )

    displayer = cmdutil.show_changeset(ui, repo, opts)
    transplants = []
    merges = []
    for node in nodes:
        displayer.show(repo[node])
        action = None
        while not action:
            action = ui.prompt(_("apply changeset? [ynmpcq?]:"))
            if action == "?":
                browsehelp(ui)
                action = None
            elif action == "p":
                parent = repo.changelog.parents(node)[0]
                for chunk in patch.diff(repo, parent, node):
                    ui.write(chunk)
                action = None
            elif action not in ("y", "n", "m", "c", "q"):
                ui.write(_("no such option\n"))
                action = None
        if action == "y":
            transplants.append(node)
        elif action == "m":
            merges.append(node)
        elif action == "c":
            break
        elif action == "q":
            transplants = ()
            merges = ()
            break
    displayer.close()
    return (transplants, merges)
开发者ID:influencia0406,项目名称:intellij-community,代码行数:47,代码来源:transplant.py


示例18: fxheads

def fxheads(ui, repo, **opts):
    """Show last known head commits for pulled Firefox trees.

    The displayed list may be out of date. Pull before running to ensure
    data is current.
    """
    if not isfirefoxrepo(repo):
        raise util.Abort(_('fxheads is only available on Firefox repos'))

    displayer = cmdutil.show_changeset(ui, repo, opts)
    for tag, node in sorted(repo.tags().items()):
        if not resolve_trees_to_uris([tag])[0][1]:
            continue

        ctx = repo[node]
        displayer.show(ctx)

    displayer.close()
开发者ID:simar7,项目名称:git-version-control-tools-clone,代码行数:18,代码来源:__init__.py


示例19: children

def children(ui, repo, file_=None, **opts):
    """show the children of the given or working dir revision

    Print the children of the working directory's revisions.
    If a revision is given via --rev, the children of that revision
    will be printed. If a file argument is given, revision in
    which the file was last changed (after the working directory
    revision or the argument to --rev if given) is printed.
    """
    rev = opts.get('rev')
    if file_:
        ctx = repo.filectx(file_, changeid=rev)
    else:
        ctx = repo.changectx(rev)

    displayer = cmdutil.show_changeset(ui, repo, opts)
    for node in [cp.node() for cp in ctx.children()]:
        displayer.show(changenode=node)
开发者ID:c0ns0le,项目名称:cygwin,代码行数:18,代码来源:children.py


示例20: goutgoing

def goutgoing(ui, repo, dest=None, **opts):
    """show the outgoing changesets alongside an ASCII revision graph

    Print the outgoing changesets alongside a revision graph drawn with
    ASCII characters.

    Nodes printed as an @ character are parents of the working
    directory.
    """

    check_unsupported_flags(opts)
    o = hg._outgoing(ui, repo, dest, opts)
    if o is None:
        return

    revdag = graphrevs(repo, o, opts)
    displayer = show_changeset(ui, repo, opts, buffered=True)
    showparents = [ctx.node() for ctx in repo[None].parents()]
    generate(ui, revdag, displayer, showparents, asciiedges)
开发者ID:ThissDJ,项目名称:designhub,代码行数:19,代码来源:graphlog.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python commands.add函数代码示例发布时间:2022-05-27
下一篇:
Python cmdutil.match函数代码示例发布时间: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