1. yinwm
  2. hgflow

Wiki

Clone wiki

hgflow / UserManual

Home > User Manual

Install hg flow

Clone the repository or choose one of the downloads from the download page.

Editing your .hgrc file

  • *nix/Mac: /.hgrc
  • Windows: %HOME%/mercurial.ini

Adding the following content

[extensions]
hgflow = /PATH/TO/hgflow.py


Commands

Initialising your project

hg flow init


You will be asked to name your different branches, but the defaults should suffice.

Branch name for production release : [default] 
Branch name for "next release" development : [develop] 

How to name your supporting branch prefixes?
Feature branches? [feature/] 
Release branches? [release/] 
Hotfix branches? [hotfix/] 
Version tag prefix? [] 


Feature develop / Bugfix

In the development phase, every developer and/or group could focus on the code very separately. There will be less conflict in entire team.

Start a feature/bugfix

hg flow feature start <name>


This command will create a new feature/bugfix branch based on the develop branch. it will be named as feature/<name>. Hg will switch this branch automatically.

Finish a feature/bugfix

hg flow feature finish <name>


This command will close the feature/bugfix branch feature/<name>. The content in this branch will merge to the develop branch.

Switch between feature/bugfix branch

hg flow feature switch <name>


This command will switch the branch between feature/bugfix branches. It will switch into feature/<name> branch.

This command is equal to `hg update feature/<name>`.

Close feature/bugfix (Todo)

hg flow feature close <name>


Close this branch and drop the code.

To release the code

After the feature development/bugfix, the workspace is about to release to production environment. Before going live, the code should be checked very carefully. It the testing phase.

Using the release branch, we divide the release and new feature develop (not in this release version) into two code base and goes separately.

Start to release

hg flow release start <name>


This command will create a new branch named release/<name> based on develop branch, and switch to this branch automatically.

To start the release branch, it means the workspace goes into testing phase. Any bug found in this release should be fixed here, the release/<name> branch.

There should be no new feature put into this release.

Finish the release

hg flow release finish <name> [tag_name]


This command will close this branch release/<name>, then do the following actions:

  • Merge into production branch default
    • If tag_name give, merge tag tag_name into production branch
    • If no tag_name here, merge branch release/<name> into production branch
  • Give a tag <version_tag_prefix><name>, like hgflow_v1.0
  • Merge branch release/<name> into develop branch develop
  • Close branch release/<name>

Close release branch (Todo)

hg flow release close <name>


Close this release, drop the code.

Hotfix

In sometime, there may be some problem on production environment. The hotfix is used to fix the hot bugs. It should be very quick, and stable is the top goal.

Start a hotfix

hg flow hotfix start <name>


This command will create a new hotfix/<name> branch based on production branch default, and switch into this branch automatically.

It is used for small and quick iteration/s on production code base.

Finish a hotfix

hg flow hotfix finish <name> [-r tag_name]


This command will close hotfix branch hotfix/<name>, then do the following actions:

  • Merge into production branch default
    • If tag_name given, merge tag tag_name into production branch.
    • If no tag_name given, merge branch hotfix/<name> into production branch.
  • Give a tag named <version_tag_prefix><name>, such as hgflow_v1.1
  • Merge branch hotfix/<name> into develop branch develop
  • Close this branch hotfix/<name>

Close hotfix branch (Todo)

hg flow hotfix close <name>


Close hotfix branch and drop the code.

Short command

Start / Switch

hg feature <feature_name> [-r revision]

If the feature branch `feature_name` exists, switch to the branch. Otherwise create the branch.

When starting a new feature branch, you can specify a revision. If so, the new started branch will be created based on the revision

Finish

hg feature -f/--finish <feature_name>

Finish the feature branch.

Start / Switch

hg release <release_name> [-r revision]

If the release branch `release_name` exists, switch to the branch. Otherwise create the release branch.

When starting a new release branch, you can specify a revision. If so, the new started branch will be created based on the revision

Finish

hg release -f/--finish <release_name>

Finish the release branch.

Start / Switch

hg hotfix <hotfix_name> [-r revision]

If the hotfix branch `hotfix_name` exists, switch to the branch. Otherwise create the hotfix branch.

When starting a new hotfix branch, you can specify a revision. If so, the new started branch will be created based on the revision. The version should be in the release branch.

Finish

hg hotfix -f/--finish <hotfix_name>

Finish the hotfix branch.

Updated