jj/lib
Yuya Nishihara c6df0ba4c3 file_util: don't try to overwrite existing content-addressed file on Windows
The doc says persist() replaces the destination file as rename() would do
on Unix. persist_noclobber() doesn't, and is probably more reliable on Windows.
I don't know if persist() is completely atomic on Windows, but if it isn't, it
might be the source of the "permission denied" error under highly contended
situation.

https://docs.rs/tempfile/latest/tempfile/struct.NamedTempFile.html#method.persist
https://github.com/Stebalien/tempfile/blob/v3.8.0/src/file/imp/windows.rs#L77

We could use persist_noclobber() on all platforms, but it's more involved on
Unix.

https://github.com/Stebalien/tempfile/blob/v3.8.0/src/file/imp/unix.rs#L107
2023-12-17 08:20:07 +09:00
..
benches cargo: rename crates from jujutsu/jujutsu-lib to jj-cli/jj-lib 2023-07-09 06:40:43 +02:00
gen-protos Use { workspace = true } to appease VS Code's Cargo.toml parser 2023-08-22 21:38:53 -07:00
src file_util: don't try to overwrite existing content-addressed file on Windows 2023-12-17 08:20:07 +09:00
tests index: add 'static version of evaluate_revset() to ReadonlyIndex 2023-12-15 16:10:28 +09:00
testutils transaction: take description at end instead of start 2023-12-13 08:12:49 -08:00
Cargo.toml cargo: add ref-cast dependency 2023-11-26 18:21:40 +09:00
LICENSE cargo: add LICENSE file to each crate we publish 2023-09-22 21:48:28 -07:00