Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
open-source
hggitforge
Commits
b3f2542d2526
Commit
9e81abfe
authored
Oct 27, 2020
by
Elouan Martinet
Browse files
Add cmd_lines function which runs a command and returns output lines
parent
5eb388b58e67
Changes
1
Hide whitespace changes
Inline
Side-by-side
hggitforge/__init__.py
View file @
b3f2542d
...
...
@@ -29,6 +29,11 @@ def cmd(description, *args, **kwargs):
raise
def
cmd_lines
(
*
args
,
**
kwargs
):
output
=
check_output
(
*
args
,
**
kwargs
)
return
output
.
decode
(
"utf-8"
).
splitlines
()
def
git_clone
(
path_url
,
destination
):
cmd
(
"Cloning Git fork repository"
,
[
"git"
,
"clone"
,
path_url
,
destination
,
"--bare"
]
...
...
@@ -105,11 +110,11 @@ def _gfclone(git_fork_url, git_upstream_url, destination):
def
_gfpull
(
git_repo
):
branches
=
c
heck_output
(
branches
=
c
md_lines
(
[
"git"
,
"branch"
,
"--format=%(refname:lstrip=2)"
],
cwd
=
git_repo
)
git_pull_master
(
git_repo
)
for
branch
in
branches
.
decode
(
"utf-8"
).
splitlines
()
:
for
branch
in
branches
:
if
branch
!=
"master"
:
try
:
cmd
(
...
...
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