How to design for the following requirement
Adrian Buehlmann
adrian at cadifra.com
Fri Aug 28 08:44:10 UTC 2009
On 27.08.2009 20:16, Jatin wrote:
> I am trying to achieve following mercurial design on my machine.
>
> I have a main repository on which I am working. I have cloned the main
> repository at some point realeasing a workable version and after that I have
> added some more new features in the project(main repository) . At the same
> time, I am fixing bugs on the released version (clone). I fix the bugs and
> provide patches to the user. I don't wan't to include the new features from
> the main repository on the "workable version"(clone). In short I am trying
> to achieve this.
>
> 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.
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
> Now I dont wan't to resync the clone with the main repository, as I don't
> want the new features added in main to appear in clone. I am relatively new
> to mercurial, so this seems to be some design issue. What I am doing wrong
> here. Why can't I keep pushing from clone to main repository as and when
> needed.
See above.
> Note that there is only one pc holding main and clone.
That's fine. A repo can always be cloned to everywhere you want it.
You can pull from local repos as well as from remote repos (if there is
a server running on the remote side).
See hg help pull.
Just make sure you have backups in case your PC dies. Use hg verify
to check the backups.
More information about the Mercurial
mailing list