ContributingCode.wiki
changeset 720 03def791ae0b
parent 718 e4e1597f6b84
child 721 76c078df2785
equal deleted inserted replaced
719:a990378a5bad 720:03def791ae0b
    12 
    12 
    13 == Using a mercurial clone ==
    13 == Using a mercurial clone ==
    14 
    14 
    15 TODO
    15 TODO
    16 
    16 
       
    17 === Creating a (named) branch ===
       
    18 We prefer not to use (named) branches for little patches, as branches are permanent and will clutter the list of {{{hg branches}}}.
       
    19 So for small code contributions, use unnamed branches instead (see below).
       
    20 However, if you are going to write code that is more a pro#summary Useful hints for contributing code to Hedgewars
       
    21 
       
    22 
       
    23 *Table of Contents*
       
    24 <wiki:toc max_depth="2" />
       
    25 
       
    26 = Introduction =
       
    27 
       
    28 You want to contribute code to Hedgewars? That's great! Here are some hints how to help us with importing your code.
       
    29 
       
    30 = Recommended workflows =
       
    31 
       
    32 == Using a mercurial clone ==
       
    33 
       
    34 TODO
       
    35 
       
    36 === Creating a (named) branch ===
       
    37 We prefer not to use (named) branches for little patches, as branches are permanent and will clutter the list of {{{hg branches}}}.
       
    38 So for small code contributions, use unnamed branches instead (see below).
       
    39 However, if you are going to write code that is more a project than a patch and that will take dozens of commits, feel free to use a (named) branch.
       
    40 
       
    41 To create a new branch use {{{hg branch}}} followed by the name of the new branch, before committing the first code.
       
    42 
       
    43 
       
    44 
       
    45 === Using unnamed branches ===
       
    46 
       
    47 Unnamed branches a.k.a. topological branches, are when the history of commits within a branch (e.g. "default") splits up into  alternative chains of commits.
       
    48 These alternative chains will have more than one {{{head}}} (at the the end of each chain) within the same branch, until they will be merged back together into a single chain.
       
    49 
       
    50 In order for us to be able which bugfixes/features of you we merge into the official repository, you should put each in a separate "unnamed branch" as described above.
       
    51 
       
    52 Make sure that the first commit of each bugfix/feature commit set is based on a commit from the official repository, that way your bugfixes/features will not depend on the commits of each other and can be merged into official individually, as needed.
       
    53 
       
    54 That means: *Before you start writing code towards a new bugfix/feature, make sure to {{{hg update}}} to a revision from the official repository.*
       
    55 
       
    56 
       
    57 In newer versions of Mercurial you can give those unnamed branches a "local" and removable name using {{{hg bookmark}}}.
       
    58 
       
    59 You can see example of how unnamed branches and bookmarks are used best [http://hg.hedgewars.org/hw-example-clone/graph here]
       
    60 
       
    61 ject than a patch and that will take dozens of commits, feel free to use a (named) branch.
       
    62 
       
    63 To create a new branch use {{{hg branch}}} followed by the name of the new branch, before committing the first code.