Skip to content

Commit

Permalink
gitignore: Add temporary SQLite files (iterative#1322)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr. Outis authored Nov 14, 2018
1 parent 55eadba commit 88ed542
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
4 changes: 3 additions & 1 deletion .dvc/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ config.local
updater
cache
state
state.lock
state.lock
state-journal
state-wal
10 changes: 6 additions & 4 deletions dvc/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,12 @@ def destroy(self):
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]
Expand Down
7 changes: 7 additions & 0 deletions dvc/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,13 @@ def __init__(self, project, config):
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
Expand Down

0 comments on commit 88ed542

Please sign in to comment.