All Unkept
Posted in: Python, Software development  —  12 February 2010

Eclipse and Mercurial with existing checkout

One very nice thing about Emacs — that you don't appreciate until you try alternatives — is that it is very unobtrusive. It doesn't try to take control of any of your projects. It takes your code as it finds it, and works from there.

I'm trying to get MercurialEclipse or HgEclipse to work with my existing project. In switching to Eclipse, it was actually relatively easy to persuade it that my code can stay where it is on my disk, and doesn't need to live inside the 'workspace' folder — you can use symlinks or the builtin 'linked resources' feature.

But now I want to persuade it to recognise one of these source folders as a Mercurial checkout. It seems the only way to do this is to use the "import" feature, or "share" the project - both of which do the wrong thing.

My setup is that inside a workspace folder (call it workspace1), I have a project defined (e.g. 'Django'). This project has a .project file with a 'linkedResources' to include the actual source, which is elsewhere:

devel/
 django/
   hg/
     trunk/
 workspaces/
   workspace1/
     Django/
       src/ (defined in .project as a link to devel/django/hg/trunk)
     python2.5

I simply want the Mercurial plugin to recognise that 'src' folder as a Mercurial checkout, which it is already.

All attempts at reverse engineering settings files etc. have failed. Has anyone achieved this?

It would certainly make IDEs much more attractive if they didn't insist on trying to manage everything for you. I'm a big boy, I don't want them to hold my hand as if this was the first time I had used Mercurial or worked on a project. And I'm certainly not going to move my code about on the disk to satisfy some IDE - I might change my mind and use something else next month, or I might want to use more than one IDE on the same project. IDE metadata needs to be completely separate from my source code.

Comments §

§ On 12 February 2010, Oleastre wrote: 852
I uses Eclipse in a similar setup, except that my Eclipse .project file is in the same folder as my sources. so, it's something like:

devel/
 project/
   .project
   .settings/
   src/
   ...

workspace/
  .metadata/


.project and .settings folders resides in the project itself, but I just add them in .hgignore. (and if you uses global settings instead of project specific settings, .settings folder does not even exists).

For the rest (IDE settings), it resides in the workspace folder.

Many other IDE work in the same way: put some configuration directly in the project folder itself.

Add comment

Format:

  • Javascript has to be on to get past my spam protection, and cookies, and there is a delay, sorry for any inconvenience!
  • I reserve the right to moderate comments.