Merge pull request #2405 from efiop/master

dvc: remove unused code
This commit is contained in:
Ruslan Kuprieiev
2019-08-18 05:56:16 +03:00
committed by GitHub
3 changed files with 3 additions and 27 deletions
+1 -7
View File
@@ -104,8 +104,7 @@ class OutputBase(object):
if remote:
parsed = urlparse(path)
return remote.path_info / parsed.path.lstrip("/")
else:
return self.REMOTE.path_cls(path)
return self.REMOTE.path_cls(path)
def __repr__(self):
return "{class_name}: '{def_path}'".format(
@@ -138,11 +137,6 @@ class OutputBase(object):
def dir_cache(self):
return self.cache.get_dir_cache(self.checksum)
def assign_to_stage_file(self, target_repo):
raise DvcException(
"change repo is not supported for {}".format(self.scheme)
)
@classmethod
def supported(cls, url):
return cls.REMOTE.supported(url)
-14
View File
@@ -47,20 +47,6 @@ class OutputLOCAL(OutputBase):
def_scheme = urlparse(self.def_path).scheme
return def_scheme != "remote" and not os.path.isabs(self.def_path)
def assign_to_stage_file(self, stage):
from dvc.repo import Repo
# Make path info the same but relative to passed stage
rel_path = self.path_info.relpath(self.stage.wdir)
self.path_info = (
self.REMOTE.path_cls(os.path.abspath(stage.wdir)) / rel_path
)
self.repo = Repo(self.fspath)
self.stage = stage
return self
def dumpd(self):
ret = super(OutputLOCAL, self).dumpd()
if self.is_in_repo:
+2 -6
View File
@@ -114,12 +114,8 @@ class Git(Base):
)
return False
def ignore(self, path, in_curr_dir=False):
base_dir = (
os.path.realpath(os.curdir)
if in_curr_dir
else os.path.dirname(path)
)
def ignore(self, path):
base_dir = os.path.dirname(path)
entry, gitignore = self._get_gitignore(path, base_dir)
if self._ignored(entry, gitignore):