Reputation: 1672
I have a number of eclipse projects that I'd like to have in two separate hg repositories.
I've managed to do this by first creating the two hg repository using TortouiseHg and adding, committing my projects to each of the repositories first. By doing that I now have two hg repositories with two projects in each.
Next I clone that repositories in Eclipse using MercurialEclipse. The projects appear as expected in Eclipse.
Example 1:
Eclipse workspace
|
|--Project 1
|--Project 2
|--Project 3
|--Project 4
But if I look in the directory structure it looks like this:
Example 2:
c:--
|
|-workspace
|
hgRepository1
| |--.hg
| |--Project 1
| |--Project 2
|
|
hgRepository2
|--.hg
|--Project 3
|--Project 4
when I want it to look like this.
Example 3:
c:--
|
|-workspace
|--.hg
|--Project 1
|--Project 2
|--Project 3
|--Project 4
Is it possible to have a single Mercurial repository and somehow clone it and have the projects appear directly under workspace directory, and not in a subdirectory?
Upvotes: 6
Views: 3053
Reputation: 548
I ran into this exact problem myself, and the solution isn't immediately obvious. This blog post has step-by-step instructions showing how to achieve what you're after: workflow: create and init multi-project repositories with HgEclipse (Mercurial).
In short, you want to:
You'll find you end up with the layout you want in Eclipse and the projects will all share the repository located in projects-folder.
Upvotes: 3
Reputation: 11
I know some people wont like my solution (and I know that it's been some time since this question has been asked) but here it is:
This has been tested successfully in CDT in Eclipse on linux. And I advise you to put in your .hgignore the files created by Eclipse to manage your projects.
I hope this helps.
Upvotes: 1
Reputation: 11933
I don't quite understand. You cannot clone the repo to inside of itself. Why can't you just make a hard copy of Project1 and Project2, creating 3 and 4?
Upvotes: 1
Reputation: 1323973
You shouldn't save project from an Eclipse workspace, or restore them in an Eclipse workspace.
Those projects (.project
, .classpath
, and other project specific resources) should be in their own directory, outside of the Eclipse workspace (and then imported into the workspace).
That way, any directory structure will be fine for importing the different project into a new Eclipse workspace.
Upvotes: 5