1
0
mirror of https://github.com/golang/go synced 2024-11-12 04:30:22 -07:00

Pass ui into PostMessage to avoid nasty/confusing exception

R=rsc
https://golang.org/cl/155079
This commit is contained in:
Devon H. O'Dell 2009-11-17 08:32:23 -08:00 committed by Russ Cox
parent 0489a260da
commit 152bfa03d8

View File

@ -702,7 +702,7 @@ def change(ui, repo, *pats, **opts):
if opts["delete"]: if opts["delete"]:
if cl.original_author: if cl.original_author:
return "original author must delete CL; hg change -D will remove locally" return "original author must delete CL; hg change -D will remove locally"
PostMessage(cl.name, "*** Abandoned ***", send_mail="checked") PostMessage(ui, cl.name, "*** Abandoned ***", send_mail="checked")
EditDesc(cl.name, closed="checked") EditDesc(cl.name, closed="checked")
cl.Delete(ui, repo) cl.Delete(ui, repo)
return return
@ -903,7 +903,7 @@ def mail(ui, repo, *pats, **opts):
pmsg += ",\n" pmsg += ",\n"
pmsg += "\n" pmsg += "\n"
pmsg += "I'd like you to review the following change.\n" pmsg += "I'd like you to review the following change.\n"
PostMessage(cl.name, pmsg, send_mail="checked", subject=cl.Subject()) PostMessage(ui, cl.name, pmsg, send_mail="checked", subject=cl.Subject())
def nocommit(ui, repo, *pats, **opts): def nocommit(ui, repo, *pats, **opts):
"""(disabled when using this extension)""" """(disabled when using this extension)"""
@ -1059,7 +1059,7 @@ def submit(ui, repo, *pats, **opts):
else: else:
print >>sys.stderr, "URL: ", url print >>sys.stderr, "URL: ", url
pmsg = "*** Submitted as " + changeURL + " ***\n\n" + opts['message'] pmsg = "*** Submitted as " + changeURL + " ***\n\n" + opts['message']
PostMessage(cl.name, pmsg, send_mail="checked") PostMessage(ui, cl.name, pmsg, send_mail="checked")
if not cl.original_author: if not cl.original_author:
EditDesc(cl.name, closed="checked") EditDesc(cl.name, closed="checked")
cl.Delete(ui, repo) cl.Delete(ui, repo)
@ -1517,7 +1517,7 @@ def PostMessage1(issue, message, reviewers=None, cc=None, send_mail=None, subjec
print response print response
sys.exit(2) sys.exit(2)
def PostMessage(issue, message, reviewers=None, cc=None, send_mail=None, subject=None): def PostMessage(ui, issue, message, reviewers=None, cc=None, send_mail=None, subject=None):
# When Rietveld is busy, it seems to throw off a lot of HTTP Error 500: Internal Server Error. # When Rietveld is busy, it seems to throw off a lot of HTTP Error 500: Internal Server Error.
# Rather than abort, sleep and try again. # Rather than abort, sleep and try again.
# Even if the second time fails, let the overall hg command keep going. # Even if the second time fails, let the overall hg command keep going.