api: open scm controlled files (#2566)

* tree: make open method use mode and encoding

* api: try to open using self.tree if output not found

* repo: rename OutputMissingException

* test: api: test adding not cached output

* api: open: exists test instead of try

* repo: open: try opening from tree first

* repo: open: handle missing and not cached files

* repo: open: separate find out logic from opening
This commit is contained in:
Paweł Redzyński
2019-10-08 15:23:42 +03:00
committed by Ruslan Kuprieiev
parent 156fc9d4e1
commit d2f8cb0520
5 changed files with 65 additions and 21 deletions
+5 -4
View File
@@ -259,10 +259,11 @@ class ETagMismatchError(DvcException):
)
class OutputFileMissingError(DvcException):
def __init__(self, path):
super(OutputFileMissingError, self).__init__(
"Can't find {} neither locally nor on remote".format(path)
class FileMissingError(DvcException):
def __init__(self, path, cause=None):
super(FileMissingError, self).__init__(
"Can't find '{}' neither locally nor on remote".format(path),
cause=cause,
)