mirror of https://github.com/golang/go.git
codereview: abort 'hg commit' before entering commit message.
Hook pre-commit runs before 'hg commit' command whereas hook precommit runs after the user has entered commit message. LGTM=rsc R=rsc CC=golang-codereviews https://golang.org/cl/106320043
This commit is contained in:
parent
9a8a20bdb8
commit
09a9ef6115
|
|
@ -2289,6 +2289,10 @@ codereview_init = False
|
||||||
def uisetup(ui):
|
def uisetup(ui):
|
||||||
global testing
|
global testing
|
||||||
testing = ui.config("codereview", "testing")
|
testing = ui.config("codereview", "testing")
|
||||||
|
# Disable the Mercurial commands that might change the repository.
|
||||||
|
# Only commands in this extension are supposed to do that.
|
||||||
|
ui.setconfig("hooks", "pre-commit.codereview", precommithook) # runs before 'hg commit'
|
||||||
|
ui.setconfig("hooks", "precommit.codereview", precommithook) # catches all cases
|
||||||
|
|
||||||
def reposetup(ui, repo):
|
def reposetup(ui, repo):
|
||||||
global codereview_disabled
|
global codereview_disabled
|
||||||
|
|
@ -2338,10 +2342,6 @@ def reposetup(ui, repo):
|
||||||
InstallMatch(ui, repo)
|
InstallMatch(ui, repo)
|
||||||
RietveldSetup(ui, repo)
|
RietveldSetup(ui, repo)
|
||||||
|
|
||||||
# Disable the Mercurial commands that might change the repository.
|
|
||||||
# Only commands in this extension are supposed to do that.
|
|
||||||
ui.setconfig("hooks", "precommit.codereview", precommithook)
|
|
||||||
|
|
||||||
# Rollback removes an existing commit. Don't do that either.
|
# Rollback removes an existing commit. Don't do that either.
|
||||||
global real_rollback
|
global real_rollback
|
||||||
real_rollback = repo.rollback
|
real_rollback = repo.rollback
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue