ResInsight
ResInsight copied to clipboard
Revision control of project files
Background
Users have reported that ResInsight
can crash when loading a project file. As there is no way to recover a previously stored version of the project file, this will cause extra work for the user. A project file revision system can be very useful in this situation.
A project file revision system can also be useful in other settings:
- roll back to a previous state in order to use this version as template for a different case
- documentation of the different steps involved in order to produce the final project file
Proposed technical solution
A database is established in form of a file named <project_filename>.rspdb
. When the user saves the project, a copy of the project file content is stored in this database including a timestamp. The user can turn off the storage to a backup from preferences, default setting is on.
A separate tool (restore_tool
) is created with the following command line options
- command line option to restore a project file before a specified date
- command line option to list all timestamps
- command line option for destination filename
- command line option to get all versions in the database. The different versions will be stored in separate files named based on the date.
This tool can be developed using SQLite
and Qt
.
Examples
Find newest version before specified date and write to file restored_file.rsp
:
restore_tool myproject.rspdb -time 2024-03-10 -destination restored_file.rsp
Write all versions into restored_file_<placeholder_date>.rsp
This operation will create one file for each timestamp :
restore_tool myproject.rspdb -all -destination restored_file.rsp
References
https://doc.qt.io/qt-5/sql-programming.html https://sqlitebrowser.org/