diff --git a/dvc/output/base.py b/dvc/output/base.py index c887518be..8b55bd71f 100644 --- a/dvc/output/base.py +++ b/dvc/output/base.py @@ -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) diff --git a/dvc/output/local.py b/dvc/output/local.py index 13ae650f2..777ac3756 100644 --- a/dvc/output/local.py +++ b/dvc/output/local.py @@ -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: diff --git a/dvc/scm/git/__init__.py b/dvc/scm/git/__init__.py index 290ca5802..9c18b216e 100644 --- a/dvc/scm/git/__init__.py +++ b/dvc/scm/git/__init__.py @@ -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):