- 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 innovates regarding the management of teamwork with 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 a 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" pane, 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" pane, "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 found in the SCM, this option proposes to retrieve 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 is used to display the list of elements that are currently checked out in order for some of them (or all of them) to be checked 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 action was performed on the project, the project file is automatically checked back in.
This option is used to disable the "Master/Guest" management on the project. This option can also be enabled on the "SCM" pane, 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 proposes two modes for checking out the project elements:
- the standard mode: if you display an SCM element that is not checked out, a panel indicates that the element must be checked out before it can be modified. The element can be checked out immediately (check-out button found in the dialog box).
- the automatic mode: if you try to modify an SCM element that is not checked out, the SCM automatically proposes 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" pane, in the "Environment" group, expand "Options" and select "General options of WINDEV".
- In the "General" tab, the option "Check out elements during the first modification" is used to switch all the next opened projects to automatic mode.
Opening a project element to modify its characteristics
To modify the characteristics of a project element managed by the SCM:
- Check out the element from the Source Code Manager.
- Select the check-out mode of 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 test 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.
When checking an element back in, a screen allows you to perform the following actions before the element is checked back in:
- find out the modifications performed.
- compare the element in the repository with the local (checked out) element.
- access the element history in the repository.
You can check in the modifications made to the element while keeping the element checked out ("Keep the element checked out" option)
Project management modes
Two management modes are available with the SCM:
- Managing the project in Master/Guest mode.
- Management 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:
- modify the project characteristics and check these modifications 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" pane, "Project" group, expand "Master/Guest" and select "Become guest on the project (and check all in)".
In this case, the Source Code Manager proposes 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" pane, "Project" group, expand "Master/Guest" and select "Become master on the project".
Caution: Modifying the project options:
All the users of the project (master or guests) can modify the project characteristics (first project window, animation, code style, etc.). These modifications will have to be checked back in into the Source Code Manager by the project master.
The modifications 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 action was performed on the project, the project file is automatically checked back in.
The automatic mode allows you not to manage the "Master/Guest" mode on 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 the disconnection, go to the "SCM" pane, "Other actions" group, expand "Remote work" and select "Disconnect to work offline". Before the disconnection, we advise you to check out the different elements that will be modified (therefore, these elements will be "already checked out" for the other users). You can work on your project locally. The different project elements can be handled directly.
- on reconnection, on the "SCM" pane, in the "Other actions" group, expand "Remote work" and select "Reconnect and synchronize". Then, simply check the modified elements back in.
For more details, see Working in Offline mode
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 in a project of 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 the differences of versions.
- cancel the check-outs (in administrator mode).
- clear, save, restore a repository, etc.
- add files of any type into the repository (.doc, .xls, .pdf, etc.).