📜 ⬆️ ⬇️

Caché Studio development using TortoiseGit

Caché-Git is the version control module for Caché Studio, which brings up TortoiseGit dialog boxes directly from Studio and semi-automatic synchronization of routines between Caché and the local repository.

In each area, packages, projects, classes, routines, dfi-files, csp-pages, csp-applications are selected to be checked by Caché-Git.

Whenever a monitored program is saved, it will be exported to disk in the repository. When you open the program will be loaded from the repository, if the version is fresh in it.
')
Caché-Git works only on computers that have both Caché server and client installed. Caché-Git will not work when connected to a remote server.

Where to get


The repository with Caché-Git is located at github.com/intersystems-ru/cache-tort-git . There is also a wiki that describes the steps to install and use

Caché-Git installation


Short

At the time of installation, disable read-only on CACHELIB and import the project file into the% SYS area. For the desired areas (for example, SAMPLES and USER), assign the class% SourceControl.Git as a version control class.

In detail

At the time of installation, you must include the ability to write to the database CACHELIB. This is done through the "System Management Portal". Select "System Administration> Configuration> System Configuration> Local Databases." Click the “edit” link in the line with CACHELIB and in the “Read only?” Drop-down list, select “No”. After installing the Caché-Git flag can be returned back.

In Caché Studio, select the% SYS area and import (“Tools> Import locally”) the file with Caché-Git. Everything, you can again prohibit writing to CACHELIB.

Now you need to set the areas in which Caché-Git will be used for version control. To do this, in the “System Management Portal”, select “System Administration> Configuration> Advanced Settings> Version Control System”. For the areas you need, select the% SourceControl.Git class and click OK. The example in this tutorial will work with the SAMPLES area, so select the% SourceControl.Git class as the version control system class for it.

***

After installation, in Caché Studio, when you select an area in which Caché-Git is assigned as a version control system, the Git menu appears.

Customization


To configure Caché-Git, select the “Git> Settings” menu in Caché Studio and specify two parameters:


These parameters are common to all areas.

TortoiseGit settings are accessed via the “Git> Tortoise Git Settings” menu.

Work with a local repository


Open the SAMPLES area. To initialize the repository in the region, select the “Git> Create repo” menu and click “OK” a couple of times. The Git menu will get the full look.

In the inspector, select the element that you want to add to Git, right-click on it and select “Add to SourceControl” from the Git context menu.

Then select the menu item “Git> Commit”. At the bottom of the window that opens, select all the files and add (right-click> Add) them to the versioned ones. If there are no files, check Show Unversioned Files. Write a comment to the commit. Click OK and then Close.

The sc-list.txt file contains a list of items that Caché-Git tracks. It is needed in order to transfer information about programs controlled by Git between two repositories.

Two important paragraphs

Whenever you add a new item to Caché-Git or save an existing one, this item is exported to a temporary folder, so when you call TortoiseGit commands (such as commit, push, revert, etc.), you do not need to unload all programs ( Git> Export All) tracked by Caché-Git.

When importing the opposite. Firstly, when pull or revert can change a significant part of the program. Secondly, the call to the TortoiseGit windows from Caché Studio is asynchronous and there is no way to know when a window is closed and the file update operation has ended. SO. After all the operations performed by TortoiseGit, which can change the contents of the working folder, select the menu item "Git> Import All". These commands are Clone, Pull, Fetch, Revert. Whenever you execute one of these commands, a reminder will appear in the output window “Choose Import All menu after work with Git”

Work with a remote repository

You can upload the contents of your repository to the server by selecting the “Git> Push” menu item and specifying the repository address in the “Arbitrary URL” field.

Connection to the repository

Each local Caché-Git repository is stored inside a subfolder of the folder specified as temporary when configured (usually c: \ temp). The name of this subfolder is the same as the name of the area (namespace), for example, c: \ temp \ USER or c: \ temp \ SAMPLES.

To connect to a remote repository - select the menu "Git> Clone". Enter the repository name, for example “http://git.assembla.com/demo.git”. TortoiseGit itself adds the name of the demo folder to the path c: \ temp \ user, so you’ll get c: \ temp \ user \ demo. Erase the last "\ demo" so that only c: \ temp \ user remains. This should be done only during cloning, then when executing the push, pull, and so on commands, nothing needs to be changed.


Using


The main working cycle looks like this:

  1. Pull.
  2. Disassemble TortoiseGit conflicts, if any
  3. To download changes from disk to Caché, select the Import All menu.
  4. Make changes in Caché Studio.
  5. [Optional] To force changes to be downloaded from the disk in Caché, select the Export All menu.
  6. Choose Commit
  7. Select Push either from the Caché Studio menu or right after Commit.


An example of installation and operation can be viewed in the video:

Source: https://habr.com/ru/post/166503/


All Articles