In this blog post I will take you through integrating Dymola with your version control system to support your file management.
We won’t cover the merits of using a version control system to manage your models, and the safety net this provides in this blog post but if you need the low-down on version control take a look at this post: A Visual Guide to Version Control.
Because the use of version control systems is so common for model development projects, Dymola supports integration with CVS (Concurrent Versions System), SVN (Subversion) or Git. So, if you use one of these systems, Dymola can provide a graphical user interface (GUI) to allow you to perform version control commands in the Dymola environment where you need them.
The first step is to configure Dymola to work with your version control system. Open the Options GUI by going to Edit > Options… and then go to the Version tab as shown in Figure 1.
- Under the Version management system heading, select the type of system you are using. Here at Claytex we use a SVN based version control system to manage and share our models.
- If using Git, you will also have to provide a path to the Git bin directory.
- Check the box for Deleting directories and files when deleting sub-packages. This will stop Dymola automatically creating backup files when you delete a model, these aren’t needs because the version control system is your backup.
- Make sure As default store packages as one file is unchecked; for version control it is better to have individual files to see precisely which model has been modified.
- Check the box for Automatically generate commands for version system (move etc) to enable the version control commands when you add, rename or move a model in Dymola, but this setting doesn’t work for CVS. The version control commands are executed when you save your library, and having this enabled changes the save action to always saving the entire library rather than individual files.
Now you can use the Version actions available in Dymola, go to File > Version to perform common version control commands.
For a more detailed explanation of the version control integration in Dymola see the Version Management section of the Dymola User Manual Volume 2. Note that I was using Dymola 2020 for the blog post.
Written by: Hannah Hammond-Scott – Modelica Project Leader