aspose file tools*
The moose likes IDEs, Version Control and other tools and the fly likes Eclipse work directories ...how ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Eclipse work directories ...how ?" Watch "Eclipse work directories ...how ?" New topic
Author

Eclipse work directories ...how ?

Jason Wylde
Ranch Hand

Joined: May 25, 2009
Posts: 30
Hi,
I'm wondering is there an easy way to setup "work" directories when using Eclipse. I would like to basically "check out" my code to a work directory and once it''s done and tested I could check it in. This would also allow me the option to do any quick fixes and not include my changed/un-tested code in an emergency fix. I am using SVN but I don't think there is a way to do this with it.
Any suggestions would be great !


Thanks
Jason
Aurelian Tutuianu
Ranch Hand

Joined: May 13, 2004
Posts: 86
Why don't use branches on svn? Is much safer
(Maybe I don't understand your problem )


http://javasign.blogspot.com/
Jason Wylde
Ranch Hand

Joined: May 25, 2009
Posts: 30
I was unaware of branches but I'll look and see if they will work for me. Basically I want to do the following:

- Have a way so I can make changes to objects that makes it easy if I need to not include those changes in a build. For example I'm working on changes but an emergency fix is required. Well , I don't want to include my code that I've been working on because it's either not complete and/or untested. How can I resolve this ?

In other languages I would have a "working" directory ( or location , package , etc ...) where I would have the checked out version of my objects I am changing and only when I was done I would check those back in. This would allow me an easy way to build or compile my code at any time.
Kevin McMahon
Greenhorn

Joined: Nov 03, 2008
Posts: 19
Yes, branches in svn or cvs sound like a good match for this. You could develop your normal code in a branch, do fixes and continue to deploy from head, and once you are happy with the branch code, you can merge it back in to head. If the development process of the branch is quite long, you might want to periodically merge changes from the head in to the branch too. This keeps your branch "up to date" without adding your new code to the releases.

Alternatively, if a quicker solution is required, why not check the code out to another project in eclipse (called patches or something) then develop your fixes there, and develop your changes in your normal project. You can synchronise the patches project as often as you like - just don't synch the original project.
Your main project code isn't maintained in your version control software until you are ready to check the whole thing in then tho...

Jason Wylde
Ranch Hand

Joined: May 25, 2009
Posts: 30
Thanks a lot for the ideas !!! I will look into these.
Jason Wylde
Ranch Hand

Joined: May 25, 2009
Posts: 30
I tried to branch some code to a "branches" folder but Eclipse gives me an error saying it already exists. The folder does exist ( we have an empty "branches" folder but I'm not sure what I'm supposed to do. I tried branching to another folder and it then says that folder already exists. If I select a folder and then type a new folder name at the end Eclipse crashes.

We are using Eclipse 3.2. Any ideas ?


Thanks in advance !

Kevin McMahon
Greenhorn

Joined: Nov 03, 2008
Posts: 19
Er... no, you don't "branch" in eclipse. You branch your codebase in your repository (subversion)
Eclipse can then work with either code from the head or the branch.

If that isn't making sense, read the Subversion documentation about branching, and then the subversion plugin documentation.

The other idea I referred to (having two projects in eclipse) doesn't use branching - you just have two copies of the code locally in two different eclipse projects.
Jason Wylde
Ranch Hand

Joined: May 25, 2009
Posts: 30
Ok , I think I got it to work in Eclipse. However , I have switched ( Team > Switch to another Branch/Tag/Revision ... ) but how do I switch back and forth between my Branch code and my Production code ?
Kevin McMahon
Greenhorn

Joined: Nov 03, 2008
Posts: 19
Head -> refers to the main code stream
Branch -> refers to your branch.

Eclipse has menu to allow you to switch between branch and head.
Aurelian Tutuianu
Ranch Hand

Joined: May 13, 2004
Posts: 86
I think is better to read first something about svn to understand what is about. You can't learn putting questions here. Too many questions to put. Is a friendly advice, don't understand that I don't want to help.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Eclipse work directories ...how ?