mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-10 07:18:27 +01:00
Merge pull request #281 from efiop/master
Read-only data files, small fixes
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import os
|
||||
import stat
|
||||
import shutil
|
||||
|
||||
from dvc.path.path import Path
|
||||
@@ -104,6 +105,6 @@ class DataItem(object):
|
||||
md5 = file_md5(self.data.relative)[0]
|
||||
self._cache_file = os.path.join(self.cache_dir, md5)
|
||||
self._git.modify_gitignore([self.data.relative])
|
||||
if os.path.isfile(self.cache.relative):
|
||||
return
|
||||
System.hardlink(self.data.relative, self.cache.relative)
|
||||
if not os.path.isfile(self.cache.relative):
|
||||
System.hardlink(self.data.relative, self.cache.relative)
|
||||
os.chmod(self.data.relative, stat.S_IREAD)
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ from dvc.path.data_item import DataItem, DataItemError, DataDirError
|
||||
from dvc.path.path import Path
|
||||
from dvc.path.stated_data_item import StatedDataItem
|
||||
from dvc.system import System
|
||||
|
||||
from dvc.logger import Logger
|
||||
|
||||
class PathFactory(object):
|
||||
def __init__(self, git, config):
|
||||
|
||||
@@ -7,7 +7,7 @@ from dvc.logger import Logger
|
||||
from dvc.path.data_item import DataDirError, DataItemInStatusDirError
|
||||
from dvc.path.stated_data_item import StatedDataItem
|
||||
from dvc.utils import cached_property
|
||||
|
||||
from dvc.config import ConfigI
|
||||
|
||||
class RepositoryChangeError(DvcException):
|
||||
def __init__(self, msg):
|
||||
@@ -116,7 +116,10 @@ class RepositoryChange(object):
|
||||
|
||||
def data_file_timesteps(self):
|
||||
res = set()
|
||||
for root, dirs, files in os.walk('.'):
|
||||
for root, dirs, files in os.walk(self._settings.git.git_dir_abs):
|
||||
if root.startswith(os.path.join(self._settings.git.git_dir_abs, ConfigI.CONFIG_DIR)):
|
||||
continue
|
||||
|
||||
for file in files:
|
||||
filename = os.path.join(root, file)
|
||||
if os.path.exists(filename):
|
||||
|
||||
Reference in New Issue
Block a user