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:
- Share one project
- Share the project (create Repository)
- Add and commit ressources to Repository
- 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.