summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2014-09-25 13:11:57 -0400
committerRuss Cox <rsc@golang.org>2014-09-25 13:11:57 -0400
commitaf282f0011cec87f3c9358c339bb63700b499b81 (patch)
tree40e97ac33b49a4177c0a88094460a6eddc25332f /lib
parentd6ea3759205d8d3346f3ffdc7b4ebe767cccea7f (diff)
downloadgo-git-af282f0011cec87f3c9358c339bb63700b499b81.tar.gz
[dev.garbage] lib/codereview: allow hg submit to commit new branch if CL description says so
This means I won't have to edit the plugin when I create the next dev branch. LGTM=r, adg R=r, adg CC=golang-codereviews https://golang.org/cl/148950045
Diffstat (limited to 'lib')
-rw-r--r--lib/codereview/codereview.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/codereview/codereview.py b/lib/codereview/codereview.py
index fdf11d1f48..876264584b 100644
--- a/lib/codereview/codereview.py
+++ b/lib/codereview/codereview.py
@@ -2024,13 +2024,13 @@ def submit(ui, repo, *pats, **opts):
# push to remote; if it fails for any reason, roll back
try:
new_heads = len(hg_heads(ui, repo).split())
- if old_heads != new_heads and not (old_heads == 0 and new_heads == 1):
+ if cl.desc.find("create new branch") < 0 and old_heads != new_heads and not (old_heads == 0 and new_heads == 1):
# Created new head, so we weren't up to date.
need_sync()
# Push changes to remote. If it works, we're committed. If not, roll back.
try:
- if hg_push(ui, repo):
+ if hg_push(ui, repo, new_branch=cl.desc.find("create new branch")>=0):
raise hg_util.Abort("push error")
except hg_error.Abort, e:
if e.message.find("push creates new heads") >= 0: