Question

How to version control a subdirectory of a Mercurial repo simultaneously in a CVS repo as a subdirectory?

The reason I need this is that a private project version controlled with Mercurial has a subdirectory of code and resources that happen to be useful for a global multi-person project, which is version controlled with CVS. I want to continue the development in the Mercurial repo, but when it's committed, I'd like it to propagate to CVS repo too. Occasionally other people will commit via CVS to this directory, I'd like to be able to get those revisions to my Mercurial repository as well. Any good solution to this senario?

Was it helpful?

Solution

We did this for an include directory at a company I worked at. What we ended up doing is forcing everyone to commit to the CVS repo. Then I wrote a cron job that would commit any changes made in the CVS repository into the relevant Mercurial repos. Our case was complicated by the fact that the Mercurial repository included an entire tree (not just the include directory). If I was to do it over again I would make the include directory a separate repository.

OTHER TIPS

Having the two repos together, related SO question: Mercurial and SVN side by side in same working directory?. So having the svn folders within the mercurial folder should not be an issue. Remember to add the .svn/ repo to .hgignore.

Propagating one when committing the other might be more complicated. The simplest way would be to commit/pull/sync to both separately. Once you sync the svn folder, the next time you commit the hg, the prev change will propagate to hg. And vice-versa. Since one repo is within the the other, it shouldn't be a problem to see the changes of each reflecting in the other.

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