Commit 7c2ff2b3 authored by Elouan Martinet's avatar Elouan Martinet
Browse files

Ignore hg push errors

It errors unexpectedly when no changes are found.

This case may happen when git push fails and command is ran again.
parent d576a0f5d81c
......@@ -133,10 +133,15 @@ def _gfpull(git_repo):
def _gfpush(git_repo, bookmark):
if bookmark == "master":
raise ValueError("Cannot push master branch")
cmd(
"Pushing bookmark to local Git repository",
["hg", "push", "-B", bookmark, "-f"],
)
try:
cmd(
"Pushing bookmark to local Git repository",
["hg", "push", "-B", bookmark, "-f"],
quiet=True,
)
except CalledProcessError:
# fails if no changes found
pass
# TODO use --force-with-lease if possible
cmd(
"Pushing Git branch to Git fork repository",
......
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