Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
open-source
hggitforge
Commits
99dbf7c26ffc
Commit
b6c98b2f
authored
Oct 14, 2020
by
Elouan Martinet
Browse files
Continue pulling when a remote branch doesn't exist
parent
29215555b91e
Changes
1
Hide whitespace changes
Inline
Side-by-side
hggithub.py
View file @
99dbf7c2
...
...
@@ -17,12 +17,15 @@ command = registrar.command(cmdtable)
def
cmd
(
description
,
*
args
,
**
kwargs
):
print
(
description
)
if
"quiet"
in
kwargs
:
quiet
=
kwargs
.
pop
(
"quiet"
)
try
:
kwargs
[
"stderr"
]
=
STDOUT
check_output
(
*
args
,
**
kwargs
)
except
CalledProcessError
as
ex
:
print
(
ex
.
output
).
strip
()
print
(
"Command exited with code %d"
%
ex
.
returncode
)
if
not
quiet
:
print
(
ex
.
output
).
strip
()
print
(
"Command exited with code %d"
%
ex
.
returncode
)
raise
...
...
@@ -108,11 +111,15 @@ def _ghpull(git_repo):
git_pull_master
(
git_repo
)
for
branch
in
branches
.
splitlines
():
if
branch
!=
"master"
:
cmd
(
"Fetching branch %s from remote Git fork repository"
%
branch
,
[
"git"
,
"fetch"
,
"origin"
,
"%s:%s"
%
(
branch
,
branch
)],
cwd
=
git_repo
,
)
try
:
cmd
(
"Fetching branch %s from remote Git fork repository"
%
branch
,
[
"git"
,
"fetch"
,
"origin"
,
"%s:%s"
%
(
branch
,
branch
)],
cwd
=
git_repo
,
quiet
=
True
,
)
except
CalledProcessError
:
print
(
"Couldn't fetch remote branch, ignoring"
)
hg_pull
()
...
...
Write
Preview
Supports
Markdown
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