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

Versions #755

Closed
wants to merge 32 commits into from
Closed

Versions #755

wants to merge 32 commits into from

Conversation

vkbo
Copy link
Owner

@vkbo vkbo commented Apr 24, 2021

Work in progress implementation of file versioning. The issue thread is #383.

Implemented so far

  • When a document is opened in the editor, the version from the previous session is saved as a special versioned file. This file can be used to reverse the changes made in that session. This solution addresses some of the points made in Option to exit without saving the file #533.

Technical

  • The version files are saved in a versions folder in the main project folder. Each document file will get its own subfolder under that versions folder.
  • For the automated previous session version, the file is saved as 0123456789abc/0123456789abc_session.nwd for a file handle 0123456789abc. This file is overwritten on each new session. The file is not overwritten if the file is opened for editing multiple times in the same session.
  • A session ID is generated for each session based on the number of seconds since 1/1/2000. The session ID is an 8 hex string of this timestamp. That should last until the year 2136.
  • For permanent version files, the suffix is the session ID followed by an incrementing two integer for each version saved in the same session. Having the session ID in the file name should make it easier to collect file versions from a given session.
  • A versions.dat file has a single entry for each version saved, with the session ID, timestamp and a "commit" message.

@vkbo vkbo added this to the Release 1.4 Beta 1 milestone May 14, 2021
@vkbo vkbo linked an issue May 14, 2021 that may be closed by this pull request
@vkbo vkbo changed the base branch from dev to main July 13, 2021 13:23
@vkbo vkbo closed this Sep 10, 2021
@vkbo vkbo deleted the versions branch September 10, 2021 15:53
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.

Version Control
1 participant