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) ...@@ -17,12 +17,15 @@ command = registrar.command(cmdtable)
def cmd(description, *args, **kwargs): def cmd(description, *args, **kwargs):
print(description) print(description)
if "quiet" in kwargs:
quiet = kwargs.pop("quiet")
try: try:
kwargs["stderr"] = STDOUT kwargs["stderr"] = STDOUT
check_output(*args, **kwargs) check_output(*args, **kwargs)
except CalledProcessError as ex: except CalledProcessError as ex:
print(ex.output).strip() if not quiet:
print("Command exited with code %d" % ex.returncode) print(ex.output).strip()
print("Command exited with code %d" % ex.returncode)
raise raise
...@@ -108,11 +111,15 @@ def _ghpull(git_repo): ...@@ -108,11 +111,15 @@ def _ghpull(git_repo):
git_pull_master(git_repo) git_pull_master(git_repo)
for branch in branches.splitlines(): for branch in branches.splitlines():
if branch != "master": if branch != "master":
cmd( try:
"Fetching branch %s from remote Git fork repository" % branch, cmd(
["git", "fetch", "origin", "%s:%s" % (branch, branch)], "Fetching branch %s from remote Git fork repository" % branch,
cwd=git_repo, ["git", "fetch", "origin", "%s:%s" % (branch, branch)],
) cwd=git_repo,
quiet=True,
)
except CalledProcessError:
print("Couldn't fetch remote branch, ignoring")
hg_pull() 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