I found an article talking about git's workflow here, And tried to apply it to my own hg project, seems that it's kind of mess when I create a branch for each feature, cause in git, the branch could be deleted, and in hg, it can only be closed. so this will lead to a huge amount of closed branches in the repo, and that's what I don't want to see.
later, I googled another article which talks about a Hg workflow here I tried it, and it seems good when I am the only developer of the project, but when I tried to add another developer, the history became a little complicated.
I tested this with three repos
1, Base
2, devA ---> stands for developer A's repo
3, devB ---> stands for developer B's repo
first I worked on devA, making changes on devA's default
branch, and bugfix's on devA's stable
branch. After that, I push devA to Base.
devA's graph:
in case the image broken, the text based graph is here:
@ summary: Merge with stable
|\ tag: tip
| | parent: 4:d2973e149720
| | parent: 5:3788143e99fc
| | date: Mon Jul 30 13:17:44 2012 +0800
| |
| |
| o changeset: 5:3788143e99fc
| | branch: stable
| | parent: 3:4a955d01ea44
| | date: Mon Jul 30 13:17:19 2012 +0800
| | summary: fix a bug in featureA
| |
o | changeset: 4:d2973e149720
| | parent: 2:8e106fcfa9bf
| | date: Mon Jul 30 13:16:46 2012 +0800
| | summary: finish featureA advance
| |
| o changeset: 3:4a955d01ea44
|/| branch: stable
| | parent: 1:7b81b986d485
| | parent: 2:8e106fcfa9bf
| | date: Mon Jul 30 13:16:01 2012 +0800
| | summary: Merge with default
| |
o | changeset: 2:8e106fcfa9bf
| | parent: 0:7d7dc422ec7c
| | date: Mon Jul 30 13:15:43 2012 +0800
| | summary: finish feature A
| |
| o changeset: 1:7b81b986d485
|/ branch: stable
| date: Mon Jul 30 13:14:49 2012 +0800
| summary: Create stable branch
|
o changeset: 0:7d7dc422ec7c
date: Mon Jul 30 13:14:21 2012 +0800
summary: Init commit
and then I switched to devB, because I want to emulate a parallel work, so I did not pull from Base, instead I begin to work on devB's default
branch, and do bugfix on devB's stable
branch.
devB's graph is similar with devA's graph
Here comes the problem, when I try to push devB's changes to Base, it said there is a conflict, and I need to merge it locally, I pulled the changes and then my history graph in devB became kind of messy because I got devA's default
and stable
so in devB there is now two default
branches and two stable
branches.
what confused me is how real projects use this kind of workflow, mecurial's branch graph is here. It seems pretty clean, but how did they do this?