Changing projects SVN address in Eclipse Subversive - java

I just started using SVN, and I set up a repository, because everyone were saying that version control is important and having backup.
Now I had to make a first commit of my project, and I'm new to SVN, so it asked the URL and I gave it the url for my SVN+Project name, which is http://lalala.com/<MyProjectName>.
I thought this will be good, but then I discovered that my project was stored on the root folder in SVN, next to trunk branches tags etc.
But actually when I commit my project I want it to go directly to my trunk folder. So two questions...
1)How can I change the SVN address for my project in Eclipse Subversive?
2)How would I delete the folder that is on the root folder of SVN, should I just manually delete it?

1) If the special folders do not exist, use the SVN perspective to create them. Add your project root folder directly under trunk. Use Checkout As Project in the context menu in the SVN perspective. You may use Show Location Properties in the context menu to alter the URL.
2) Just delete the folder and commit
Good luck!

Related

Using Eclipse/Subclipse to manage SVN rather than TortoiseSVN

To date I have done all my management of SVN via TortoiseSVN. I would like to learn a bit more about how to use Eclipse/Subclipse. The main thing I am trying to figure out is the update. The issue is this that I need to update more then what is in the Eclipse project. Here is what things look like in Subversion:
trunk
Clients
EclipseProjects
Project1
Project2
Project3
Project4
Project5
Project6
Project7
JDK
SQLScripts
The issue is that while the Eclipse workspace only contains a few of the Projects# directories, to run the application one must drop to the command line and run it and the application uses ALL the projects. I also want to be updated the other folders that are at the same level as EclipseProject: Clients, JDK, SQLScripts.
Currently with TortoiseSVN, I simply go to the trunk and do an update. How can I do that within Eclipse when the trunk is not part of the workspace?
Subclipse can only operate on what is loaded into your Eclipse workspace. You have a few options here, not in particular order:
Checkout each project separately using Subclipse. Each project will be its own SVN working copy.
Checkout "trunk" using Subclipse. Just create an Eclipse "simple project" for this checkout. The individual Eclipse projects can then be Imported into your workspace. So projects will show up twice. Once as themselves, and once as a folder beneath the trunk project. If you want to update them all at once, you can take the Update on the trunk project. But you can still take actions on individual projects too.
Same as #2, but do the checkout of trunk using TortoiseSVN. And use TortoiseSVN when you update everything. You will need to do Team > Refresh to let Subclipse know you did something in TortoiseSVN. I would still use Subclipse and import those projects into SVN. Even if you do all your commit and update actions using TortoiseSVN, there are advantage inside Eclipse to having Subclipse installed and TortoiseSVN and Subclipse can both use the same working copy fine as long as they share the same SVN version.
I use all 3 of these approaches in different scenarios.
It's actually quite simple. All you'll have to do is check out the repository using Eclipse check out tool.
In Eclipse, open Window > Show View > Other..., select SVN Repositories. Click New Repository Location, enter your SVN url, username and password. Once the repository added, do Checkout and voilĂ .
A little advice based on my experience : do not check out the whole trunk! Because then you will have one big folder trunk in the Project Explorer and it's frustrating open three folders trunk > EclipseProjects > ProjectXYZ everytime to actually get to your project. It's also not very visually pleasant and ordered. What I recommend is checkout the ProjectX folders, Clients, JDK and SQL Scripts folders separately. You'll have a nice flat hierarchy like this :
Clients
Project1
Project2
Project3
Project4
Project5
Project6
Project7
JDK
SQLScripts
Remember that using this technique, anything outside the scope of these folders (e.g. trunk/EclipseProjects/log.txt) won't be taken into account. If you have anything like that, you can always put it in the separate subfolder of trunk and treat it the same way as others.

SVN synchronize an uncomitted project with the repository

I have a project say Project in my eclipse workspace which I commit on an svn repository. When I make some changes in my local copy, I can easily integrate those changes with the project->right click -> team -> synchronize with the repository option. But in case I have another project name Project (same name for both projects) in another workspace say workspace2 which is not connected to svn and I want to synchronize it with the same project on svn repository How should I do it? Because the only choice in this case is project->right click->team -> share project or apply patch. To share this project I will have to commit it but in this case the contents of the project already available on svn repository will be lost. I want to merge the two projects such that the useful content of both is merged and the merged copy is available on the svn repository. Any help will be highly appreciated. Thanks in advance.
SVN can't automatically merge a SVN project with one that wasn't originally checked out from SVN. To merge two branches of a project, SVN needs to know which branch each change was made on. Otherwise it will just see the differences between the two sides, but won't have any way to know which side to keep. It can only do this if it has the history of each side's changes, which in this case you don't have.
What I would do is just diff the two projects, look at each change yourself, and decide whether to copy it into the SVN project. Start by backing up the non-SVN project, and committing any changes to the SVN project, so you have a clean place to revert to if you mess up. Then select both projects and do Compare With > Each Other. It will show you all the files that are different. Double-click each file to see the differences within the file, and copy them to the SVN side if you want to keep them. Then if everything looks good, you can commit it, and get rid of the non-SVN version.

How to use TortoiseSVN together with Eclipse

I want to use TortoiseSVN together with Eclipse.
For now I just want to try it out.
So I use a local folder as repository.
I have installed TortoiseSVN 1.7.13.
I created a folder called 'REPOSITORY' and chose 'Create repository here' from
the context menu.
As other websites told, I installed Subclipse 1.8.22 in Eclipse.
I use the SVNKit1.7.9 as client or connector (Whatever it is called).
I had already some projects in eclipse's workspace.
From the context menu I chose 'Team->Share Project'.
That is what other websites told to do.
It did show the normal commit dialog and so on.
The projects are marked as commited but the folder 'REPOSITORY'
is still small in size.
It seems, that the projects where not copied or moved to the repository.
At work we have a server based SVN. I just want to have something like that at home.
Did I miss something?
Isn't it the purpose of the SVN repository to hold a copy of the projects?
So the commited projects should be inside the REPOSITORY, right?
Greetings
Mike
Apparently, you have to manually import the project in Eclipse into the repository created with TortoiseSVN before actually committing to it.
This other page might help you. It gives a very detailed walkthrough of how to set up exactly the kind of local system you want. In essence:
In Eclipse, delete the project but not its contents (Delete project contents on disk unchecked). This will leave the project's folder under your workspace location untouched.
Outside Eclipse, import the project folder into the repository previously created with TortoiseSVN (Right click on folder > TortoiseSVN > Import and select the URL of the repository). Once imported, you may wish to delete the project folder.
Back in Eclipse, checkout the project from TortoiseSVN's repository (e.g. Right click on Package Explorer > Import.. > SVN > Projects from SVN).
Hope that helps.
If your project's folder structure and package structure are the same, you can use Eclipse Subversive. It's just a plugin for eclipse and provides all features of TortoiseSVN

What does it mean share project in STS?

I have imported project with Maven. But Subclipse didn't recognize that project already in SVN (I don't see pictogram barrel). For team in context menu I see 2 options:
Apply path
Share project
Which one I must select? In SVN repository there is already project made by other persons.
And I also made checkout by Tortoise. So I need only to recognize SVN local repository by STS.
Sharing the project should make it detect that .svn directories already exist, and should propose you to keep these files and use the information they contain to establish the SVN configuration of the project.
svn is a versionmanagement system. if you got old code and someone released a newer version you can apply a patch. you can share your project on cvs svn and git. like github or google project.
you need to go to new svn repoository and select the one of your project. then you can checkout project as new project. maven is for dependencies, not for code manipulation

Why is Eclipse trying to copy my .svn folders from src to bin, and how can I make it stop?

I have checked out a bunch of java code using subversion 1.6 and then I imported those projects into eclipse. Subclipse 1.6 picked up the fact that the plugins are under version control, except for a few folders.
I now get a bunch of errors like:
The resource is a duplicate of
src/.svn/all-wcprops and was not
copied to the output folder
If I delete the project (from eclipse not on disk) and reimport it, that fixes the problem about half the time. But since I have dozens of projects that are having this problem, it means reimporting them 10-20 times before I get them all working. This is very painful, and I am tired of doing it every time someone adds a new plugin to svn or when I need to recreate a workspace for some reason.
Is there an easier way to fix this than delete and reimport? Or is there a way to prevent this problem in the first place?
Add the .svn folder to the Excluded list for your Source Folder.
Project->Properties
Java Build Path
Source tab
Select 'Excluded'
click
Click next to the Exclusion patterns section on the bottom
Add the .svn folder and any others that do not need to be copied to the output directory
Follow the procedure described by Kelly but define the exclusion pattern as **/.svn/*. This will recursively exclude all .svn directories from the various source folders.
This is happening because you checked out a project using an SVN client other than Eclipse and then imported the project in Eclipse and you haven't notified Eclipse that this is an SVN project (that is, Eclipse doesn't know it has to ignore the SVN meta information).
In order to fix this properly, after you have imported the project in Eclipse, have Eclipse be 'aware' of the SVN nature of the project. Do so by
Select the project and go to the Team > Share section.
A dialog will appear asking weather this is a CVS or SVN project. Select the later.
It will prompt for the credentials, enter them.
When you're done, do a clean build. The problem goes away.
Easier way to do this is:
Project > Properties
Resource > Resource Filters > Add...
Filter type > Exclude all
Applies to > Folders
Check All children (recursive)
File and Folder Attributes > Type ".svn"
Hit OK and OK again
Clean/build
------------ Simple way of filtering the output folder-------------
Window->Preferences->Java->Compiler->Building
Make sure "Filtered Resources" includes ".svn/"
The "accepted best answer" described the cause to me, but as my project was already shared, I 1. closed the project, 2. opend it again and 3. cleaned it. The .svn folder is gone and does not come back.

Categories