Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of Machine Learning for Business: Using Amazon SageMaker and JupyterE this week in the Jython/Python forum
or Object Design Style Guide in the Object-Oriented programming forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

Eclipse work directories ...how ?

 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why don't use branches on svn? Is much safer
(Maybe I don't understand your problem )
 
Jason Wylde
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot for the ideas !!! I will look into these.
 
Jason Wylde
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Is this the real life? Is this just fantasy? Is this a tiny ad?
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!