Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions bloom/commands/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -741,9 +741,18 @@ def _my_run(cmd, msg=None):
rosdistro_url = 'https://{gh.token}:x-oauth-basic@github.com/{base_repo_id}.git'.format(**locals())
fork_template = 'https://{gh.token}:x-oauth-basic@github.com/{head_org}/{head_repo}.git'
rosdistro_fork_url = fork_template.format(**locals())
_my_run("mkdir -p {base_info[repo]}".format(**locals()))
# Use partial clone if available to speed up cloning large rosdistro repo
try:
cmd = "git clone --filter=blob:none {rosdistro_url} " \
"--branch {base_info[branch]} --single-branch {base_info[repo]}"
_my_run(cmd.format(**locals()), "Cloning rosdistro")
except subprocess.CalledProcessError:
cmd = "git clone {rosdistro_url} " \
"--branch {base_info[branch]} --single-branch {base_info[repo]}"
_my_run(cmd.format(**locals()), "Cloning rosdistro (fallback to full clone)")
with change_directory(base_info['repo']):
_my_run('git init')
# Remove the remote to avoid storing the oauth token in the git config
_my_run("git remote remove origin")
branches = [x['name'] for x in gh.list_branches(head_org, head_repo)]
new_branch = 'bloom-{repository}-{count}'
count = 0
Expand All @@ -763,8 +772,6 @@ def _my_run(cmd, msg=None):
warning("Skipping the pull request...")
return
_my_run('git checkout -b {new_branch}'.format(**locals()))
_my_run("git pull {rosdistro_url} {base_info[branch]}".format(**locals()),
"Pulling latest rosdistro branch")
rosdistro_index_commit = get_rosdistro_index_commit()
if rosdistro_index_commit is not None:
_my_run('git reset --hard {rosdistro_index_commit}'.format(**locals()))
Expand Down
Loading