mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-02 07:18:25 +01:00
+1
-7
@@ -104,8 +104,7 @@ class OutputBase(object):
|
|||||||
if remote:
|
if remote:
|
||||||
parsed = urlparse(path)
|
parsed = urlparse(path)
|
||||||
return remote.path_info / parsed.path.lstrip("/")
|
return remote.path_info / parsed.path.lstrip("/")
|
||||||
else:
|
return self.REMOTE.path_cls(path)
|
||||||
return self.REMOTE.path_cls(path)
|
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return "{class_name}: '{def_path}'".format(
|
return "{class_name}: '{def_path}'".format(
|
||||||
@@ -138,11 +137,6 @@ class OutputBase(object):
|
|||||||
def dir_cache(self):
|
def dir_cache(self):
|
||||||
return self.cache.get_dir_cache(self.checksum)
|
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
|
@classmethod
|
||||||
def supported(cls, url):
|
def supported(cls, url):
|
||||||
return cls.REMOTE.supported(url)
|
return cls.REMOTE.supported(url)
|
||||||
|
|||||||
@@ -47,20 +47,6 @@ class OutputLOCAL(OutputBase):
|
|||||||
def_scheme = urlparse(self.def_path).scheme
|
def_scheme = urlparse(self.def_path).scheme
|
||||||
return def_scheme != "remote" and not os.path.isabs(self.def_path)
|
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):
|
def dumpd(self):
|
||||||
ret = super(OutputLOCAL, self).dumpd()
|
ret = super(OutputLOCAL, self).dumpd()
|
||||||
if self.is_in_repo:
|
if self.is_in_repo:
|
||||||
|
|||||||
@@ -114,12 +114,8 @@ class Git(Base):
|
|||||||
)
|
)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def ignore(self, path, in_curr_dir=False):
|
def ignore(self, path):
|
||||||
base_dir = (
|
base_dir = os.path.dirname(path)
|
||||||
os.path.realpath(os.curdir)
|
|
||||||
if in_curr_dir
|
|
||||||
else os.path.dirname(path)
|
|
||||||
)
|
|
||||||
entry, gitignore = self._get_gitignore(path, base_dir)
|
entry, gitignore = self._get_gitignore(path, base_dir)
|
||||||
|
|
||||||
if self._ignored(entry, gitignore):
|
if self._ignored(entry, gitignore):
|
||||||
|
|||||||
Reference in New Issue
Block a user