I propose to make FreeCAD respect symlinks, allow FreeCAD to open its own backup files, add an option like "File>Rollback..." to do that from a menu somewhere, and add an option for a backup directory.
I was snooping around #lowhangingfruit, and these got my attention. They encompass some brokenness, and touch on a minor issue I have.
issue #1666 Respect symbolic links
issue #1665 Allow setting higher value for number of backup files
I think it's within my skill set to fix this, if we can agree on what is broken and what the fix looks like.
Here's the version info that caused my opinion:
Code: Select all
OS: Ubuntu 16.04.3 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.11937 (Git)
Build type: Debug
Branch: master
Hash: 2751a3e8476c9b12d6982c7301bedd35a61fee4a
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.1.0
Locale: English/UnitedKingdom (en_GB)
The description in 1666 is not perfect, and I disagree slightly:
Let's do that and see what happens:issue #1666 wrote: 1.) Create new folder and save test .fcstd file in this folder
2.) Create symbolic link to test .fcstd file (ln -s) from different directory
2.) Open the file in FreeCAD by clicking on just created symbolic link
3.) Modify the file and save the changes
- Assume two directories ~/dir1 & ~/dir2
- Create file1.fcstd in dir1
- ln -s ~/dir1/file1.fcstd ~/dir2/link1.fcstd
Code: Select all
$ls -l dir* dir1: total 8 -rw-rw-r-- 1 owner group 7009 Sep 1 15:43 file1.fcstd dir2: total 0 lrwxrwxrwx 1 owner group 28 Sep 1 16:06 link1.fcstd -> /home/owner/dir1/file1.fcstd
- Open link1 in FreeCAD
- Save it
Code: Select all
$ ls -l dir* dir1: total 8 -rw-rw-r-- 1 owner group 7009 Sep 1 15:43 file1.fcstd dir2: total 8 -rw-rw-r-- 1 owner group 7023 Sep 1 16:09 link1.fcstd lrwxrwxrwx 1 owner group 28 Sep 1 16:06 link1.fcstd1 -> /home/owner/dir1/file1.fcstd
I think:issue #1666 wrote: Expected behaviour:
FreeCAD saves the changes at original test .fcstd file location. Backup files are saved to original test .fcstd file location.
Current behaviour:
FreeCAD saves the changes at symbolic link test .fcstd file location. Backup files are saved to symbolic link test .fcstd file location.
- Expected behaviour:
FreeCAD respects the link. The file is saved at the link destination, and creates a backup in the link directory.Code: Select all
$ ls -l dir* dir1: total 8 -rw-rw-r-- 1 owner group 7009 Sep 1 15:43 file1.fcstd dir2: total 8 -rw-rw-r-- 1 owner group 7023 Sep 1 16:09 link1.fcstd -> /home/owner/dir1/file1.fcstd lrwxrwxrwx 1 owner group 28 Sep 1 16:06 link1.fcstd1
- Current behaviour:
FreeCAD moves the original file to the backup, and saves a new file in the current directory:
In testing this, I noticed something else I hadn't expected: The most recent backup has the largest number. That is to say; .fcstd1 is older than .fcstd2; I can think of reasons it was implemented like this, but I find it odd from a user perspective. I might be alone in that though.
Also, it turns out that FreeCAD can't open its own backup files. That seems broken too. I have to rename the file to open it.
Something in issue #1665 caught my attention:
I like this idea. Not for the reasons in the issue, but because I'd like to be able to exclude a specific folder from by normal backup routine; there is no way to de-duplicate a compressed file.issue #1665 wrote: allow the user to not mix working file and backups at the same locations
Not a big deal, and I don't want to rock that boat here, but looking at a sample of 1, it seems that the compression ratio is about 4:1. It seems likely that several MB files would be easily manageable on modern hardware. Maybe only the backup needs to be compressed? That would necessitate a file format change though. I'm thinking MIME embedding. Anyone have an opinion?
Proposal
- Fix the symbolic link issue such that the file is saved at the link destination.
- Allow FreeCAD to open its own backup files. But not necessarily set them up with their own MIME types.
- Add a user configuration option for backup file location that may be an absolute path, or a path relative to the current file location, eg. ~/.FreeCAD/backups or ./backups
- Add a menu File>Rollback... that allows picking from the available backups by time of creation.
- Change the order of backup file numbering such that the most recent backup is always #1
What do you hate about my ideas?