The MQL5 Storage (or repository) only works with the MQL5 (or MQL4) folder of the trading platform, and with the special Shared Projects directory, which is used for group projects.
All operations with the MQL5 Storage are performed via the context menu of the Navigator window and through the context menu of the source code editor:
Using the menu commands, you can perform the following actions in the MQL5 Storage:
Storage contains the information as a tree of files. When connecting to Storage, a MetaEditor user reads and writes these files. The user always works with a local copy of data and, if necessary, sends changes to Storage.
To begin to work with data in the MQL5 Storage, you must associate a local data folder with the appropriate folder in the repository:
Version control is implemented for directories/files associated with the repository, therefore such directories/files have a version, i.e. a revision number. A revision number corresponds to each data update. Each time you update the directory/file in the repository, the revision number is incremented for this directory/file and for the entire root directory. A revision is a state of the directory/file at a point of time.
The root directories are the MQL5/MQL4 folder and folders of each shared project. Revisions are managed separately for each root directory, so they have individual revision numbers. When you commit changes made to the MQL5 directory, its revision number is increased, while the revision number of projects does not change (unless the projects use shared files from the MQL5 directory).
General operation scheme:
Each transaction of changes is recorded in the Storage journal, and later the user can view when, by whom and what files were changed. The user can also update the local data copy to a selected revision and revert changes to a selected revision.
To add a folder or file to the repository, select it and execute the Add File or Folder command. This brings up a dialog box showing the list of folders and files to be added.
|
Tick off the necessary files and folders and click OK.
|
Added files and folders are marked with :
Next, these changes should be sent to the repository. Select the added folder/file and execute Commit to Storage.
In this dialog, you can also choose the changes that should be sent to the repository. You can add a comment when committing changes. Detailed comments facilitate the analysis of changes in the future.
After committing the current changes in the repository, the corresponding folders and files are marked with . This means that the local copy of data does not differ from the one that is in the storage at the time of the last commit/update operation.
|
Primary data extraction is executed when the storage is activated in MetaEditor. Once you execute the Activate MQL5 Storage command, MetaEditor will check if Storage contains any data.
Further updates can be received from the Storage using the Update from Storage command in the context menu of files and folders in the Navigator.
If the storage contains folders that do not exist in your local working copy, execute Update from Storage at the MQL5 (or MQL4) root element in the Navigator window. All data from the Storage will be downloaded to the corresponding local folders. The revision number of data will match the revision of data in the storage.
If a local folder contains data, then during checkout data obtained from the repository will be added to it. New files will be added. For files with matching names and paths it will try to merge data. |
MQL5 Storage stores the entire history of changes committed by users to the storage. Each commit of changes is a new revision (state of the storage at a particular time). During parallel work of multiple users with data through the storage, you need to periodically receive changes made by other users. Update to revision allows you to gradually update the local copy of data from the repository.
For example, since the last update of the local copy of data, three new revisions appeared in the storage. You can first upgrade to the first revision, then to the second and to the third one.
To update to a specific revision, select a file or folder and call the storage log by clicking Show Storage Log.
In the window that opens, select the required revision and run the Update to Revision command.
|
MQL5 Storage stores the entire history of changes committed by users to the storage. Each commit of changes is a new revision (state of the storage at a particular time). At any time, you can return to one of the previous states of a file or folder.
To revert to a specific revision, select a file or folder and call the storage log by clicking Show Storage Log.
In the opened window, select the required revision and click Revert to This Revision.
After reverting to the revision, the selected file/folder will fully return to the specified state. You can revert both to earlier and to later revisions. |
As mentioned earlier, you can work with the data only in their local copies. To transfer local changes to the repository, use the Commit to Storage command. Local files and folders that have been changed are marked with an icon .
Before committing changes, you can view them by selecting a file and selecting Difference of Versions in the context menu. |
In the commit dialog, you can select changed files and folders that should be committed to the repository. You can add a comment when committing changes. Detailed comments facilitated the analysis of changes in the future.
|
If you want to delete a file or a folder, use the command Delete File or Folder. The folder/file will be deleted from the local copy of data. To delete a file or a folder from the repository, commit these changes using the Commit to Storage.
|
If you want to undo the changes made in the current local copy of data, execute the Revert Changes command for a necessary file or folder. The file/folder returns to a state that was saved locally during the previous synchronization with the repository.
When you revert changes, the initial local revision is restored, not the current revision in the repository. |
Each commit of changes to Storage using the Commit to Storage command is saved in the log. The logs help you to easily analyze the history of changes in your projects. To view the change log of a file/folder, select Show Storage Log.
The upper part shows a list of changes:
Using the context menu command Update to Revision, you can update the local copy of data to a selected revision.
The bottom of the window displays a list of files modified in the selected revision. Icons show the types of changes:
Using the context menu of the list of modified files, you can analyze the changes: