本文整理汇总了Python中git.cmd.Git.rebase方法的典型用法代码示例。如果您正苦于以下问题:Python Git.rebase方法的具体用法?Python Git.rebase怎么用?Python Git.rebase使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类git.cmd.Git
的用法示例。
在下文中一共展示了Git.rebase方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: roll
# 需要导入模块: from git.cmd import Git [as 别名]
# 或者: from git.cmd.Git import rebase [as 别名]
def roll(options, debug, info, error):
to_arg = options.args.index('to')
path = getcwd()
git = Git(path)
repo = Repo(path)
dest = None
source = None
active = repo.active_branch
settings = options.release_tool_settings
if to_arg == 0:
source = active
dest = options.args[1]
#update()
elif to_arg == 1:
source = options.args[0]
dest = options.args[2]
else:
return
secret = settings['secrets'][str(dest)]
if secret:
info('Special permission is required to roll to this branch.')
if not secret or has_permission(if_matches=secret):
debug('rebasing {source} onto {dest}...'.format(
source=source,
dest=dest
))
if secret:
debug(git.rebase(source, dest))
git.tag('-m', message('Roll from {source} to {dest} with special \
permission by {name} <{email}>.'.format(
source=source,
dest=dest,
name=Actor.author().name,
email=Actor.author().email
), 'tag'),
'-s',
'roll-from-' +
source + '-to-' +
dest + '-' +
datetime.utcnow().isoformat().replace(':', '.'),
output_stream=stdout)
else:
debug(git.rebase(source, dest))
debug('checking out {source}...'.format(source=source))
debug(git.checkout(active))
info('Rolled {source} to {dest}.'.format(source=source, dest=dest))
else:
error('You do not have permission to roll to this branch')