From f4bcc0704b751419e628957e8cf34cf184d29b7b Mon Sep 17 00:00:00 2001 From: Shenghou Ma Date: Tue, 21 Feb 2012 16:10:48 -0500 Subject: codereview: add submit message support for newer clone URL and subrepos R=golang-dev, rsc CC=golang-dev http://codereview.appspot.com/5689063 Committer: Russ Cox --- lib/codereview/codereview.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/codereview/codereview.py b/lib/codereview/codereview.py index 6f5b8d590..1f4952f17 100644 --- a/lib/codereview/codereview.py +++ b/lib/codereview/codereview.py @@ -1949,9 +1949,17 @@ def submit(ui, repo, *pats, **opts): # We're committed. Upload final patch, close review, add commit message. changeURL = hg_node.short(node) 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: - 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: print >>sys.stderr, "URL: ", url pmsg = "*** Submitted as " + changeURL + " ***\n\n" + message -- cgit v1.2.1