Commit d86213c3 authored by Shenghou Ma's avatar Shenghou Ma Committed by Russ Cox

codereview: add submit message support for newer clone URL and subrepos

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5689063
parent e5013e89
...@@ -1949,9 +1949,17 @@ def submit(ui, repo, *pats, **opts): ...@@ -1949,9 +1949,17 @@ def submit(ui, repo, *pats, **opts):
# We're committed. Upload final patch, close review, add commit message. # We're committed. Upload final patch, close review, add commit message.
changeURL = hg_node.short(node) changeURL = hg_node.short(node)
url = ui.expandpath("default") url = ui.expandpath("default")
m = re.match("^https?://([^@/]+@)?([^.]+)\.googlecode\.com/hg/?", url) m = re.match("(^https?://([^@/]+@)?([^.]+)\.googlecode\.com/hg/?)" + "|" +
"(^https?://([^@/]+@)?code\.google\.com/p/([^/.]+)(\.[^./]+)?/?)", url)
if m: if m:
changeURL = "http://code.google.com/p/%s/source/detail?r=%s" % (m.group(2), changeURL) if m.group(1): # prj.googlecode.com/hg/ case
changeURL = "http://code.google.com/p/%s/source/detail?r=%s" % (m.group(3), changeURL)
elif m.group(4) and m.group(7): # code.google.com/p/prj.subrepo/ case
changeURL = "http://code.google.com/p/%s/source/detail?r=%s&repo=%s" % (m.group(6), changeURL, m.group(7)[1:])
elif m.group(4): # code.google.com/p/prj/ case
changeURL = "http://code.google.com/p/%s/source/detail?r=%s" % (m.group(6), changeURL)
else:
print >>sys.stderr, "URL: ", url
else: else:
print >>sys.stderr, "URL: ", url print >>sys.stderr, "URL: ", url
pmsg = "*** Submitted as " + changeURL + " ***\n\n" + message pmsg = "*** Submitted as " + changeURL + " ***\n\n" + message
......
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