How to configure svn on eclipse - eclipse

1.
I m trying to install svn on eclipse by going on Help-Install New softwares but I am always getting error message you could not connect .so is there any another method ?
2.
Also I have downloaded subversion on terminal also I am able to do checkout ... but i am unable to commit any changes error says that 'https://svn.hostname.in/~dirmane/test' is not a local path
on typing following:
svn commit https://svn.hostname.in/~dirname/test

For your second question:
svn commit takes a path to your local working copy. The repository is not needed (in fact, not allowed) because your working copy is always associated with the same repository URL.
For example, if you have a working copy in C:\Temp\MyProject, which you got by doing svn checkout http://example.com/svn/project C:\Temp\MyProject, then you would commit any changes with svn commit C:\Temp\MyProject. Even better, change directories to C:\Temp\MyProject and you don't even need to specify a path: svn commit
Please only ask one question at a time...I have no idea about the first.

Related

Is it possible to share a project without commiting?

I'd like to use "Share Project..." in Eclipse without actually commiting to SVN. Unfortunately, I am not able to find an option for doing this.
Instead, I want the relevant files only be added to SVN.
My goal is, that SVN should track all the files I move into the project using the package explorer.
Share Project needs to accomplish two things:
It sets up some internal linkage in Eclipse that connects your project with the SVN Team Provider so that SVN menu actions are exposed and so that activities you perform are routed to the SVN provider to "handle".
It has to establish your project as SVN "working copy" so that the SVN API that needs to be called on behalf of your actions can do what it needs to do.
So the key here is that if you already have a SVN working copy then Share Project will recognize this and be able to do option 1 without needing to do anything else. But otherwise, it has to establish a working copy which requires it to do svn checkout from your repository. If it has to create the working copy then it makes the assumption it needs to create the project in the repos and then check that out on top of your local project. So the one commit it will do is a svn mkdir for a folder in the repos.
If you do not want to do that, then do something to establish a working copy locally before you get started, such as checking out some existing location in your repository. As others have noted, you may want to be using branches and switch if you are refactoring something that already exists.
When you commit data to the SVN repository, you publish this new data or make changes to existing data (i.e. you make your changes available to others). Therefore, you need to commit your changes if you want others to see it in your SVN repository and collaborate.
As far as I recall, "Share Project" command in Eclipse is designed to import your non-versioned project to the SVN repository (i.e. make a first-time import) -- it converts your local data into a working copy and commits it.
I do not understand what exactly you mean by "share but not commit" (you may want to elaborate). However, you can always select which files to add and commit or import into the repository, but I guess that you will need to use standalone SVN client outside of Eclipse.

Subclipse SVN first commit ignore certain directories

Decided to take the jump from CVS to SVN.
I setup a new repository in subclipse for my project. When I go to 'Finish' the setup it wants to do an initial commit and presents me with a flat list of files to select the files for version controlling.
The problem is I have thousands of generated binary files I dont want to commit.
So I click on cancel because it would take me all day to go through and unselect all the unwanted files. Annoyingly when I click on a parent category for the files I want to ignore it is not recursive!
So I click cancel then go to the eclipse directory structure for the project and manually set svn:ignore on all directories I want to ignore. Then I try and do a commit again and all the files are once again presented - ignore seems to have done nothing.
Can anybody point out what I might be doing wrong?
For the first commit, I recommend writing a small script to delete (of course you'll have a backup) all the files that are not meant to be committed.
Afterwards, if you find you accidentally committed a file, you can
svn delete file
Upon the first checkout, copy back (or better yet, regenerate) all the binary files. This will trigger svn to notice that your local repository is out-of-sync with the remote repository.
cd <Root of local repository>
svn status
You will see lots of "to be added" items. Go to the parent directory and add in svn:ignore properties for each of the generated items.
cd build
svn propedit svn:ignore .
which will open an editor (if it doesn't, you need to set the environmental variable SVN_EDITOR to a suitable editor). Then you can add in entries that svn will know are not tracked.
(in the ignore property editor)
target
build
image*
*.o
(and so on)
Save the file, and it will be staged for the next commit. Subsequent runs of svn status will no longer show these files as "needing to be added", but they will show the directory as "needing to be committed (it's a revision on the directory)"
Quick Aside
So I'm not entirely certain exactly which functionality of Subclipse you were using in order to create a repo and share a project to it, I'm assuming you created like a file based repo through the eclipse SVN repo view and tried to share and then commit to it. It looks like your problem got solved but I did want to add an answer on here because I ran across this post looking for the answer to this same problem of handling initial commits even just in general with SVN and wanted to offer help to anyone else looking for the help.
Intro
To start off I would recommend not working through an IDE extension like this just for the initial commit as they can miss a lot of the options for handling opening a repo in SVN. I personally really like the command line form of SVN to work with but TortoiseSVN is a good option for a GUI.
Whether you create a local file-based repo or are connecting to an SVN server and you want better control over your first commit in an previously unversioned project here is what I've found as the best general workflow for doing so.
Create the remote folder to save to.
On command line this will be:
$> svn mkdir your-url-scheme://your-site-address.domain/path/to/repo/example-directory
Or on TortoiseSVN open your repo for browsing, right click, and select "create new folder"
This will give you a location in the SVN repo to checkout from for our next step.
Checkout in to the already started project
Make sure to use the empty, newly created folder in your repo to checkout with. SVN does not actually require a folder being checked out to to be empty, which is an important part of what makes it actually very flexible and able to subsume parts of your directory into it fairly easily if used correctly.
Now you will checkout this empty folder into the root folder of your already started project. This will add your project to the working copy of this folder without any commit being made yet. The command is:
$> svn co your-url-scheme://your-site-address.domain/path/to/repo/example-directory /your/projects/root/
"co" standing for checkout. In Tortoise svn you can right click on or in the empty repo folder and select "checkout..." and then select the project root.
Set ignores and commit
Finally, you can easily set your ignores on certain files before adding any other files to the tree using the command:
$> svn propset svn:ignore file-or-directory-to-ignore
And to add all non-ignored directories and files:
$> svn add * --force
The force is technically unnecessary in this case but ensures full recursion. You can also now do all of this in your file explorer if using TortoiseSVN or you can even use your IDE extensions to do this at this point(make sure to ignore all files you need to before mass-adding files for commit), all that's left is to make sure to commit the newly added files to the repo and you're up and running with source control :)
Added this method here simply because this method allows you to avoid any unnecessary copying of those stinky binaries that no one wants to lug around with them.

How does you Reconstruct SVN repository from working copy without losing svn history

My service provider changed URLs on SVN repository. We were unable to reconnect from Eclipse SVN plug-in.
Based on their suggestion, tried Share Project, which allowed us to redirect to new URL, but ended up screwing
up repository files.
Still have intact local copies with SVN state on a client machine.
Is there a way to build a new SVN repository and load in local working copy WITH SCN HISTORY intact.
When we did this with Eclipse plug-in Team prompts, it ending up recreating projects but lost the
original SVN change history, which we would like to preserve.
Thanks
If I understand your question correctly, the short answer is "no".
An SVN checkout does not donwload the complete history to your workstation. It just downloads the current state. When you make changes, it remembers what it downloaded so that it can compare what it downloaded to what you have now. So you could reconstruct "last revision" and "updates since last revision". That's about it.
Eclipse keeps track of edits, but I don't think it's going to remember edits across checkouts, because that's going to look like a new file. It has a finite buffer anyway.
If you were so fortunate that you have a directory where you checked out revision 1, and then you kept that and checked out revision 2 to another directory, etc, you could reconstruct the history. But few people do that because it would normally be pointless because the history is in SVN.
You can't get history from Working Copy, because WC is always only slice of repository
If SP inly changed URL and you can and know how to work with pure CLI SVN and WC as directory in FS - you can
switch or relocate working copy
or
checkout from new URL new project

SVN authorization failure, trunk non-existent in head revision, getting a GIT repository working in Eclipse

To simplify things, I have one local SVN repository D:\folder\repo_name and I have svnserve running as a service with root set to the mentioned path. Subclipse and SmartSVN can connect to the repository, also displays the correct head revision number, but when I try to explore the trunk (the only branch) it gives the following error: URL 'svn://localhost/trunk' non-existent in that revision. This while I can check out the complete repository perfectly fine. But I don't need the all the branches, I need just the contents of the trunk.
When I try to commit I get the error Authentication failed. However my credentials were fine when checking out earlier.
When I try to get my stuff out of there and move to GIT (which I suppose would be best as everything is always kept local), the git svn clone process completes, I see all my revisions and files pass in GIT Bash, and then try to import it in Eclipse. I see that it tries to import the project into the repository directory itself (see http://wiki.eclipse.org/Image:Egit-0.9-import-projects-general-project.png). Needless to say I get the error in the shape of D:\folder\repo_name_git overlaps the location of another project: 'repo_name_git' What I don't get is why I can't seem to find a single way to let me specify where I want the project to import into.
Alternatively, when I add the project in the git repository as an existing project into Eclipse, and then - through the Team > Share menu - try to get under version control, I get the error Can not move project to target location D:\folder\repo_name_git, as this location overlaps with location D:\folder\repo_name_git, which contains a .project file
I'm at a loss and these errors are to generic to give me an idea of how to tackle them. Any heads up would be appreciated.
2 points:
I was getting "Authentication failed" on "correct" credentials - except the plugin I used was forcing the first letter of my username to uppercase - check the case of your username (upper or lower).
I've just had a problem moving onto a Subversion 1.7 repository, which is not supported by my Subversive plugin, and I was getting some strange errors.
You need to check the credentials
make sure svnserve is not started with -R {readonly option}
Check if the following lines are commented in
"\REPO_NAME\conf\svnserve.conf
anon-access = read
auth-access = write
password-db = passwd"

SVN Merge conflict during commit

Eclipse + Subversive plugin
On commiting a directory which is out of sync with the SVN a message pops up:
Merge conflict during commit
svn: Commit failed (details follow):
svn: File or directory '.' is out of date; try updating
svn: resource out of date; try updating
Tried to update the whole project from Eclipse Navigator view (right click>Refresh or F5) and the problem still persists.
Is there something that can be done in this case?
You are mixing up two different operation in Eclipse:
Update (from version control)
and
Refresh
"update" means retrieve the most recent version of a file(s) from the version control system. "Refresh" just means that Eclipse will update its view of the local filesystem, in case a file was changed outside Eclipse.
You need to do an update (Team->Update).
You should update, resolve conflicts, then commit again.
See this link for help on resolving conflicts in eclipse.
Sometimes eclipse+subversion gets a bit lost and a more robust solution is called for:
Copy the code with changes to a different location (preferably via copy and paste).
Replace with latest from repo (or revert) on the directory giving the problem
Copy the changes back (via cut and paste again) and check in.
try to delete .svn/all-wcprops. maybe it will help
Someone else has modified this directory on you.
You need to do a svn update to get the latest version before commiting.
svn update
or
right click > Team > Update
Refresh or F5 will only re-read what's currently checked out and check for local changes, i.e. changes made outside of eclipse.
The svn update command pulls any changes made remotely (commits) down to your workspace.
You need to do an svn update to make sure you are completely up-to-date before committing.
svn update
If the update does not work, you may need to do a cleanup.
svn cleanup
You should be able to find both of these commands in your SVN client outside of Eclipse if you are using one.