- Source Code Manager
- Creating a repository for the SCM
- When to create a repository?
- Configuring the project to work with the SCM
- Adding a project to the SCM
- Sharing resources
- Working with the SCM
- Project options related to the SCM
- Checking out an element
- Checking an element back in
- Project management modes
- Working in offline mode with the SCM
- SCM administrator
9. Sharing a project in practice
The development of a large IS system requires the participation of multiple developers. These developers must work on a single WINDEV project while sharing different resources (queries, classes, etc.).
To share a project, you can use the Source Code Manager.
WINDEV boasts innovative features for teamwork management in the Source Code Manager (also called SCM).
The Source Code Manager (SCM), which is fully integrated in the environment, is used to:
- make teamwork easier and faster,
- store the history of modifications and versions,
- save the sources of the development team automatically.
Designed for teams between 1 and 100 developers, the SCM promotes and standardizes the collaboration between developers (even when developing alone, the SCM is useful because it contains the history of your applications).
The SCM uses a repository: procedures, classes, pages, reports, components, analyses, etc.
You can choose between a repository:
- in HFSQL Client/Server mode:
- in HFSQL Classic mode (installed locally or in a shared directory).
The SCM can be run locally or remotely, via Internet or via an HTTP or HTTPS connection. This feature enables you to work on a project from your office or from a remote site without losing any changes.
The SCM can also be used in offline mode.
All project elements are saved in the repository (on the server). This operation is performed when creating the project or when importing an existing project into the Source Code Manager.
Each developer who uses the Source Code Manager retrieves a local copy of the project.
To work on a project element (window, page, report, etc.), the developer must check out the element from the repository, modify it and check the element back in.
If the element is already checked out, the developer can ask the person who performed the check-out to check the element back in (via the messaging software).
To benefit from the modifications performed, the other developers must synchronize their local project with the reference project (found in the repository).
The sources of your applications are essential.
These sources must be handled with great care!
Tips for configuring the server that will host your sources:
- Use a dedicated server with a disk with enough space (at least 200 GB).
- Use the Source Code Manager (SCM) in Client/Server mode.
- The hard disks may encounter physical problems: use a RAID I system on your server (several disks that store the same information).
- Use a UPS to protect the power supply of your server.
- Make backup copies of the repository on a regular basis (at least once a week).
- Place the server in a "secure" area and use a firewall.
Creating a repository for the SCM
To share a project via the Source Code Manager, a repository must be created. This repository must be created once only on the server.
The operating system and file system on which the repository is installed must support files exceeding 4 GB.
The repository can be created:
- via SCMDrive, a "turnkey" solution (recommended). In this case, a shared server is used. This paid solution simplifies all the SCM server setup operations. For more details, see SCMDrive.
- via PCSCloud, a "turnkey" solution. In this case, a dedicated server is used. This paid solution simplifies all the SCM server setup operations. You will use a platform adapted to your needs. For more details, see PCSCloud.
- on an HFSQL Client/Server server: the repository will be in HFSQL Client/Server format. In this case, you must specify:
- the server,
- the database,
- the port used,
- the name and password of an HFSQL database administrator.
- locally, in a shared directory on the network: all the SCM users must have full rights on this directory. The repository will be in HFSQL Classic format.
Simply specify the network directory where the repository will be created.
When to create a repository?
The repository must be created only once
WINDEV allows you to create this repository at different times:
- when installing WINDEV.
- when creating a project that uses the SCM.
- when importing a project into the Source Code Manager.
- in the SCM administrator directly.
Once the repository is created, all the WINDEV projects to share can be imported into this repository.
We advise you to make backup copies of the repository on a regular basis. These backups can be performed via the SCM administrator.
Configuring the project to work with the SCM
Some operations are required before an existing project can be used by the Source Code Manager.
Adding a project to the SCM
To add a local project to the SCM
- Open your project in WINDEV.
- On the "SCM" tab, in the "Add project" group, click "Add project to SCM".
- In the wizard, select the repository to be used:
- A new repository. In this case, select the type of repository you want to create (SCMDrive or PCSCloud, Client/Server or local repository). Provide the required information according to the chosen option.
- An existing repository. Simply select the desired repository.
- Validate the wizard. The project is added to the SCM.
A first project was imported into the Source Code Manager. This project contains elements shared with other projects (classes, windows, procedures, style sheets, analysis, etc.).
Project options related to the SCM
Several options are available to configure a project handled by the Source Code Manager. These options can be found in the "SCM" tab of the project description ("Project" tab, "Description"). These options are checked by default.
- Propose to get the latest version of the elements when the project is opened:
When opening a project located in the SCM, this option prompts you to get the latest version of the project elements.
By default, the latest version of the elements is automatically retrieved.
- Propose to check in the elements when the project is closed:
When the project is closed, this option displays a list of the checked out elements to check some or all of them back in.
By default, when the project is closed, the checked out elements are not checked back in.
- Check out/Check in the project automatically:
This option is used to automatically manage the "project file". If this option is checked, the project file is checked out only if the action performed requires it. Once the actions have been completed in the project, the project file is automatically checked back in.
This option disables the "Master/Guest" management on the project. This option can also be enabled on the "SCM" tab, in the "Project" group, by expanding "Master/Guest" and selecting "Manage project check-out automatically".
Checking out an element
The different check-out modes
The SCM includes two modes to check out the project elements:
- standard mode: if you open an element that has not been checked out from the SCM, a panel indicates that the element must be checked out to modify it. The element can be checked out immediately (check-out button found in the dialog box).
- automatic mode: if you try to modify an element that has not yet been checked out, the SCM automatically prompts you to check it out. Once the check-out is validated, the element can be modified.
Remark: this mode is not recommended when using the SCM with a slow Internet connection.
To change the check-out mode:
- On the "Home" tab, in the "Environment" group, expand "Options" and select "General options of WINDEV".
- In the "General" tab, the "Check out elements during the first modification" option allows you to switch all subsequent projects to automatic mode.
Opening a project element to change its characteristics
To change the characteristics of a project element included in the SCM:
- Check out the element from the Source Code Manager.
- Select the check-out mode for the element. The check-out mode can be:
- exclusive: nobody can check out this element until it is checked back in. The element can be checked out for tests only.
- for test: the element can be modified but the modifications will not be checked back in.
- multiple: the element can also be checked out by other users. In this case, the differences between the different element versions can be viewed when the element is checked back in.
- Validate. The element is opened. The title bar indicates that the element is checked out.
Checking an element back in
The elements checked out from the Source Code Manager are bordered by a red line in the project editor.
To check in an element, go to the "Project explorer" pane and select "Check in" in the context menu of the element.
A screen allows you to perform the following actions before checking the element back in:
- view the changes made.
- compare the element in the repository with the local (checked out) element.
- access the element history in the repository.
You can check in the changes made to the element while keeping the element checked out ("Keep element checked out" option).
Project management modes
Two management modes are available with the SCM:
- Managing the project in Master/Guest mode.
- Managing the project in automatic mode (by default).
Master and guest
The Source Code Manager distinguishes between 2 types of users:
- the master: the master is the user who initially stored the project in the Source Code Manager.
- the guests: the guests are the developers who handle the project from the Source Code Manager.
There is no need to be connected in master mode on a project. The "Master" mode is only required to:
- change the project characteristics and check these changes back into the repository.
- check in all the elements to create the executable and the setup program of the application.
To switch from master mode to guest mode, go to the "SCM" tab, "Project" group, expand "Master/Guest" and select "Become guest on the project (and check all in)".
In this case, the Source Code Manager allows you to check in all the elements of the project (including the .WDP file).
To switch from guest mode to master mode, go to the "SCM" tab, "Project" group, expand "Master/Guest" and select "Become master on the project".
Caution: Changing the project options:
All the users of the project (master or guests) can change the project characteristics (first window of the project, animations, code style, etc.). However, only the project master will be able to check these changes back into the Source Code Manager.
The changes made by a guest will be lost when the project is updated from the repository.
With the automatic mode, the project file is checked out only if the action performed requires it (regardless of the user). Once the actions have been completed in the project, the project file is automatically checked back in.
With the automatic mode, you do not need to manage the "Master/Guest" mode in the project.
Working in offline mode with the SCM
The Source Code Manager allows you to easily work in offline mode.
For example, this mode allows a developer who works on a laptop to continue working on a project located in the repository while offline.
The principle is simple:
- before disconnecting, go to the "SCM" tab, "Other actions" group, expand "Remote work" and select "Disconnect to work offline". Before working offline, it is recommended to check out the different elements you will work on (these elements will appear as "already checked out" for the other users). Then, you can work on your project locally. You can handle the different elements in the project directly.
- on reconnection, on the "SCM" tab, in the "Other actions" group, expand "Remote work" and select "Reconnect and synchronize". Then, simply check the modified elements back in.
The SCM administrator is used to directly handle the different projects included in the source code manager.
It allows you to:
- manage repositories (create or connect to a repository).
- manage branches.
- manage files and directories located in a project in the repository (add, delete, rename files and directories).
- manage the different files of the repository (check-out, check-in, share, etc.).
- start some tools (options, maintenance, etc.).
- restore a project version.
- see the history and differences in the versions.
- undo check-outs (in administrator mode).
- clear, save, restore a repository, etc.
- add different types of files to the repository (.doc, .xls, .pdf, etc.).