From 88ed542b94d5cc983511c16c89f479d938dd33a8 Mon Sep 17 00:00:00 2001 From: "Mr. Outis" Date: Tue, 13 Nov 2018 19:29:21 -0600 Subject: [PATCH] gitignore: Add temporary SQLite files (#1322) Fix #1319 --- .dvc/.gitignore | 4 +++- dvc/project.py | 10 ++++++---- dvc/state.py | 7 +++++++ 3 files changed, 16 insertions(+), 5 deletions(-) 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