mv: fix invalid numbered backup path#6119
Conversation
f38fc1b to
d4bc4cd
Compare
d4bc4cd to
8d5334a
Compare
|
Could you please add an highlevel integration test in https://github.com/uutils/coreutils/blob/main/tests/by-util/test_mv.rs ? thanks |
8d5334a to
5f2f7dc
Compare
|
@sylvestre I have added integration test. |
|
GNU testsuite comparison: |
|
@sylvestre @tertsdiepraam Is there anything else I need to do if I want this PR to be merged? |
| let test_path = Path::new(test_path_str); | ||
| let file_name = path.file_name().unwrap_or_default(); | ||
| let mut numbered_file_name = file_name.to_os_string(); | ||
| numbered_file_name.push(".~1~"); |
There was a problem hiding this comment.
can it be incremental ? like .2, .3, etc
There was a problem hiding this comment.
I'm trying to keep the logic the same as before. I think this just checks if the numbered backup exists. Only checking for '.1' is enough. If it exists, then we're still using the numbered backup, else we're using simple backup.
There was a problem hiding this comment.
ping ?
sorry, English isn't my native language. What does "ping" mean?
There was a problem hiding this comment.
sorry, if you are still working on it :)
There was a problem hiding this comment.
Is there anything else I need to do next?
There was a problem hiding this comment.
I've noticed that there are some compilation errors being reported currently. If you intend to merge this PR, I can go and handle them.
There was a problem hiding this comment.
please don't share screenshot, it is terrible for search and accessibility :)
(and it is fine, it is an intermittent issue)
5f2f7dc to
9e4566b
Compare
9e4566b to
4b7b26f
Compare
|
GNU testsuite comparison: |
There was a problem hiding this comment.
| match path.file_name() { | |
| Some(file_name) => { | |
| let mut file_name = file_name.to_os_string(); | |
| file_name.push(suffix); | |
| path.with_file_name(file_name) | |
| } | |
| None => path.with_file_name(suffix), | |
| } | |
| let mut file_name = path.file_name().unwrap_or_default().to_os_string(); | |
| file_name.push(suffix); | |
| path.with_file_name(file_name) |
4b7b26f to
d32823a
Compare
|
GNU testsuite comparison: |
d32823a to
6b32c30
Compare
|
GNU testsuite comparison: |
see #6040 (comment)
the gnu mv:
the uu_mv: