Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
Upstream Conversion
Commits
41a271fd4db1
Commit
41a271fd
authored
Mar 13, 2021
by
Georges Racinet
🦑
Browse files
convert-pull-local: lint
parent
b1bbec73abab
Changes
1
Hide whitespace changes
Inline
Side-by-side
convert-pull-local.py
View file @
41a271fd
#!/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
)]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment