Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
93f614ff
Commit
93f614ff
authored
Jun 30, 2010
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
codereview: allow multiple email addresses in CONTRIBUTORS
R=r CC=golang-dev
https://golang.org/cl/1650041
parent
ae330328
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
17 deletions
+33
-17
lib/codereview/codereview.py
lib/codereview/codereview.py
+33
-17
No files found.
lib/codereview/codereview.py
View file @
93f614ff
...
...
@@ -101,6 +101,7 @@ if __name__ == "__main__":
server
=
"codereview.appspot.com"
server_url_base
=
None
defaultcc
=
None
contributors
=
{}
#######################################################################
# Change list parsing.
...
...
@@ -1021,22 +1022,17 @@ def CheckContributor(ui, repo, user=None):
return
userline
def
FindContributor
(
ui
,
repo
,
user
,
warn
=
True
):
try
:
f
=
open
(
repo
.
root
+
'/CONTRIBUTORS'
,
'r'
)
except
:
raise
util
.
Abort
(
"cannot open %s: %s"
%
(
repo
.
root
+
'/CONTRIBUTORS'
,
ExceptionDetail
()))
for
line
in
f
.
readlines
():
line
=
line
.
rstrip
()
if
line
.
startswith
(
'#'
):
continue
match
=
re
.
match
(
r"(.*) <(.*)>"
,
line
)
if
not
match
:
continue
if
line
==
user
or
match
.
group
(
2
).
lower
()
==
user
.
lower
():
return
match
.
group
(
2
),
line
if
warn
:
ui
.
warn
(
"warning: cannot find %s in CONTRIBUTORS
\
n
"
%
(
user
,))
return
None
,
None
m
=
re
.
match
(
r".*<(.*)>"
,
user
)
if
m
:
user
=
m
.
group
(
1
).
lower
()
if
user
not
in
contributors
:
if
warn
:
ui
.
warn
(
"warning: cannot find %s in CONTRIBUTORS
\
n
"
%
(
user
,))
return
None
,
None
user
,
email
=
contributors
[
user
]
return
email
,
"%s <%s>"
%
(
user
,
email
)
def
submit
(
ui
,
repo
,
*
pats
,
**
opts
):
"""submit change to remote repository
...
...
@@ -1615,7 +1611,7 @@ class opt(object):
pass
def RietveldSetup(ui, repo):
global defaultcc, upload_options, rpc, server, server_url_base, force_google_account, verbosity
global defaultcc, upload_options, rpc, server, server_url_base, force_google_account, verbosity
, contributors
# Read repository-specific options from lib/codereview/codereview.cfg
try:
...
...
@@ -1626,6 +1622,26 @@ def RietveldSetup(ui, repo):
except:
pass
try:
f = open(repo.root + '/CONTRIBUTORS', 'r')
except:
raise util.Abort("cannot open %s: %s" % (repo.root+'/CONTRIBUTORS', ExceptionDetail()))
for line in f:
# CONTRIBUTORS is a list of lines like:
# Person <email>
# Person <email> <alt-email>
# The first email address is the one used in commit logs.
if line.startswith('#'):
continue
m = re.match(r"([^<>]+
\
S)
\
s+(<[^<>
\
s]+>)((
\
s+<[^<>
\
s]+>)*)
\
s*$", line)
if m:
name = m.group(1)
email = m.group(2)[1:-1]
contributors[email.lower()] = (name, email)
for extra in m.group(3).split():
contributors[extra[1:-1].lower()] = (name, email)
# TODO(rsc): If the repository config has no codereview section,
# do not enable the extension. This allows users to
# put the extension in their global .hgrc but only
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment