mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
codereview: die if initialized twice
If this happens, something is misconfigured. If we don't test for this explicitly, MatchAt ends up calling itself recursively forever. R=golang-dev, r CC=golang-dev https://golang.org/cl/5576066
This commit is contained in:
parent
79dc34413e
commit
ba31d662fe
1 changed files with 11 additions and 0 deletions
|
|
@ -2171,10 +2171,21 @@ def norollback(*pats, **opts):
|
||||||
"""(disabled when using this extension)"""
|
"""(disabled when using this extension)"""
|
||||||
raise hg_util.Abort("codereview extension enabled; use undo instead of rollback")
|
raise hg_util.Abort("codereview extension enabled; use undo instead of rollback")
|
||||||
|
|
||||||
|
codereview_init = False
|
||||||
|
|
||||||
def reposetup(ui, repo):
|
def reposetup(ui, repo):
|
||||||
global codereview_disabled
|
global codereview_disabled
|
||||||
global defaultcc
|
global defaultcc
|
||||||
|
|
||||||
|
global codereview_init
|
||||||
|
if codereview_init:
|
||||||
|
raise hg_util.Abort("codereview extension initialized twice")
|
||||||
|
codereview_init = True
|
||||||
|
|
||||||
|
remote = ui.config("paths", "default", "")
|
||||||
|
if remote.find("://") < 0:
|
||||||
|
raise hg_util.Abort("codereview: default path '%s' is not a URL" % (remote,))
|
||||||
|
|
||||||
# Read repository-specific options from lib/codereview/codereview.cfg or codereview.cfg.
|
# Read repository-specific options from lib/codereview/codereview.cfg or codereview.cfg.
|
||||||
root = ''
|
root = ''
|
||||||
try:
|
try:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue