From 31ccc19ba3f1f5c05a8133ab1bf2ec86dba9ed77 Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Thu, 16 Feb 2017 12:17:13 -0800 Subject: [PATCH] Encode the 'local hooks repo' version into the store --- pre_commit/constants.py | 2 ++ pre_commit/store.py | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/pre_commit/constants.py b/pre_commit/constants.py index 387bcd69..3f81c802 100644 --- a/pre_commit/constants.py +++ b/pre_commit/constants.py @@ -17,6 +17,8 @@ YAML_DUMP_KWARGS = { # Bump when installation changes in a backwards / forwards incompatible way INSTALLED_STATE_VERSION = '1' +# Bump when modifying `empty_template` +LOCAL_REPO_VERSION = '1' VERSION = pkg_resources.get_distribution('pre-commit').version VERSION_PARSED = pkg_resources.parse_version(VERSION) diff --git a/pre_commit/store.py b/pre_commit/store.py index 3f24d0b0..67564483 100644 --- a/pre_commit/store.py +++ b/pre_commit/store.py @@ -9,6 +9,7 @@ import tempfile from cached_property import cached_property +import pre_commit.constants as C from pre_commit.prefixed_command_runner import PrefixedCommandRunner from pre_commit.util import clean_path_on_failure from pre_commit.util import cmd_output @@ -129,7 +130,7 @@ class Store(object): def make_local_strategy(directory): copy_tree_to_path(resource_filename('empty_template'), directory) return self._new_repo( - 'local:{}'.format(','.join(sorted(deps))), 'N/A', + 'local:{}'.format(','.join(sorted(deps))), C.LOCAL_REPO_VERSION, make_local_strategy, )