Bugfix: dvc init

This commit is contained in:
Dmitry
2017-12-24 23:28:11 -08:00
parent 1987693f34
commit 01a37388d8
2 changed files with 12 additions and 6 deletions
+3
View File
@@ -86,6 +86,9 @@ class Project(object):
scm.ignore_list([cache.cache_dir,
state.state_file,
lock.lock_file])
ignore_file = os.path.join(dvc_dir, scm.ignore_file())
scm.add([config.config_file, ignore_file])
scm.commit('DVC init')
return Project(root_dir)
+9 -6
View File
@@ -17,15 +17,15 @@ class Base(object):
def ignore(self, path):
pass
def ignore_file(self):
pass
def ignore_list(self, p_list):
return [self.ignore(path) for path in p_list]
def add(self, path):
def add(self, paths):
pass
def add_list(self, p_list):
return [self.add(path) for path in p_list]
def commit(self, msg):
pass
@@ -67,8 +67,11 @@ class Git(Base):
open(gitignore, 'a').write('\n' + entry)
def add(self, path):
self.repo.index.add(path)
def ignore_file(self):
return self.GITIGNORE
def add(self, paths):
self.repo.index.add(paths)
def commit(self, msg):
self.repo.index.commit(msg)