def uisetup(ui):
global 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):
global codereview_disabled
InstallMatch(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.
global real_rollback
real_rollback = repo.rollback