UnstableChanges

Summary

  1. FileReference>>versionNumber has a number of issues: (details)
Commit 52f68cfa970064b557c605f9ab17cb9840582f60 by akgrant0710
FileReference>>versionNumber has a number of issues:
- '/dev/shm/foo.bar.txt' asFileReference ensureCreateFile; nextVersion
-> "File @ /dev/shm/foo.1.txt" incorrectly changing the base file name.
- '/dev/shm/foo.bar' asFileReference nextVersion will cause a
primitiveFailure if there is a directory /dev/shm/foo.
- The method is quite inefficient as it requests a collection of all
children of the parent directory, which can be quite large.
There is also an issue that associated methods:
- #nextVersion
- #lastFileFor:extension:
- #nextNameFor:extension:
all do their own parsing of file names, resulting in duplicated code and
possible inconsistencies.
- Refactor the code to provide a single implementation of parsing the
file name for the version number and fix the three issues listed above.
- Extend automated tests to cover the issues listed above.
Fixes: #2753
The file was modifiedsrc/FileSystem-Core/FileReference.class.st (diff)
The file was modifiedsrc/FileSystem-Tests-Core/FileReferenceTest.class.st (diff)