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

Continue pulling when a remote branch doesn't exist

parent 29215555b91e
...@@ -17,10 +17,13 @@ command = registrar.command(cmdtable) ...@@ -17,10 +17,13 @@ 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:
if not quiet:
print(ex.output).strip() print(ex.output).strip()
print("Command exited with code %d" % ex.returncode) 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( cmd(
"Fetching branch %s from remote Git fork repository" % branch, "Fetching branch %s from remote Git fork repository" % branch,
["git", "fetch", "origin", "%s:%s" % (branch, branch)], ["git", "fetch", "origin", "%s:%s" % (branch, branch)],
cwd=git_repo, cwd=git_repo,
) )
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