本文整理汇总了Python中git_handler.GitHandler.get_refs方法的典型用法代码示例。如果您正苦于以下问题:Python GitHandler.get_refs方法的具体用法?Python GitHandler.get_refs怎么用?Python GitHandler.get_refs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类git_handler.GitHandler
的用法示例。
在下文中一共展示了GitHandler.get_refs方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: findoutgoing
# 需要导入模块: from git_handler import GitHandler [as 别名]
# 或者: from git_handler.GitHandler import get_refs [as 别名]
def findoutgoing(self, remote, base=None, heads=None, force=False):
if isinstance(remote, gitrepo):
git = GitHandler(self, self.ui)
base, heads = git.get_refs(remote.path)
out, h = super(hgrepo, self).findoutgoing(remote, base, heads, force)
return out
else: #pragma: no cover
return super(hgrepo, self).findoutgoing(remote, base, heads, force)
示例2: findcommonoutgoing
# 需要导入模块: from git_handler import GitHandler [as 别名]
# 或者: from git_handler.GitHandler import get_refs [as 别名]
def findcommonoutgoing(orig, repo, other, *args, **kwargs):
if isinstance(other, gitrepo.gitrepo):
git = GitHandler(repo, repo.ui)
heads = git.get_refs(other.path)[0]
kw = {}
kw.update(kwargs)
for val, k in zip(args,
('onlyheads', 'force', 'commoninc', 'portable')):
kw[k] = val
force = kw.get('force', False)
commoninc = kw.get('commoninc', None)
if commoninc is None:
commoninc = discovery.findcommonincoming(repo, other,
heads=heads, force=force)
kw['commoninc'] = commoninc
return orig(repo, other, **kw)
return orig(repo, other, *args, **kwargs)
示例3: findoutgoing
# 需要导入模块: from git_handler import GitHandler [as 别名]
# 或者: from git_handler.GitHandler import get_refs [as 别名]
def findoutgoing(orig, local, remote, *args, **kwargs):
kw = {}
kw.update(kwargs)
for val, k in zip(args, ('base', kwname, 'force')):
kw[k] = val
if isinstance(remote, gitrepo.gitrepo):
# clean up this cruft when we're 1.7-only, remoteheads and
# the return value change happened between 1.6 and 1.7.
git = GitHandler(local, local.ui)
base, heads = git.get_refs(remote.path)
newkw = {'base': base, kwname: heads}
newkw.update(kw)
kw = newkw
if kwname == 'heads':
r = orig(local, remote, **kw)
return [x[0] for x in r]
return orig(local, remote, **kw)
示例4: findoutgoing
# 需要导入模块: from git_handler import GitHandler [as 别名]
# 或者: from git_handler.GitHandler import get_refs [as 别名]
def findoutgoing(orig, local, remote, *args, **kwargs):
if isinstance(remote, gitrepo.gitrepo):
hgver = hg.util.version()
if hgver >= "1.8.9" or (hgver > "1.8" and "+" in hgver):
raise hgutil.Abort("hg-git outgoing support is broken on hg 1.9.x")
# clean up this cruft when we're 1.7-only, remoteheads and
# the return value change happened between 1.6 and 1.7.
kw = {}
kw.update(kwargs)
for val, k in zip(args, ("base", kwname, "force")):
kw[k] = val
git = GitHandler(local, local.ui)
base, heads = git.get_refs(remote.path)
newkw = {"base": base, kwname: heads}
newkw.update(kw)
kw = newkw
if kwname == "heads":
r = orig(local, remote, **kw)
return [x[0] for x in r]
if kwname == "onlyheads":
del kw["base"]
return orig(local, remote, **kw)
return orig(local, remote, *args, **kwargs)
示例5: findoutgoing
# 需要导入模块: from git_handler import GitHandler [as 别名]
# 或者: from git_handler.GitHandler import get_refs [as 别名]
def findoutgoing(orig, local, remote, *args, **kwargs):
if isinstance(remote, gitrepo.gitrepo):
hgver = hg.util.version()
if hgver >= '1.8.9' or (hgver > '1.8' and '+' in hgver):
raise hgutil.Abort(
'hg-git outgoing support is broken on hg 1.9.x')
# clean up this cruft when we're 1.7-only, remoteheads and
# the return value change happened between 1.6 and 1.7.
kw = {}
kw.update(kwargs)
for val, k in zip(args, ('base', kwname, 'force')):
kw[k] = val
git = GitHandler(local, local.ui)
base, heads = git.get_refs(remote.path)
newkw = {'base': base, kwname: heads}
newkw.update(kw)
kw = newkw
if kwname == 'heads':
r = orig(local, remote, **kw)
return [x[0] for x in r]
if kwname == 'onlyheads':
del kw['base']
return orig(local, remote, **kw)
return orig(local, remote, *args, **kwargs)