Commit 41a271fd authored by Georges Racinet's avatar Georges Racinet 🦑
Browse files

convert-pull-local: lint

parent b1bbec73abab
#!/usr/bin/env python3
import argparse
import os
import time
from subprocess import Popen, PIPE, check_call, check_output
......@@ -21,4 +20,5 @@
cl_args = parser.parse_args()
def is_branch_to_pull(branch_name):
......@@ -24,10 +24,11 @@
def is_branch_to_pull(branch_name):
if not branch_name.endswith(STABLE_BRANCH_SUFFIX):
return False
prefix = cl_args.branch_prefix
if prefix is not None:
return branch_name.startswith(prefix)
return True
if not branch_name.endswith(STABLE_BRANCH_SUFFIX):
return False
prefix = cl_args.branch_prefix
if prefix is not None:
return branch_name.startswith(prefix)
return True
heptapod_repo, gitlab_repo = cl_args.heptapod_repo, cl_args.gitlab_repo
......@@ -31,7 +32,8 @@
heptapod_repo, gitlab_repo = cl_args.heptapod_repo, cl_args.gitlab_repo
git_branches = check_output(('git', '-C', gitlab_repo, 'branch')).decode().splitlines()
git_branches = check_output(('git', '-C', gitlab_repo, 'branch')
).decode().splitlines()
git_branches = [b.strip() for b in git_branches]
stable_branches = [(extract_stable_branch_version(br), br)
for br in git_branches if is_branch_to_pull(br)]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment