a single project with HgEclipse (Mercurial) repository

This workflow is part of my DVCS blog series. If you don’t understand some steps, please read the first parts of the series.

The goal: a single project from Workspace with Mercurial Repository using HgEclipse

Most times your repositories will contain more then one project. How to do this is explained here for EGit and here for HgEclipse. But sometimes you only want to put a single project under control of a DVCS to use branching etc. This workflow will demonstrate how easy you can share a single project.

The short story:

  1. Share one project
    1. Share the project (create Repository)
    2. Add and commit ressources to Repository
  2. You’re done: a project in your workspace shares a Repository

the long story:

1. Share one project

1.1 Share the project (create repository)

Go to your Project from Package Explorer and right-click “Team -> Share project…“:

select “Mercurial” as Provider, from next Dialog only click “Finish“:

Now the Repository is created and the project decorated as “under version control”:

Ressources not yet in your repository are marked with a question mark, the project itself is marked as “new”.

1.2 Add and commit ressources to Repository

As next we have to add and commit the missing ressources to the repository. HgEclipse allows us to combine the “Add” and “Commit” steps. “Team -> Commit…” shows this dialog:

Please enter a message. It’s easy to commit all new (not added yet) files: if “Show untracked files” is checked, all are visible, if “Select all” is checked, all are added.

Hit “OK” and your first project is under Version Control. The project itself changed decoration from “new” into “default(tip)“.

2. You’re done: a project in your workspace shares a Repository

We can control the repository from “Mercurial Repositories” View:

…or you take a look at the file system, where you can see that the repository is created successfully into your Project – directory:

To solve the same task using Git / EGit: here’s the workflow.

This workflow is part of my DVCS blog series – an overview of all workflows can be found here.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s