mirror of https://github.com/golang/go.git
codereview: protect against read-only upstream repository
R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/6742053
This commit is contained in:
parent
3e3fa7b5f1
commit
bcdb7926dd
|
|
@ -1951,7 +1951,8 @@ def submit(ui, repo, *pats, **opts):
|
||||||
|
|
||||||
# Push changes to remote. If it works, we're committed. If not, roll back.
|
# Push changes to remote. If it works, we're committed. If not, roll back.
|
||||||
try:
|
try:
|
||||||
hg_push(ui, repo)
|
if hg_push(ui, repo):
|
||||||
|
raise hg_util.Abort("push error")
|
||||||
except hg_error.Abort, e:
|
except hg_error.Abort, e:
|
||||||
if e.message.find("push creates new heads") >= 0:
|
if e.message.find("push creates new heads") >= 0:
|
||||||
# Remote repository had changes we missed.
|
# Remote repository had changes we missed.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue