Question

Currently my company is using cvs for version control. I want to use mercurial locally because of it's flexibility and merging capabilities. This will make my job a lot easier.

How should this be done?

Was it helpful?

Solution

First: Get the CVS repository locally.

Second: Create a mercurial repositories locally over this CVS repository. This will be used as your remote mercurial server.

Third: Clone this mercurial repository and do you work here.

Mercurial provides better merge support than cvs and will make your work easier. Commit back to CVS needs an extra step. Here is how this works, step-by-step. The workflow looks complicated, but is actually easy. Keep the flow-charts close.

1) Local CVS repository: Create a local repo with CVS checkout.

2) Remote HG repository: Make a mercurial repo over this CVS repo. (HG init; HG add; HG commit). The repo will be used like a remote mercurial repository. Keep this folder clean and use this only to transfer files from-and-to CVS.

3) Local HG repository: Create a new folder where you will do all your work. (HG clone). Add all CVS files to the hg-ignore-list.

4) Development: Do the work here and ‘hg add/commit’ when needed.

Preparation before pushing your work back to CVS: (step 5-8)

5) CVS update: (local CVS repository = remote HG repository)

CVS update: Update the local CVS repository

hg commit: Commit the CVS updated code in the remote mercurial branch

hg update: Update your working copy to make the CVS changes active.

6) HG pull: Check for changes on your local mercurial repo and pull the changes.

7) HG merge: Merge all CVS changes on your local mercurial repo. Most changes will merge automatically.

8) HG commit: Commit your changes after merge.

Now you are ready to push your work to the remote HG repo and CVS.

9) Local HG push: Push your local work to the remote repo.

10) Remote HG update: Update to let your working copy view the pushed changes.

11) CVS commit: Commit the changes in your remote mercurial repo to CVS with a CVS commit.

2 view on this work: Step-by-step: step-by-step Container view: Container view

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top