Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Using Workspaces With Feature Branches(Advice on hoe to use Eclipse workspaces with different revisions/branches of the same project)
Using Workspaces With Feature Branches [message #719495] Sat, 27 August 2011 13:43 Go to next message
Stefan Adelbert is currently offline Stefan Adelbert
Messages: 1
Registered: August 2011
Junior Member
I've been aware of Eclispe for a long time, but have only recently started using it for C++ and Python projects (switching from Visual Studio 2008). I normally work on a few feature branches of the same project at any one time and was wondering how best to use Eclipse workspaces in this case.

Let's say that I have a project called MyApplication and I have branchA and branchB of the MyApplication checked out at ~/dev/MyApplication, i.e.

~/dev/MyApplication/branchA/...
~/dev/MyApplication/branchB/...

I would like to keep the Eclipse window arrangement and various settings and preferences consistent when switching between working on branchA and branchB. But I want those settings and preferences to be particular to me, i.e. I don't necessarily want to check them into the source repository.

MyApplication has a number of sub-projects (e.g. shared libs lib1 & lib2; executable exec3) with interdependencies. So the directory structure would actually look something like this:

~/dev/MyApplication/branchA/lib1
~/dev/MyApplication/branchA/lib2
~/dev/MyApplication/branchA/exec3

~/dev/MyApplication/branchB/lib1
~/dev/MyApplication/branchB/lib2
~/dev/MyApplication/branchB/exec3

Should I checkout branchA and branchB into the same Eclipse workspace? Or should I have a separate workspace for each project and then switch workspaces when I want to work on a different branch?

I could imagine having one Eclispe workspace for MyApplication and then having many different revisions/branches of MyApplication checked out into that one Eclipse workspace. All the paths for interdepencies between sub-projects would need to be relative, I suppose, i.e. not using ${workspace_loc}.

Any advice would be appreciated.
Re: Using Workspaces With Feature Branches [message #719512 is a reply to message #719495] Sat, 27 August 2011 14:58 Go to previous message
David Wegener is currently offline David Wegener
Messages: 1344
Registered: July 2009
Senior Member
On 08/27/2011 08:43 AM, Stefan Adelbert wrote:
> I've been aware of Eclispe for a long time, but have only recently
> started using it for C++ and Python projects (switching from Visual
> Studio 2008). I normally work on a few feature branches of the same
> project at any one time and was wondering how best to use Eclipse
> workspaces in this case.
>
> Let's say that I have a project called MyApplication and I have branchA
> and branchB of the MyApplication checked out at ~/dev/MyApplication, i.e.
>
> ~/dev/MyApplication/branchA/...
> ~/dev/MyApplication/branchB/...
>
> I would like to keep the Eclipse window arrangement and various settings
> and preferences consistent when switching between working on branchA and
> branchB. But I want those settings and preferences to be particular to
> me, i.e. I don't necessarily want to check them into the source repository.
>
> MyApplication has a number of sub-projects (e.g. shared libs lib1 &
> lib2; executable exec3) with interdependencies. So the directory
> structure would actually look something like this:
>
> ~/dev/MyApplication/branchA/lib1
> ~/dev/MyApplication/branchA/lib2
> ~/dev/MyApplication/branchA/exec3
>
> ~/dev/MyApplication/branchB/lib1
> ~/dev/MyApplication/branchB/lib2
> ~/dev/MyApplication/branchB/exec3
>
> Should I checkout branchA and branchB into the same Eclipse workspace?
> Or should I have a separate workspace for each project and then switch
> workspaces when I want to work on a different branch?
>
> I could imagine having one Eclispe workspace for MyApplication and then
> having many different revisions/branches of MyApplication checked out
> into that one Eclipse workspace. All the paths for interdepencies
> between sub-projects would need to be relative, I suppose, i.e. not
> using ${workspace_loc}.
>
> Any advice would be appreciated.
In many ways this depends on personal preference so you may get
different answers from different people.

My personal approach would be to have different workspaces for different
branches. It's pretty easy to create a new workspace. If you use the
File->Switch Workspace->Other option, you can use the Copy feature to
copy your perspective layouts. It even copies over saved perspectives
(Layout the windows the way you like them and then perform Window->Save
Perspective As). This allows you to have both workspaces opened at the
same time to quickly switch between them. You can also use
File->Export/Import->Preferences to copy prefs between workspaces.

An alternate approach would probably be to keep the branches in the same
workspace and use Working Sets. These allow you to group resources
together and filter displays based on them. In this case, I believe you
need to do a little more management of the projects. I don't think
Eclipse allows two projects with the same name. I think you would need
to give each branch a different name.

In determining which preferences to share and which not to, take a look
at Project Specific Preferences. When you enable a preference on the
Project level, it will be saved in a .settings directory in the project.
You can then check this file into your SCM in order to share it with
the rest of the team. This is helpful for maintaining coding/formatting
standards.
Previous Topic:Multiple Source Folders in a Project
Next Topic:searching files for a string
Goto Forum:
  


Current Time: Wed Oct 22 23:56:51 GMT 2014

Powered by FUDForum. Page generated in 0.02531 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software