diff --git a/.dvc/.gitignore b/.dvc/.gitignore index 0e30536ff..a53edd2f3 100644 --- a/.dvc/.gitignore +++ b/.dvc/.gitignore @@ -5,4 +5,6 @@ config.local updater cache state -state.lock \ No newline at end of file +state.lock +state-journal +state-wal diff --git a/dvc/project.py b/dvc/project.py index ca6ecebee..797060264 100644 --- a/dvc/project.py +++ b/dvc/project.py @@ -131,10 +131,12 @@ class Project(object): shutil.rmtree(self.dvc_dir) def _ignore(self): - flist = [self.state.state_file, - self.lock.lock_file, - self.config.config_local_file, - self.updater.updater_file] + flist = [ + self.state.state_file, + self.lock.lock_file, + self.config.config_local_file, + self.updater.updater_file, + ] + self.state.temp_files if self.cache.local.cache_dir.startswith(self.root_dir): flist += [self.cache.local.cache_dir] diff --git a/dvc/state.py b/dvc/state.py index dcb95c34b..cdf62d527 100644 --- a/dvc/state.py +++ b/dvc/state.py @@ -57,6 +57,13 @@ class State(object): return self.state_file = os.path.join(self.dvc_dir, self.STATE_FILE) + + # https://www.sqlite.org/tempfiles.html + self.temp_files = [ + self.state_file + '-journal', + self.state_file + '-wal', + ] + self.db = None self.c = None self.inserts = 0