本文整理汇总了Python中util.hg.apply_and_push函数的典型用法代码示例。如果您正苦于以下问题:Python apply_and_push函数的具体用法?Python apply_and_push怎么用?Python apply_and_push使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了apply_and_push函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testApplyAndPush
def testApplyAndPush(self):
clone(self.repodir, self.wc)
def c(repo, attempt):
run_cmd(['hg', 'tag', '-f', 'TEST'], cwd=repo)
apply_and_push(self.wc, self.repodir, c)
self.assertEquals(getRevisions(self.wc), getRevisions(self.repodir))
示例2: tag_repo
def tag_repo(workdir, branch, tags, pushRepo, hg_username,
hg_ssh_key):
def tag_and_push(repo, attempt):
update(workdir, branch)
tag(workdir, tags, rev=branch, force=True, user=hg_username)
log.info("Tagged %s, attempt #%s" % (repo, attempt))
apply_and_push(workdir, pushRepo, tag_and_push,
ssh_username=hg_username, ssh_key=hg_ssh_key)
示例3: testApplyAndPushRebaseFails
def testApplyAndPushRebaseFails(self):
clone(self.repodir, self.wc)
def c(repo, attempt, remote):
run_cmd(['hg', 'tag', '-f', 'TEST'], cwd=repo)
if attempt in (1,2):
run_cmd(['hg', 'tag', '-f', 'CONFLICTING_TAG'], cwd=remote)
apply_and_push(self.wc, self.repodir,
lambda r, a: c(r, a, self.repodir), max_attempts=3)
self.assertEquals(getRevisions(self.wc), getRevisions(self.repodir))
示例4: testApplyAndPushWithRebase
def testApplyAndPushWithRebase(self):
clone(self.repodir, self.wc)
def c(repo, attempt, remote):
run_cmd(['hg', 'tag', '-f', 'TEST'], cwd=repo)
if attempt == 1:
run_cmd(['hg', 'rm', 'hello.txt'], cwd=remote)
run_cmd(['hg', 'commit', '-m', 'test'], cwd=remote)
apply_and_push(self.wc, self.repodir,
lambda r, a: c(r, a, self.repodir), max_attempts=2)
self.assertEquals(getRevisions(self.wc), getRevisions(self.repodir))
示例5: testApplyAndPushWithRebase
def testApplyAndPushWithRebase(self):
clone(self.repodir, self.wc)
def c(repo, attempt, remote):
run_cmd(["hg", "tag", "-f", "TEST"], cwd=repo)
if attempt == 1:
run_cmd(["hg", "rm", "hello.txt"], cwd=remote)
run_cmd(["hg", "commit", "-m", "test"], cwd=remote)
apply_and_push(self.wc, self.repodir, lambda r, a: c(r, a, self.repodir), max_attempts=2)
self.assertEquals(getRevisions(self.wc), getRevisions(self.repodir))
示例6: testApplyAndPushForce
def testApplyAndPushForce(self):
clone(self.repodir, self.wc)
def c(repo, attempt, remote, local):
run_cmd(['touch', 'newfile'], cwd=remote)
run_cmd(['hg', 'add', 'newfile'], cwd=remote)
run_cmd(['hg', 'commit', '-m', '"add newfile"'], cwd=remote)
run_cmd(['touch', 'newfile'], cwd=local)
run_cmd(['hg', 'add', 'newfile'], cwd=local)
run_cmd(['hg', 'commit', '-m', '"re-add newfile"'], cwd=local)
apply_and_push(self.wc, self.repodir,
(lambda r, a: c(r, a, self.repodir, self.wc)), force=True)
示例7: testApplyAndPushForce
def testApplyAndPushForce(self):
clone(self.repodir, self.wc)
def c(repo, attempt, remote, local):
run_cmd(["touch", "newfile"], cwd=remote)
run_cmd(["hg", "add", "newfile"], cwd=remote)
run_cmd(["hg", "commit", "-m", '"add newfile"'], cwd=remote)
run_cmd(["touch", "newfile"], cwd=local)
run_cmd(["hg", "add", "newfile"], cwd=local)
run_cmd(["hg", "commit", "-m", '"re-add newfile"'], cwd=local)
apply_and_push(self.wc, self.repodir, (lambda r, a: c(r, a, self.repodir, self.wc)), force=True)
示例8: import_and_push
def import_and_push(repo, bug, branch_name, patch_ids, patches_dir,
add_try_commit, try_syntax, pull_repo, push_repo,
ssh_username, ssh_key):
def changer(repo, attempt):
log.debug("Importing patches, attemp #%s", attempt)
import_patches(bug=bug, branch_name=branch_name, patch_ids=patch_ids,
patches_dir=patches_dir, repo=repo,
add_try_commit=add_try_commit,
pull_repo=pull_repo, try_syntax=try_syntax)
setup_repo(repo=repo, pull_repo=pull_repo)
apply_and_push(localrepo=repo, remote=push_repo, changer=changer,
max_attempts=10, ssh_username=ssh_username, ssh_key=ssh_key,
force=False)
return get_revision(repo)
示例9: get_release_sanity_args
rs_args = get_release_sanity_args(configs_workdir, release,
cfgFile, masters_json,
buildbot_configs_branch)
release_sanity_script = "%s/buildbot-helpers/release_sanity.py" % tools_workdir
run_cmd(['python', release_sanity_script] + rs_args +
['--dry-run'])
rr.update_status(
release, 'Waiting for other releases to run release sanity'
)
try:
# Pushing doesn't happen until _after_ release sanity has been run
# for all releases to minimize the chance of bad configs being
# pushed. apply_and_push calls process_configs, and if it returns
# successfully, it pushes all of the changes that it made.
apply_and_push(configs_workdir, configs_pushRepo, process_configs,
ssh_username=hg_username, ssh_key=hg_ssh_key)
# Now that we know that all of the configs are good, we can tag
# the other repositories
for release in rr.new_releases:
rr.update_status(release, 'Tagging other repositories')
tag_repo(workdir=custom_workdir, branch=buildbotcustom_branch,
tags=tags, pushRepo=custom_pushRepo,
hg_username=hg_username, hg_ssh_key=hg_ssh_key)
tag_repo(workdir=tools_workdir, branch=tools_branch, tags=tags,
pushRepo=tools_pushRepo,
hg_username=hg_username, hg_ssh_key=hg_ssh_key)
for release in rr.new_releases:
rr.update_status(release, 'Reconfiging masters')
# Reconfig the masters and configure the warning callback, if present.