summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2014-11-14 11:37:54 -0500
committerRuss Cox <rsc@golang.org>2014-11-14 11:37:54 -0500
commitf4110c2e9cc8f316e14f3a4a35789bc821b326bf (patch)
tree3a2b461d76cc134f7b71e5e1ef63bc37e7d25059 /lib
parent78d351d121615f1101f28f88920029f20884c689 (diff)
parent4664f7441b495d8fa8aa5001755cb5f85e790b19 (diff)
downloadgo-f4110c2e9cc8f316e14f3a4a35789bc821b326bf.tar.gz
[dev.garbage] all: merge default (f38460037b72) into dev.garbage
This is the revision that dev.cc is branched from. LGTM=austin R=austin CC=golang-codereviews https://codereview.appspot.com/169590043
Diffstat (limited to 'lib')
-rw-r--r--lib/codereview/codereview.cfg1
-rw-r--r--lib/codereview/codereview.py16
2 files changed, 12 insertions, 5 deletions
diff --git a/lib/codereview/codereview.cfg b/lib/codereview/codereview.cfg
index 2801ebf8d..43dbf3ce3 100644
--- a/lib/codereview/codereview.cfg
+++ b/lib/codereview/codereview.cfg
@@ -1 +1,2 @@
defaultcc: golang-codereviews@googlegroups.com
+contributors: http://go.googlecode.com/hg/CONTRIBUTORS
diff --git a/lib/codereview/codereview.py b/lib/codereview/codereview.py
index 416702c63..0c9b27a31 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:
@@ -3604,11 +3604,17 @@ class MercurialVCS(VersionControlSystem):
if use_hg_shell:
base_content = RunShell(["hg", "cat", "-r", base_rev, oldrelpath], silent_ok=True)
else:
- base_content = str(self.repo[base_rev][oldrelpath].data())
+ try:
+ base_content = str(self.repo[base_rev][oldrelpath].data())
+ except Exception:
+ pass
is_binary = "\0" in base_content # Mercurial's heuristic
if status != "R":
- new_content = open(relpath, "rb").read()
- is_binary = is_binary or "\0" in new_content
+ try:
+ new_content = open(relpath, "rb").read()
+ is_binary = is_binary or "\0" in new_content
+ except Exception:
+ pass
if is_binary and base_content and use_hg_shell:
# Fetch again without converting newlines
base_content = RunShell(["hg", "cat", "-r", base_rev, oldrelpath],