718
|
1 |
#summary Useful hints for contributing code to Hedgewars
|
|
2 |
|
|
3 |
|
|
4 |
*Table of Contents*
|
|
5 |
<wiki:toc max_depth="2" />
|
|
6 |
|
|
7 |
= Introduction =
|
|
8 |
|
|
9 |
You want to contribute code to Hedgewars? That's great! Here are some hints how to help us with importing your code.
|
|
10 |
|
|
11 |
= Recommended workflows =
|
|
12 |
|
|
13 |
== Using a mercurial clone ==
|
|
14 |
|
|
15 |
TODO
|
|
16 |
|
721
|
17 |
=== Using (named) branches ===
|
|
18 |
Branches are alternative commit histories. Changes done in one branch can be merged into other branches as needed.
|
722
|
19 |
|
725
|
20 |
_Most main development happens on the main repository branch "default"._
|
721
|
21 |
|
722
|
22 |
|
725
|
23 |
We prefer *not* to use separate branches for little patches, as branches are permanent and will clutter the list of {{{hg branches}}}.
|
722
|
24 |
|
725
|
25 |
*So for small code contributions, use "unnamed branches" instead (see below).*
|
721
|
26 |
|
725
|
27 |
_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 do that work on a new branch._
|
720
|
28 |
|
|
29 |
To create a new branch use {{{hg branch}}} followed by the name of the new branch, before committing the first code.
|
|
30 |
|
|
31 |
|
|
32 |
|
|
33 |
=== Using unnamed branches ===
|
|
34 |
|
723
|
35 |
_Unnamed branches_ a.k.a. _topological branches_ happen when the history of commits within a branch (e.g. "default") splits up into alternative commits chains.
|
720
|
36 |
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.
|
|
37 |
|
723
|
38 |
*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.*
|
720
|
39 |
|
|
40 |
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.
|
|
41 |
|
|
42 |
That means: *Before you start writing code towards a new bugfix/feature, make sure to {{{hg update}}} to a revision from the official repository.*
|
|
43 |
|
|
44 |
|
|
45 |
In newer versions of Mercurial you can give those unnamed branches a "local" and removable name using {{{hg bookmark}}}.
|
|
46 |
|
724
|
47 |
*You can see example of how unnamed branches and bookmarks are used best [http://hg.hedgewars.org/hw-example-clone/graph HERE]*
|
720
|
48 |
|