1
0
mirror of https://github.com/golang/go synced 2024-11-21 11:24:39 -07:00

codereview: show LGTMs in hg p

Shows first line of any response that the codereview server
has identified as an LGTM.  Example output below.

5305046:
        big: update for fmt interface changes

        Nothing terribly interesting here.

        Reviewer: gri@golang.org
                gri: LGTM
        CC: golang-dev@googlegroups.com
        Files:
                src/pkg/big/int.go
                src/pkg/big/nat.go
                src/pkg/big/nat_test.go
                src/pkg/big/rat.go

5307044:
        exp/template/html: use rune

        Nothing terribly interesting here.

        Reviewer: mikesamuel@gmail.com, nigeltao@golang.org
                mikesamuel: I don't see a type def for rune.  Assuming that's a new intrinsic, LGTM.
        CC: golang-dev@googlegroups.com
        Files:
                src/pkg/exp/template/html/css.go
                src/pkg/exp/template/html/css_test.go
                src/pkg/exp/template/html/html.go
                src/pkg/exp/template/html/js.go

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5297045
This commit is contained in:
Russ Cox 2011-10-19 15:08:33 -04:00
parent 35b2bfc8da
commit c0523e1db9

View File

@ -230,6 +230,7 @@ class CL(object):
self.copied_from = None # None means current user
self.mailed = False
self.private = False
self.lgtm = []
def DiskText(self):
cl = self
@ -282,6 +283,8 @@ class CL(object):
if cl.copied_from:
s += "\tAuthor: " + cl.copied_from + "\n"
s += "\tReviewer: " + JoinComma(cl.reviewer) + "\n"
for (who, line) in cl.lgtm:
s += "\t\t" + who + ": " + line + "\n"
s += "\tCC: " + JoinComma(cl.cc) + "\n"
s += "\tFiles:\n"
for f in cl.files:
@ -554,6 +557,13 @@ def LoadCL(ui, repo, name, web=True):
cl.url = server_url_base + name
cl.web = True
cl.private = d.get('private', False) != False
cl.lgtm = []
for m in d.get('messages', []):
if m.get('approval', False) == True:
who = re.sub('@.*', '', m.get('sender', ''))
text = re.sub("\n(.|\n)*", '', m.get('text', ''))
cl.lgtm.append((who, text))
set_status("loaded CL " + name)
return cl, ''