How to install "flow" extension
The best way to have an "up to date" extension is cloning it from "bitbucket.org".
hg clone https://bitbucket.org/yujiewu/hgflow
|
So, on my local I have something like
Now you need to create a symbolic link to the Flow file (or you can you use it directly in your hgrc configuration file)
cd /opt
mkdir hgflow
cd hgflow
ln -s /home/YOUR_USER/dev/hgflow/src/hgflow.py
|
Edit "hg" configuration file:
<PROJECT_DIR>/.hg/hgrc (or
%USERPROFILE%/Mercurial.ini on Windows)
[extensions]
flow = /opt/hgflow/hgflow.py
mq =
[flow]
autoshelve = true
|
Initialization and configuration
You have to initialize hgflow for every repository where you want to use hgflow.
$ cd <my_repository_dir>
$ hg flow init
|
The
flow init command will create a configuration file:
.flow
in the root dir of the repository. Before doing so, it will ask you
branch names or prefixes for each basic stream. Type your preferred
names or press return to use the default.
Branch name for master stream: [default]
Branch name for develop stream: [develop]
Branch name prefix for release stream: [release/]
Branch name prefix for feature stream: [feature/]
Branch name prefix for hotfix stream: [hotfix/]
Branch name prefix for support stream: [support/]
|
Since the configuration file is tracked by
hg,
if you have multiple existing branches, hgflow will need to write the
configuration file in each open branch. This will be done automatically
by
hg flow init command.
How to work with features (Weiterentwicklung)
Start a feature
hg flow feature start <name>
|
This command will create a new feature branch based on develop branch, it named as
feature/<name>. And switch to this branch automatic.
Finish a feature
hg flow feature finish <name>
|
This command will
close the feature branch
feature/<name>. The content in this branch will merge to
develop branch.
Abort feature
Maybe you realise that you create a new branch but with the wrong name, don't worry, you can abort it on this way:
hg flow feature abort <my-wrong-feature>
|
Switch between feature branches
hg flow feature switch <name>
|
This command will switch the branch between feature branches. It will switch into
feature/<name> branch.
This command is equals as `hg update feature/<name>`.
How to see feature branches
How to work with releases
Now
that we’ve done some feature developments we’re essentially ready to do
a deployment of our code to production. Before we can do this we would
want to go through some kind of process where we do some usability
testing or some kind of QA.
Start a new release
hg flow release start <release-name>
|
Start a feature inside a release branch
hg flow release/<release-name> start <feature-name>
|
Finish a feature inside a release branch
hg flow release/<release-name> finish <feature-name>
|
Display releases
This command lists all the current release branches. To make things easier you should only have one of these open at any time.
Close a release branch
Once
the release has been done and your operations team has deployed the
release candidate to "production", you should run the following:
hg flow release finish <release-name>
|
How to work with hotfix
I
hope that you’ve realized that there isn’t much of a difference in the
process that is followed when doing the various types of development.
This is the beauty of using the workflow. You can do develop in a
consistent manner and using Mercurial Flow extension makes the workflow
fairly easy to follow. There are a few snags in the process that can
break things down for you, but that’s only if you don’t follow it
correctly or you try and take some shortcuts.
Start fixing production code
Once
you have discovered a bug in production and it needs to be solved as
soon as possible, you can start doing it by running the command below:
hg flow hotfix start <hotfix-name>
|
The <hotfix-name> could be the JIRA code, to make it easier for the whole team.
Close a hotfix branch
The
process being followed by this command is the same as it was done at
the release end. Once this has run, it will merge the changes you’ve
made back into "master" as well as "develop" branch, so this process
ensure that those changes get released with the next major release and
the problem doesn’t come back. To run this command you should run:
hg flow hotfix finish <hotfix-name>
|
Extended information here ->
https://bitbucket.org/yujiewu/hgflow/wiki/Home.wiki#!installation
No comments:
Post a Comment