]> Cypherpunks repositories - gostls13.git/commitdiff
codereview: protect against read-only upstream repository
authorShenghou Ma <minux.ma@gmail.com>
Sat, 20 Oct 2012 09:23:48 +0000 (17:23 +0800)
committerShenghou Ma <minux.ma@gmail.com>
Sat, 20 Oct 2012 09:23:48 +0000 (17:23 +0800)
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6742053

lib/codereview/codereview.py

index 86373ccbfb33d03955c1219c9a161dffa59825c4..ede91fdaed502b6133bff02a1b2c47884f7e24be 100644 (file)
@@ -1951,7 +1951,8 @@ def submit(ui, repo, *pats, **opts):
 
                # Push changes to remote.  If it works, we're committed.  If not, roll back.
                try:
-                       hg_push(ui, repo)
+                       if hg_push(ui, repo):
+                               raise hg_util.Abort("push error")
                except hg_error.Abort, e:
                        if e.message.find("push creates new heads") >= 0:
                                # Remote repository had changes we missed.