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 development phase, every developer, 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 develop branch, it named as feature/<name>. And switch to this branch automatic.

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 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 equals 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 go live, the code should be checked very carefully. It the testing phase.

Using 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 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 used for small and quick iteration 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 start a new feature branch, you can specific 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 start a new release branch, you can specific 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 start a new hotfix branch, you can specific 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

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.