zabel-xyz / local-history

local-history for vscode
MIT License
228 stars 36 forks source link

History path outside workspace - restore breaks with relative mode #116

Open anttin2020 opened 4 years ago

anttin2020 commented 4 years ago

I couldn't get it to work when history path is on Win-SSHFS drive (see #115) so I thought making the history path local of course fixes the problem. Sadly not.

I have local history path like this: D:/VSCode_history

The history versions work fine but restore is broken: Restore d:\VSCode_history.history\public_html\tvdb\tvdb_20200623090737.html failed. Error: Error: ENOENT: no such file or directory, copyfile 'd:\VSCode_history.history\public_html\tvdb\tvdb_20200623090737.html' -> 'D:\run\vscode\public_html:\tvdb\tvdb.html'

See the destination has ':' in the middle of the path! Where that comes from? :o And why it is trying to restore to VSCode directory tree and not the original workspace folder (n:\public_html\tvdb)? :o If I change to absolute paths, then it seems to work but occasionally I get timeout.

Any ideas? :)

Antti

anttin2020 commented 4 years ago

I confirm that this is bug in Local History, not SSHFS, the same happens with other SFTP drive tools. Using absolute mode is workaround but of course this should work relative as well.

zabel-xyz commented 4 years ago

Same as #85 ?

anttin2020 commented 4 years ago

yes seems so, at least very similar

mystiquewolf commented 3 years ago

For me it neither works with relative, not with absolute path.

Restore /home/lyubomir/Documents/Projects/vs code local history/.history/home/lyubomir/Documents/Projects/jobs-bg-crawler-python/main_20210827124221.py failed. Error: Error: ENOENT: no such file or directory, copyfile '/home/lyubomir/Documents/Projects/vs code local history/.history/home/lyubomir/Documents/Projects/jobs-bg-crawler-python/main_20210827124221.py' -> 'home/lyubomir/Documents/Projects/jobs-bg-crawler-python/main.py'
Restore /home/lyubomir/Documents/Projects/vs code local history/.history/jobs-bg-crawler-python/main_20210827103508.py failed. Error: Error: ENOENT: no such file or directory, copyfile '/home/lyubomir/Documents/Projects/vs code local history/.history/jobs-bg-crawler-python/main_20210827103508.py' -> 'jobs-bg-crawler-python/main.py'
sisrfeng commented 3 years ago

How about removing the space in path?

For me it neither works with relative, not with absolute path.

Restore /home/lyubomir/Documents/Projects/vs code local history/.history/home/lyubomir/Documents/Projects/jobs-bg-crawler-python/main_20210827124221.py failed. Error: Error: ENOENT: no such file or directory, copyfile '/home/lyubomir/Documents/Projects/vs code local history/.history/home/lyubomir/Documents/Projects/jobs-bg-crawler-python/main_20210827124221.py' -> 'home/lyubomir/Documents/Projects/jobs-bg-crawler-python/main.py'
Restore /home/lyubomir/Documents/Projects/vs code local history/.history/jobs-bg-crawler-python/main_20210827103508.py failed. Error: Error: ENOENT: no such file or directory, copyfile '/home/lyubomir/Documents/Projects/vs code local history/.history/jobs-bg-crawler-python/main_20210827103508.py' -> 'jobs-bg-crawler-python/main.py'
mystiquewolf commented 3 years ago

Thank you very much for the suggestion. Unfortunately it doesn't work. Neither with relative nor with absolute.

Restore /home/lyubomir/Documents/Projects/vs-code-local-history/.history/home/lyubomir/Documents/Projects/jobs-bg-crawler-python/main_20210827165629.py failed. Error: Error: ENOENT: no such file or directory, copyfile '/home/lyubomir/Documents/Projects/vs-code-local-history/.history/home/lyubomir/Documents/Projects/jobs-bg-crawler-python/main_20210827165629.py' -> 'home/lyubomir/Documents/Projects/jobs-bg-crawler-python/main.py'