Skip to content

Commit

Permalink
Distro specific branches (ros-infrastructure#107)
Browse files Browse the repository at this point in the history
* Push to distro-specific branches.

* Parameterize remote and branch in RepoInstance class.

* Fix keyword.
  • Loading branch information
allenh1 committed Dec 28, 2017
1 parent f8edd3d commit e46b2e5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
4 changes: 2 additions & 2 deletions superflore/generators/bitbake/ros_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,6 @@ def commit_changes(self, distro):
info('Committing to branch {0}...'.format(self.branch_name))
self.repo.git.commit(m='{0}'.format(commit_msg))

def pull_request(self, message):
def pull_request(self, message, distro):
pr_title = 'rosdistro sync, {0}'.format(time.ctime())
self.repo.pull_request(message, pr_title)
self.repo.pull_request(message, pr_title, branch=distro)
6 changes: 3 additions & 3 deletions superflore/generators/bitbake/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@
overlay = None


def file_pr(overlay, delta, missing_deps):
def file_pr(overlay, delta, missing_deps, distro):
try:
overlay.pull_request('{0}\n{1}'.format(delta, missing_deps))
overlay.pull_request('{0}\n{1}'.format(delta, missing_deps), distro)
except Exception as e:
err('Failed to file PR with allenh1/meta-ros repo!')
err(' Exception: {0}'.format(e))
Expand Down Expand Up @@ -163,5 +163,5 @@ def main():

# Commit changes and file pull request
overlay.commit_changes(args.ros_distro)
file_pr(overlay, delta, missing_deps)
file_pr(overlay, delta, missing_deps, args.ros_distro)
ok('Successfully synchronized repositories!')
10 changes: 7 additions & 3 deletions superflore/repo_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,14 @@ def rebase(self, target):
"""
self.git.rebase(i=target)

def pull_request(self, message, title):
def pull_request(self, message, title, branch='master', remote='origin'):
info('Filing pull-request...')
self.git.pull_request(m='{0}'.format(message),
title='{0}'.format(title))
self.git.pull_request(
m='{0}'.format(message),
title='{0}'.format(title),
target_branch='{0}'.format(branch),
target_remote='{0}'.format(remote),
)
ok('Successfully filed a pull request.')


Expand Down

0 comments on commit e46b2e5

Please sign in to comment.