Working with branches in CVS repositories

 

4gl developers use repositories for sharing and integrating their ongoing work. This is usually done in branches, each branch representing the current state of the shared project.

 

CVS repositories also support branching. Every CVS repository has at least one branch - HEAD, . If necessary, you can create more than one branch (e.g., separate branches for ongoing work and for maintenance; separate branches for every developer; etc.).

 

When you make changes locally in your workbench, your team members cannot see or reach them. To make your changes available for your team members, you have to commit your changes to the branch.

When changes are committed, they are copied from your local workbench to the branch. Thus,  these changes can be seen as incoming changes when other developers update the branch after you have committed your version of the project.

 

When working with branches of your CVS repositories, you can

§        create new branches ,

§        refresh branches , and

§        merge branches .

 

These actions are available from the context menu of the Project Explorer view and from the context menu of the CVS Repositories view:

 

 

 

 

 

 

Create new branches

 

Here we'll show you how to create branches and release resources to the necessary branch.

To create a new branch for the CVS repository, select Branch...  in the context menu of the Project Explorer view (the menu is shown in the screenshots above).

In the opened window, enter the name to a branch and press OK:

 

 

After you enter the branch name, the version name is created automatically (you can use other version names - i.e. the name different from the branch name - but this can be confusing).

 

You can start working in the newly created branch immediately or switch to it later. In the latter case, uncheck the Start working in the branch checkbox when creating the branch:

 

 

The new branch will appear in the Project Explorer view:

 

 

Refresh branches

 

You can refresh the list of branches displayed in the CVS Repositories view for the selected project by means of the Refresh Branches dialog:

 

 

In the Refresh Branches dialog,  select one or more projects which tags you want to refresh (you can use Select All... to refresh all the projects in the branch):

 

 

You can either refresh branches regardless of the working set the projects are included in of select one or more necessary working sets (if you select this option, the corresponding projects are checked):

 

 

If the operation fails for a particular project, use Configure Branches and Versions on the project to select one or more appropriate refresh files.

 

 

Merge branches

 

If you have several branches, you can merge  them. Merging allows you to incorporate two branches into one.

You can merge a branch either into another branch or into HEAD.

 

To start the Merge dialog, select Merge... in the Project Explorer view (the menu is shown in the screenshots above):

 

In the Merge dialog, you configure the merge:

 

 

You select the end and the start tags in the corresponding fields:

 

 

Typically, the starting point is the root of the branch (or a version tag), and the end point can be either the tip of a branch or another version tag:

§      As an end tag, you select  a branch or version you want to merge into the workspace.

§      Start tags are selected automatically (if LyciaStudio can find the appropriate one) or you can do it manually (if, for any reason, the tag cannot be found or you need another tag).

 

You can preview the merge by enabling the corresponding option in the Merge window:

 

 

If there is no start tag, you can merge branches without preview. In this case, the branch will be merged directly into the workspace.

 

By checking the Merge non-conflicting changes and only preview conflicts checkbox, you allow LyciaStudio to hide non-conflicting changes and display only conflicts:

 

 

If necessary, you can refresh and/or configure tags when merging branches:

 

 

When you press Refresh Tags, the tags will be refreshed automatically.

When you press Configure tags, the window opens where you can configure tags manually where you can:

§      view the available  tags,

§      browse files for tags, and

§      add and remove tags.

 

 

By checking/unchecking the Perform the merge into the local workspace checkbox, you choose whether the merge is performed in the repository only or in the workspace as well:

 

 

When you merge the branches in LyciaStudio, changes between the start point and the end point are displayed in the Synchronize view:

 

 

After merging is complete, you can test changes locally and then commit them.

 

Destination of the merge is always the project in your workspace.

 

 

 

Related articles:

CVS Repositories Exploring perspective

CVS repositories view