FAQ
Reviewers: golang-dev_googlegroups.com,

Message:
Hello golang-dev@googlegroups.com (cc: golang-dev@googlegroups.com),

I'd like you to review this change to
https://code.google.com/p/go/


Description:
codereview: more mercurial interface fixes
Fixes issue 4131.

Please review this at http://codereview.appspot.com/6614061/

Affected files:
M lib/codereview/codereview.py


Index: lib/codereview/codereview.py
===================================================================
--- a/lib/codereview/codereview.py
+++ b/lib/codereview/codereview.py
@@ -1794,7 +1794,7 @@

cl, err = CommandLineCL(ui, repo, pats, opts, defaultcc=defaultcc)
if err != "":
- return err
+ raise hg_util.Abort(err)
cl.Upload(ui, repo, gofmt_just_warn=True)
if not cl.reviewer:
# If no reviewer is listed, assign the review to defaultcc.
@@ -1802,15 +1802,15 @@
# codereview.appspot.com/user/defaultcc
# page, so that it doesn't get dropped on the floor.
if not defaultcc:
- return "no reviewers listed in CL"
+ raise hg_util.Abort("no reviewers listed in CL")
cl.cc = Sub(cl.cc, defaultcc)
cl.reviewer = defaultcc
cl.Flush(ui, repo)

if cl.files == []:
- return "no changed files, not sending mail"
-
- cl.Mail(ui, repo)
+ raise hg_util.Abort("no changed files, not sending mail")
+
+ cl.Mail(ui, repo)

#######################################################################
# hg p / hg pq / hg ps / hg pending
@@ -1851,7 +1851,7 @@
ui.write(cl.PendingText(quick=quick) + "\n")

if short:
- return
+ return 0
files = DefaultFiles(ui, repo, [])
if len(files) > 0:
s = "Changed files not in any CL:\n"
@@ -1883,7 +1883,7 @@

cl, err = CommandLineCL(ui, repo, pats, opts, defaultcc=defaultcc)
if err != "":
- return err
+ raise hg_util.Abort(err)

user = None
if cl.copied_from:
@@ -1902,10 +1902,10 @@
about += "CC=" + JoinComma([CutDomain(s) for s in cl.cc]) + "\n"

if not cl.reviewer:
- return "no reviewers listed in CL"
+ raise hg_util.Abort("no reviewers listed in CL")

if not cl.local:
- return "cannot submit non-local CL"
+ raise hg_util.Abort("cannot submit non-local CL")

# upload, to sync current patch and also get change number if CL is new.
if not cl.copied_from:
@@ -1940,7 +1940,7 @@
ret = hg_commit(ui, repo, *['path:'+f for f in cl.files],
message=message, user=userline)
commit_okay = False
if ret:
- return "nothing changed"
+ raise hg_util.Abort("nothing changed")
node = repo["-1"].node()
# push to remote; if it fails for any reason, roll back
try:
@@ -1993,7 +1993,7 @@
err = hg_clean(repo, "default")
if err:
return err
- return None
+ return 0

#######################################################################
# hg sync
@@ -2047,7 +2047,7 @@
ui.warn("CL %s has no files; delete (abandon) with hg change
-d %s\n" % (cl.name, cl.name))
else:
ui.warn("CL %s has no files; delete locally with hg change -D %s\n" %
(cl.name, cl.name))
- return
+ return 0

#######################################################################
# hg upload
@@ -2064,12 +2064,12 @@
repo.ui.quiet = True
cl, err = LoadCL(ui, repo, name, web=True)
if err != "":
- return err
+ raise hg_util.Abort(err)
if not cl.local:
- return "cannot upload non-local change"
+ raise hg_util.Abort("cannot upload non-local change")
cl.Upload(ui, repo)
print "%s%s\n" % (server_url_base, cl.name)
- return
+ return 0

#######################################################################
# Table of commands, supplied to Mercurial for installation.

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-dev @
categoriesgo
postedOct 7, '12 at 6:15p
activeOct 7, '12 at 8:48p
posts3
users2
websitegolang.org

2 users in discussion

Minux Ma: 2 posts Russ Cox: 1 post

People

Translate

site design / logo © 2022 Grokbase