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 |
|
720
|
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 |
|
721
|
36 |
=== Using (named) branches ===
|
|
37 |
Branches are alternative commit histories. Changes done in one branch can be merged into other branches as needed.
|
|
38 |
Most main development happens on the main repository branch "default".
|
|
39 |
|
|
40 |
We prefer not to use separate branches for little patches, as branches are permanent and will clutter the list of {{{hg branches}}}.
|
|
41 |
So for small code contributions, use "unnamed branches" instead (see below).
|
|
42 |
|
|
43 |
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
|
44 |
|
|
45 |
To create a new branch use {{{hg branch}}} followed by the name of the new branch, before committing the first code.
|
|
46 |
|
|
47 |
|
|
48 |
|
|
49 |
=== Using unnamed branches ===
|
|
50 |
|
|
51 |
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.
|
|
52 |
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.
|
|
53 |
|
|
54 |
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.
|
|
55 |
|
|
56 |
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.
|
|
57 |
|
|
58 |
That means: *Before you start writing code towards a new bugfix/feature, make sure to {{{hg update}}} to a revision from the official repository.*
|
|
59 |
|
|
60 |
|
|
61 |
In newer versions of Mercurial you can give those unnamed branches a "local" and removable name using {{{hg bookmark}}}.
|
|
62 |
|
|
63 |
You can see example of how unnamed branches and bookmarks are used best [http://hg.hedgewars.org/hw-example-clone/graph here]
|
|
64 |
|
|
65 |
ject than a patch and that will take dozens of commits, feel free to use a (named) branch.
|
|
66 |
|
|
67 |
To create a new branch use {{{hg branch}}} followed by the name of the new branch, before committing the first code.
|