How to design for the following requirement
Nicolas Dumazet
nicdumz at gmail.com
Fri Aug 28 04:19:45 CDT 2009
Hi!
2009/8/28 Adrian Buehlmann <adrian at cadifra.com>:
> On 27.08.2009 20:16, Jatin wrote:
>> Main Repository - Add new Features to the project.
>> Clone Repository - Clone a "workable version" from Main repository. Change
>> this only for bug fixes i.e. no new features from Main Repository must
>> appear here.
>
> That's fine. It's done on mercurial development itself like that as well.
>
> Your "clone repo" is usually called the the "stable" repo -- it contains
> only bugfixes (no new features) and is a strict subset of the main repo.
>
Adrian has been faster than me :)
> Mercurial repos (as an example):
>
> stable: http://selenic.com/repo/hg-stable
> main: http://selenic.com/repo/hg
>
>> In this set up, when some bugs are fixed in the workable version, I will be
>> pushing the same to the main repository. This seems to work for only the
>> first push of workable version(clone) to main repository. Subsequent pushes
>> result in error "push will not be performed as it will create remote
>> branches. You must first resync by doing a pull from target repository and
>> Merge".
>
> Pull stable into main. This will add a new head to main, which is fine.
>
> Then merge and commit. This will merge the two heads into one again, creating
> a merge changeset (merge changesets have two parent revisions).
>
> As an example in the mercurial repo itself, look for changesets with change
> messages like "merge with...".
>
> See also http://mercurial.selenic.com/wiki/UnderstandingMercurial
>
In clear, as long as you are creating new features, assume that you
can't write to stable.
Never try to push to stable: you will always pull stable into main,
including in the unstable repo the bugfixes. As Adrian wrote, that
should create a new head:
State in main:
@ e7fe439b6432
| new feature #2
|
o e0a38341b297
| new feature
|
o 9e854e0b7ef1
initial state
State in stable:
@ 98422760d220
| bugfix, in stable
|
o 9e854e0b7ef1
initial state
Now, if you pull stable into main, it will create a new head in main:
@ 98422760d220
| bugfix, in stable
|
| o e7fe439b6432
| | new feature #2
| |
| o e0a38341b297
|/ new feature
|
o 9e854e0b7ef1
initial state
Merge it:
@ c3fae6eb6c41
|\ merge with stable
| |
| o 98422760d220
| | bugfix, in stable
| |
o | e7fe439b6432
| | new feature #2
| |
o | e0a38341b297
|/ new feature
|
o 9e854e0b7ef1
initial state
And you can go on like this.
When you want to release the new features, just pull main into stable :)
>
> [snip]
>
--
Nicolas Dumazet — NicDumZ
More information about the Mercurial
mailing list