output: use path instead of relpath (#9673)

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.
This commit is contained in:
Ruslan Kuprieiev
2023-06-29 14:52:49 +03:00
committed by GitHub
parent 910c232077
commit 6e6d9253d6
+2 -3
View File
@@ -1279,7 +1279,7 @@ class Output:
raise FileNotFoundError( # noqa: B904
errno.ENOENT,
os.strerror(errno.ENOENT),
self.fs.path.relpath(path),
path,
)
new = tree.from_trie(trie)
@@ -1402,8 +1402,7 @@ class Output:
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,