opista / svn-blamer

📝 SVN Blamer - A VS Code extension to visually SVN-blame your code
https://marketplace.visualstudio.com/items?itemName=beaugust.blamer-vs
MIT License
18 stars 11 forks source link

Stop errors when file is not in SVN #482

Closed DanFreed closed 5 months ago

DanFreed commented 5 months ago

The blamer will throw an error in VSCode whenever "Auto blame" is enabled and you open a file that is not in SVN.

It will pop-up a message that says "SVN Blamer: something went wrong"

In the extension output it shows:

2024-03-29 14:57:26.577 [info] Blaming file {"fileName":"/var/folders/k3/j45fr5c54tv6c4hhqj3ptp1c0000gq/T/code-stdin-Xfu"} 2024-03-29 14:54:16.025 [warning] File is not a working copy, cannot complete action 2024-03-29 14:54:16.025 [error] Blame action failed {"err":"File is not a working copy"}

The blamer shouldn't bother with trying to do a blame if the file is not in SVN.

That file was created when piping output from STDOUT to "/usr/local/bin/code -"

metacurb commented 5 months ago

Thanks @DanFreed. I think it actually makes sense for the blame to still be performed, as it's not much different from calling a different svn command and getting an error.

However, I've put up a PR to silently fail when auto-blaming files that aren't working copies, and then record the failure so that we don't retry. Manually triggering a blame will still show the error message.