1
0
mirror of https://github.com/golang/go synced 2024-11-22 06:24:38 -07:00

codereview: fix clpatch

I love Python.  Write once, crash anywhere.

TBR=r
CC=golang-dev
https://golang.org/cl/4382043
This commit is contained in:
Russ Cox 2011-04-07 13:06:02 -04:00
parent 710028d3a4
commit 88bbf4f1df

View File

@ -1333,16 +1333,16 @@ def reposetup(ui, repo):
def CheckContributor(ui, repo, user=None): def CheckContributor(ui, repo, user=None):
set_status("checking CONTRIBUTORS file") set_status("checking CONTRIBUTORS file")
if not user:
user = ui.config("ui", "username")
if not user:
raise util.Abort("[ui] username is not configured in .hgrc")
_, userline = FindContributor(ui, repo, user, warn=False) _, userline = FindContributor(ui, repo, user, warn=False)
if not userline: if not userline:
raise util.Abort("cannot find %s in CONTRIBUTORS" % (user,)) raise util.Abort("cannot find %s in CONTRIBUTORS" % (user,))
return userline return userline
def FindContributor(ui, repo, user, warn=True): def FindContributor(ui, repo, user=None, warn=True):
if not user:
user = ui.config("ui", "username")
if not user:
raise util.Abort("[ui] username is not configured in .hgrc")
user = user.lower() user = user.lower()
m = re.match(r".*<(.*)>", user) m = re.match(r".*<(.*)>", user)
if m: if m: