def teardown(self, repo, hook): """Remove hooks infrastructure.""" rc_path = os.path.join(repo, ".hg", "hgrc") if not os.path.exists(rc_path): return if HookAPI.teardown(self, repo, hook): parser = ConfigParser() parser.read([rc_path]) section = "hooks" if parser.has_option(section, hook) and parser.get(section, hook) == self.hook_path(repo, hook): parser.remove_option(section, hook) return True