Новости и статьи

Среда разработки встроенных систем или дистрибутивов на основе GNU/Linux. Здесь вы можете найти новости проекта, статьи и заметки, касающиеся разработки дистрибутива Radix cross Linux.

Subversion S/W CM

18 ноября 2015 г.

In software engineering, software configuration management (SCM or S/W CM) is the task of tracking and controlling changes in the software, part of the larger cross-disciplinary field of configuration management. SCM practices include revision control and the establishment of baselines. If something goes wrong, SCM can determine what was changed and who changed it. If a configuration is working well, SCM can determine how to replicate it across many hosts.

tags

This article represents the basic knowledge of Subversion CM needed for understand the Radix.Linux CM.

Repositories Location

All repositories are placed at https://csvn.radix.pro/ .

Build System repository
Platform repository
Toolchains repository
File-revision concept

Trunk

Trunk – is a very stable main line of Radix.Linux source code. Before committing to trunk the locally changed copy should be compiled without any errors and warnings.

Development Branches

Development branches can be created by team leaders and developers. There are several types of branches created according to project needs.

Types of Branches
Typical branch life cycle
  • New branch creation from trunk
  • Coding / bugfixing / debugging
  • Rebasing to the HEAD of trunk
  • Code Review / Approval
  • Entering to the Merge Queue
  • Rebasing to the newest HEAD of trunk, making sure there are no errors and no warnings, performing smoke tests
  • Merge to the trunk
  • Moving the branch to deadwood: https://csvn.radix.pro/toolchains/branches/deadwood/

Branch Creation Basics

The Feature, Item, and Bug Fixing branches are usualy created from trunk or project branch (see Fig.1).

Рис.1. Создание ветки

The development branch can be created by following Subversion command:

[/home/user] $ svn cp svn://radix.pro/toolchains/trunk@B1 \
                      svn://radix.pro/toolchains/branches/allwinner \
                      -F ./message.txt

Where message.txt – is a file which contains the commit message. The commit message should be created from corresponded template and should contents exact information about revision of trunk from which the branch has been created:

COPY(svn://radix.pro/toolchains/trunk@B1)

Where the B1 – is a revision of the trunk from which the developer branch has been created.

Rebase Basics

Roughly the merge operation can be described as follows:

merge = diff + patch

Diff and patch operations are performed over both code and properties. See Fig.2.

Рис.2. Rebasing to the HEAD of Trunk

To rebase the development branch the developer have to check out the clean copy of his branch and apply changes performed on the trunk from last rebase till current revision of the trunk. Please remember that the reverted commits should be skiped. The rebasing command seems like follow:

[/home/user] $ svn merge -rB1:B2 svn://radix.pro/toolchains/trunk \
                                 ./allwinner

Where the ./allwinner – is a localy checked out clean developer branch.

After merging the changes from trunk the developer have to tesolve conflicts and rebuild his branch and perform tests with this build to be sure that this merge didn't inject regression to the development branch.

Then developer can commit the changes to his branch by following commands:

[/home/user] $ svn ci ./allwinner -F ./message.txt

Where the message.txt file contains the following information:

MERGE(rB1:B2 svn://radix.pro/toolchains/trunk)

Commit Basics

The most important operation is the commit your changes to the trunk. Commit should be performed only in boundaries of time slot delegated where the development branch become the first in the Merge Queue. To make the commit we have to perform following operation:

  1. Check out the latest revision of trunk
  2. Apply the differences between head of trunk and head of development branch (Note: the branch should be rebased to the latest head of trunk) to the checked out local copy of trunk
  3. Build the changed local trunk
  4. Perform Smoke Tests
  5. Make the commit to the trunk only if Smoke Tests are passed without regression

Item 2 of this activities is shown at the Fig.3.

Рис.3. Commit Changes to the Trunk

To apply the changes to the local checked out trunk you can make use following command:

[/home/user] $ svn merge \
                   svn://radix.pro/toolchains/trunk@B2 \
                   svn://radix.pro/toolchains/branches/allwinner@D3 \
                   ./trunk

After merging the changes to the local checked out trunk the developer have to resolve conflicts and rebuild the local copy of trunk. Then the developer have to perform Smoke Tests (see items 3, 4 above).

Only if Smoke Tests are passed without any errors the developer can commit the changes to the trunk using following command:

[/home/user] $ svn ci ./trunk -F ./message.txt

Where message.txt file contents whole information about this commit including the list of Polarion tickets which present in the Merge Queue:

MERGE(svn://radix.pro/toolchains/trunk@B2,
      svn://radix.pro/toolchains/branches/allwinner@D3)

This is almost all information which is necessary to work with the code of Radix.Linux .