Frage

I have access to an existing Mercurial repo located at merc.myorg.com/hghome. I have been asked to whip up a simple Java tool and commit it to the repo under hghome/myapp. I have never used Mercurial before, and would like to accomplish the following:

  • Write the code in Eclipse
  • Use the MercurialEclipse plugin to get the sourcecode (myapp) up under hghome

My first thought was to write all the code in an Eclipse project, and then try to connect to hghome somehow and push/copy all the code up to the server at the desired location. But then I figured that I probably can't push code to a repo/sub-repo (hghome/myapp) that doesn't exist yet. So it feels like a chicken-and-the-egg sort of problem.

Let's pretend that myapp is a simple (Eclipse) Java project with the following directory structure:

myapp/
    src/main/java/ (Source Folder)
        com.myorg.myapp (Package)
            MyApp.java
    build.xml

I have already installed Mercurial and the MercurialEclipse plugin. What are the exact steps I need to take to accomplish writing this, and getting it checked into a new repo at hghome/myapp?

War es hilfreich?

Lösung

If I understand correctly you want to have an Eclipse project in a sub directory of a larger repository. I think there is no reason for you to use "subrepositores", instead you can use the single monolithic repository.

  1. Using MercurialEclipse or another tool clone merc.myorg.com/hghome
  2. Create the sub directory myapp and in it create an file with the name ".project"
  3. In ".project" add appropriate Eclipse project configuration. For example <projectDescription><name>myapp</name>[...]</projectDescription>.
  4. Commit ".project" and push it to the central server.
  5. Using MercurialEclipse clone merc.myorg.com/hghome again. This time on the last page it will allow you to import "myapp" as a project. It will show up in your workspace as an empty project.
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top