Changes between Initial Version and Version 1 of UfoRevisionControlBzr


Ignore:
Timestamp:
Jul 30, 2012, 8:25:28 AM (12 years ago)
Author:
Matthias Vogelgesang
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • UfoRevisionControlBzr

    v1 v1  
     1= Bazaar =
     2
     3Bazaar is a distributed revision control system, currently developed by Canonical. More information can be found at:
     4
     5* [http://bazaar.canonical.com/en/ Bazaar Official Web Site]
     6* [http://doc.bazaar.canonical.com/bzr.2.2/en/ Bazaar Official Documentation]
     7
     8[[BR]]
     9
     10= Accessing Repositories =
     11To get access to the bazaar repositories, please, create a ticket and attach your public SSH key. When access is granted, you
     12can get the source out of the repository using following command:
     13{{{
     14bzr branch bzr+ssh://user@ufo.kit.edu/repo/branch
     15}}}
     16For example, to get the latest revision of PyHST from main tree, issue:
     17{{{
     18bzr branch bzr+ssh://user@ufo.kit.edu/pyhst/pyhst
     19}}}
     20If you'll prefer the version maintained by Matthias, issue:
     21{{{
     22bzr branch bzr+ssh://user@ufo.kit.edu/vogelgesang/pyhst
     23}}}
     24Read-only access (all repositories are only accessible from IPE and ISS networks, all other networks are restricted to selected public repositories):
     25{{{
     26bzr branch http://ufo.kit.edu/sources/pyhst/pyhst/
     27}}}
     28
     29== Committing changes ==
     30
     31Any changes that you make, are ''locally'' stored with the commit command
     32{{{
     33bzr commit
     34}}}
     35which asks you for a commit message.
     36
     37Similar to Git, Bazaar handles the very first line of a commit message in a
     38special way. For example `bzr log --line` prints the whole log with revision number,
     39author, date and first line. To keep things nice and tidy, this first line
     40should ''summarize'' the commit in ''50'' characters or less. To increase
     41readability of these lines you may use the `<prefix>: <description>` format,
     42with the following possible prefixes:
     43
     44* Fix (e.g. `Fix: segmentation fault` or `Fix: bug #1234`)
     45* Add (e.g. `Add: web interface`)
     46* Update (e.g. `Update: version`)
     47
     48Because, this line is limited to only 50 characters, you can use several
     49paragraphs divided by newlines to explain not only ''what'' you did, but more
     50importantly ''why'' you changed something. These paragraphs must be wrapped
     51at 72 characters.
     52
     53You should definately make use of Bazaar's builtin bug-tracker support. To
     54enable this for the UFO project add this line to your `bazaar.conf` (located in
     55`~/.bazaar`):
     56
     57{{{
     58[DEFAULT]
     59trac_ufo_url = http://ufo.kit.edu/ufo
     60}}}
     61
     62Now, for each bug that has an associated ticket, you can mark the fixing commit
     63with
     64{{{
     65bzr commit --fixes ufo:123
     66}}}
     67
     68[[BR]]
     69
     70= Public Repositories =
     71||= Repository =||= Description =||
     72|| framework    || The stable version of UFO framework and support libraries. New versions are only accepted after thorough testing/code review. ||
     73|| cmake        || CMake scripts to detect libraries you are maintaining. ||
     74|| opencl       || Various CMake libraries required for UFO filters. ||
     75|| <user_name>  || Development branches of all UFO related code belonging to the ''user_name''. ||
     76
     77[[BR]]
     78
     79= Publishing Source =
     80All the source code should first go to the user private repository. The repository is created with following command:
     81{{{
     82  bzr init-repo bzr+ssh://user_name@ufo.kit.edu/user_name/
     83}}}
     84The created repository will be only writable by its creator, but readable by all members of UFO project. The new repository will not automatically appear in Trac. It should be first added through the Trac configuration page. If you don't have administrative rights, you need to create a ticket.
     85
     86Then, the branches are created as follows (new branches will immediately appear in Trac):
     87{{{
     88  bzr init bzr+ssh://user_name@ufo.kit.edu/user_name/branch1
     89}}}
     90
     91After branch initialization you can create local repository. Just call 'bzr init' in root of the source folder. Files can be added with `bzr add` command and revision can be commited with `bzr commit -m some_comment`.
     92This will work with local repository on your desktop computer. To submit a revision to the server, for public use, please issue:
     93{{{
     94  bzr push bzr+ssh://user_name@ufo.kit.edu/user_name/branch1
     95}}}
     96
     97Alternatively, it is possible to instruct bazaar to synchronize with the server after each commit. Just bind the local branch with the server using the following command:
     98{{{
     99  bzr bind bzr+ssh://user_name@ufo.kit.edu/user_name/branch1
     100}}}
     101
     102
     103
     104[[BR]]
     105
     106= Publishing stable versions =
     107After through testing, the maintainers of UFO subpackages can publish them in UFO main repository. It is
     108accessible with the following bazaar URL:
     109{{{
     110  bzr+ssh://user@ufo.kit.edu/framework
     111}}}
     112
     113You can create new branches with the following command. These branches will be writable by creator only, but accessible for everybody else. Changes to these branches will immediately appear in the Trac [http://ufo.kit.edu/ufo/browser source browser].
     114{{{
     115  bzr init bzr+ssh://user@ufo.kit.edu/framework/branch1
     116}}}
     117
     118[[BR]]
     119
     120= Possible workflow =
     121
     122There are already very good branching [http://nvie.com/posts/a-successful-git-branching-model/ models] out there. Although it's up to everyone how he will work on his personal branches, I will show how I use Bazaar to ease my life.
     123
     124First of all, I import some of the written code using the steps written above.
     125{{{
     126cd project-dir
     127bzr init .
     128bzr add *
     129bzr commit
     130bzr init bzr+ssh://user@ufo.kit.edu/user/project
     131bzr push bzr+ssh://user@ufo.kit.edu/user/project
     132}}}
     133
     134Then I clean the project directory and clone the committed code as a named branch and bind to the server:
     135{{{
     136rm -rf *
     137bzr clone bzr+ssh://user@ufo.kit.edu/user/project upstream
     138cd upstream
     139bzr bind bzr+ssh://user@ufo.kit.edu/user/project
     140}}}
     141I ''never'' work directly in the upstream branch because every commit would be visible immediatly. Therefore, I branch from the `upstream` branch a local branch where development happens:
     142{{{
     143cd ..
     144bzr clone upstream/ local
     145}}}
     146Whenever I need to work on the same project but tackling different problems, I branch from the `local` branch to a feature specific branch. To push my changes, I just pull (no merging needed) the changes from the `local` branch into the `upstream` branch
     147{{{
     148cd upstream
     149bzr pull ../local
     150}}}