Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save backup versions of projects #740

Merged
merged 2 commits into from Jan 7, 2022
Merged

Save backup versions of projects #740

merged 2 commits into from Jan 7, 2022

Conversation

devernay
Copy link
Member

@devernay devernay commented Jan 7, 2022

What type of PR is this? (Check one of the boxes below)

  • New feature (non-breaking change which adds functionality)
  • My change requires a change to the documentation
    • I have updated the documentation accordingly

What does this pull request do?

Save backup versions of projects.
Resolves #562.

Show a few screenshots (if this is a visual change)

image

Have you tested your changes (if applicable)? If so, how?

yes

Copy link
Member

@YakoYakoYokuYoku YakoYakoYokuYoku left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May I ask why the choice of the *.ntp.~<n>~ format? My first glance was that it looks kinda weird considering that A the usage of more than one tilde might be a little unintuitive in UNIX based systems and B is that those backups are still valid Natron Project files so ending them with .ntp is not unreasonable. Apart from those no more problems if we go forward with it.

A bit of a nit, however, we have to take into consideration the situation of slowdowns at the moment of autosaving (#738).

@devernay
Copy link
Member Author

devernay commented Jan 7, 2022

May I ask why the choice of the *.ntp.~<n>~ format?

  • blender uses .blend1 .blend2, etc. By default, these files should not be opened by blender without removing manually the number at the end.
  • On Unix systems, a ~ at the end indicates a backup, and most file browsers understand it that way. Even blender users are asking for this, see https://blenderartists.org/t/hide-backup-blends-with-tilde/1165342 and https://blender.community/c/rightclickselect/Jsdbbc/?sorting=hot for a request to do that
  • For numbered backups, it must have a ~ at the end but also a number. The best reference I could find is to use .~{number}~, see here: https://ftp.gnu.org/old-gnu/Manuals/emacs-20.7/html_node/emacs_103.html
  • Backup files should never be opened by Natron without having been renamed explicitly, else how do you backup these? This is also how it works in Blender
  • I could change the default so that if only 1 backup version is asked (the default), it just adds the tilde instead of .~1~, but then corener cases may be tricky to handle (what happens when saveVersions > 1 but there is a ~file?)

@devernay
Copy link
Member Author

devernay commented Jan 7, 2022

Oh and also GNU utilities cp, mv, ln have the option --backup=numbered which use that same naming convention.
See http://www.jpeek.com/articles/linuxmag/2005-08/

@devernay devernay merged commit 1d1434d into RB-2.4 Jan 7, 2022
@YakoYakoYokuYoku
Copy link
Member

May I ask why the choice of the *.ntp. format?

blender uses .blend1 .blend2, etc. By default, these files should not be opened by blender without removing manually the number at the end.
...

Oh and also GNU utilities cp, mv, ln have the option --backup=numbered which use that same naming convention. See http://www.jpeek.com/articles/linuxmag/2005-08/

Fair enough LGTM then

@YakoYakoYokuYoku YakoYakoYokuYoku deleted the save-versions branch June 18, 2022 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants