philmasterplus
Active member
Edit on May 28th: This post has been rewritten to better summarize what is going on. To see the original post, check out the "spoiler" below.
There are two issues at play:
KoLmafia r20716 here, running under AdoptOpenJDK 11.0.10+9 on Windows 10.
If I run "svn update" and the commits move file(s) to a different subdirectory, the files in the working copy are moved correctly, but those in the local copy are not.
Since this is difficult to reproduce cleanly, I'll provide instructions instead of providing a repo link:
This can be fixed easily by moving the single file. However, my actual project has >20 files that need to be moved to multiple different subdirectories.
They are affected by this bug in varying degrees; some are moved, others are not.
Any ideas on how to handle this?
If I run "svn update" and the commits move file(s) to a different subdirectory, the files in the working copy are moved correctly, but those in the local copy are not.
Since this is difficult to reproduce cleanly, I'll provide instructions instead of providing a repo link:
- Create a new GitHub repository online. Let's say https://github.com/pastelmind/svn-update-repro
- Add a file in this repository:
scripts/foo/some-dummy-script.ash
. The contents of this file are unimportant.
Commit and push changes to the repo. - In KoLmafia, install this project:
svn checkout https://github.com/pastelmind/svn-update-repro/trunk
.- Result: A working copy is created under
<kolmafia dir>/svn/pastelmind-svn-update-repro-trunk/
.
KoLmafia also adds a local copy of my script at<kolmafia dir>/scripts/foo/some-dummy-script.ash
.
- Result: A working copy is created under
- Back to our repo, let's move the file to another dir: now it's in
scripts/bar/some-dummy-script.ash
Commit and push changes to the repo. - Back in KoLmafia, run
svn update
. The gCLI prints this:
Code:Validating repo... Repo validated. Updating pastelmind-svn-update-repro-trunk... C:\Users\Phil\Documents\KoL\svn\pastelmind-svn-update-repro-trunk A https://github.com/pastelmind/svn-update-repro/trunk/scripts/bar A https://github.com/pastelmind/svn-update-repro/trunk/scripts/bar/some-dummy-script.ash D C:\Users\Phil\Documents\KoL\svn\pastelmind-svn-update-repro-trunk\scripts\foo https://github.com/pastelmind/svn-update-repro/trunk/scripts https://github.com/pastelmind/svn-update-repro/trunk At revision 5
This is followed by a popup, to which I click "Yes":
Then KoLmafia prints out some more logs and completes:
Code:Pushing local updates... some-dummy-script.ash => C:\Users\Phil\Documents\KoL\scripts\foo\some-dummy-script.ash Done. Update log for pastelmind-svn-update-repro-trunk: ------ Commit r5: Author: pastelmind Move file to another dir ------ Requests complete.
- Results:
- In the working copy, the directory is successfully renamed: I have
<kolmafia dir>/svn/pastelmind-svn-update-repro-trunk/bar/some-dummy-script.ash
. - In the local copy, the file has not moved. It is still at
<kolmafia dir>/scripts/foo/some-dummy-script.ash
.
- In the working copy, the directory is successfully renamed: I have
This can be fixed easily by moving the single file. However, my actual project has >20 files that need to be moved to multiple different subdirectories.
They are affected by this bug in varying degrees; some are moved, others are not.
Any ideas on how to handle this?
There are two issues at play:
- When
svn checkout
orsvn update
results in the creation of a new file(s) underscripts/
orrelay/
(or any of their subdirectories), it searches recursively for a file with a matching name. If it finds a match, KoLmafia overwrites the matched file, instead of (re)creating the file in its intended location.
This causes file name collisions when two projects provide files with the same name, but in different subdirectories.
Note: As of r20743 KoLmafia will always write files to their correct paths when updating the local copy. - When
svn update
results in the deletion of an entire directory, KoLmafia does not delete the directory in the local copy, leaving the files behind.
This also occurs when an entire subdirectory is renamed or moved. Such a change may be represented by the remote Subversion repository as a pair of directory deletion and directory creation events. When updating the local copy, KoLmafia ignores the directory deletion event.
svn/
).
Last edited: