Commit b6c98b2f authored by Elouan Martinet's avatar Elouan Martinet
Browse files

Continue pulling when a remote branch doesn't exist

parent 29215555b91e
......@@ -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()
......
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