Skip to content

Commit

Permalink
output: use path instead of relpath (#9673)
Browse files Browse the repository at this point in the history
Relpath might not exist (e.g. on windows between different drives),
we should just use path as is and not get too fancy with the ui,
unless we want to constantly keep ValueError in mind when using
relpath for ui needs all over the place.

These operations should use index, where we always have current
directory and relative paths, so the ui will change accordingly
anyway.
  • Loading branch information
efiop authored Jun 29, 2023
1 parent 910c232 commit 6e6d925
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions dvc/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -1279,7 +1279,7 @@ def unstage(self, path: str) -> Tuple["Meta", "Tree"]:
raise FileNotFoundError( # noqa: B904
errno.ENOENT,
os.strerror(errno.ENOENT),
self.fs.path.relpath(path),
path,
)

new = tree.from_trie(trie)
Expand Down Expand Up @@ -1402,8 +1402,7 @@ def add( # noqa: C901
otransfer(staging, self.cache, {obj.hash_info}, hardlink=relink, shallow=False)

if relink:
rel = self.fs.path.relpath(path)
with CheckoutCallback(desc=f"Checking out {rel}", unit="files") as callback:
with CheckoutCallback(desc="Checking out {path}", unit="files") as callback:
self._checkout(
path,
self.fs,
Expand Down

0 comments on commit 6e6d925

Please sign in to comment.