Skip to content

Commit

Permalink
Add optional branch parameter to update-projects.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Jul 5, 2023
1 parent 1cff4db commit 18db62e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
8 changes: 5 additions & 3 deletions jaraco/develop/update-projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,15 @@ def handle_rename(old_name, new_name):
subprocess.check_call(['git', 'add', new_name])


def update_project(name, base):
def update_project(name, base, branch=None):
if set(name.tags) & {'fork', 'base'}:
return
print('\nupdating', name)
with temp_checkout(name):
if not is_skeleton():
return
proc = subprocess.Popen(['git', 'pull', base, '--no-edit'])
cmd = ['git', 'pull', base, branch, '--no-edit']
proc = subprocess.Popen(list(filter(None, cmd)))
code = proc.wait()
if code:
handle_rename('CHANGES.rst', 'NEWS.rst')
Expand All @@ -78,6 +79,7 @@ def main(
keyword: KeywordFilter = None, # type: ignore
tag: TagFilter = None, # type: ignore
base='gh://jaraco/skeleton',
branch=None,
):
update = functools.partial(update_project, base=base)
update = functools.partial(update_project, base=base, branch=branch)
consume(map(update, filter(tag, filter(keyword, git.projects()))))
1 change: 1 addition & 0 deletions newsfragments/+3e9d110c.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add optional branch parameter to update-projects.

0 comments on commit 18db62e

Please sign in to comment.