Differences between revisions 3 and 4
Revision 3 as of 2010-11-15 19:35:24
Size: 2823
Editor: MalteHelmert
Comment:
Revision 4 as of 2010-11-15 19:35:48
Size: 2793
Editor: MalteHelmert
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
## page was renamed from ForDevelopers/Workflow
Line 4: Line 3:
= Our Mercurial workflow = = Mercurial =

=
= Our Mercurial workflow ==

Back to developer page.

Mercurial

Our Mercurial workflow

We use Mercurial, following the task-based workflow explained here. All significant development should be in response to an issue in the tracker, let's say issue1000. Then the usual development process involves two roles, "developer" and "reviewer" (usually Malte), and works as follows:

  1. Developer creates a new branch issue1000 in their own repository, usually branching off the newest revision in default. Note the exact spelling of the branch. Being consistent here allows us to automate some of these steps in the future.

  2. Developer resolves the issue in the branch. (Developer does not close the branch or push the changes to the master repository.)

  3. Developer sets the status of the issue to "reviewing".
  4. Reviewer pulls the issue1000 branch into their own repository.
  5. Reviewer reviews the code. If reviewer is not satisfied, go back to step 2.
  6. Reviewer closes the issue1000 branch.
  7. Reviewer merges the issue1000 branch into the default branch.
  8. Reviewer pushes the issue1000 branch and its merge into the master repository.
  9. Reviewer sets the status of the issue to "resolved".

Tips and tricks

The following Mercurial extensions are highly recommended. You can enable them by adding the mentioned configuration lines to either your ~/.hgrc file (to enable the extension for all your Mercurial repositories; recommended) or to the .hg/hgrc file of a particular repository (to enable the extension just for this repository). All of these extensions are shipped with Mercurial by default, so you don't need to install anything.

Colored output from Mercurial

The color extension colorizes the output of hg status, hg diff and similar commands. Activate it with

[extensions]
hgext.color =

If you don't like the default colors, they can easily be customized. See the documentation for the http://mercurial.selenic.com/wiki/ColorExtension.

Graphical diffs from Mercurial

The extdiff extension allows us to integrate Mercurial with graphical diff tools such as meld. To set it up, run

sudo apt-get install meld

if necessary and add

[extensions]
hgext.extdiff =

[extdiff]
cmd.meld =

to your Mercurial config. You can then use

hg meld

instead of hg diff to obtain graphical diffs. (When using hg meld to merge code, make sure to check the filenames within meld to ensure that your modifications end up in your working directory rather than in temporary directories created by Mercurial.)