Commit 152bfa03 authored by Devon H. O'Dell's avatar Devon H. O'Dell Committed by Russ Cox

Pass ui into PostMessage to avoid nasty/confusing exception

R=rsc
https://golang.org/cl/155079
parent 0489a260
...@@ -702,7 +702,7 @@ def change(ui, repo, *pats, **opts): ...@@ -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): ...@@ -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): ...@@ -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 ...@@ -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.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment