How to change subversion settings in xcode? - iphone

I've had subversion running in Xcode for a while. The integration of subversion has always hung by a thread. However my subversion server has changed its ip address ... and my xcode project still tries to look up the source on the old ip.
I have changed the ip of the subversion server via the SCM menu in xcode ... however these changes don't seem to effect the project.
Anyone got any idea how I change the subversion ip in the project?
Cheers
Rich

I've run into a similar issue when relocating a Subversion repository would be completely ignored by XCode.
Here's a list of steps I've taken in order to force Xcode to update the repository path in my project:
Open up Terminal and go to your XCode project directory:
$ cd /path/to/your/project
Switch the Subversion working copy to the new URL (in the example below I also changed the SVN protocol but this is irrelevant):
$ svn switch --relocate svn://old_path svn+ssh://new_path
Fire up XCode, close your project's window and open up Organizer (⇧⌘2)
Go to the Projects tab, locate your project in the list on the left, right-click it and click Remove from Organizer...
Close XCode and open up your .xcodeproj XCode project file again.
You should now see an updated SVN path under the Location heading under Source Control in the File inspector (the Utilities panel).
If you go to Organizer, you should also see the project back in its place under the Projects tab and a new item under the Repositories tab.
The environment I've tested this solution in: Mac OS X Mountain Lion + XCode 4.4.1

You need to use the --relocate option for the svn switch command if you are just changing hostnames or ip addresses.
So, something like this:
svn sw --relocate svn://brian#123.123.123.123/mypath svn://brian#122.122.122.122/mypath

It's not Xcode, it's svn itself that still looks to the old reposotory. Try firing up a terminal, and cd'ing into the project directory. There use the switch svn command:
svn switch NewURL
then refresh or close/open the Xcode project.

Try creating a new SCM repository and setting your project to the new one, and if that works, you can safely delete the old one.

I had similar problems when the dns name for my svn server changed (but keeping the same IP)
svn sw --relocate worked for me (from terminal on a mac). After the change, go to "Refresh entire project" from the SCM menu in xcode.
Good idea to do an svn info first though to check your repo URL. On my first attempt I entered the wrong FROM URL and the svn sw --relocate just does nothing, with no error reported.
The confusing thing in xcode was the the SCM - repositories browser worked fine after I updated the svn settings in xcode preferences, but my project was not fixed until after the --relocate business.

Related

Eclipse + Git - How to get toolbar?

I've got Eclipse 3.7.2 installed and working fine. I installed the git plugins (see below).
Right clicking my active project and clicking on "Team" gives me the options to pull/push/commit and more.
I have set my git executeable to msysgit (C git).
The docs told me that to add git to the toolbar I should look in Window->Customize Perspective..., but I couldn't anything related to git there, not even under the "Command Groups Availability" section.
How do I add push, pull & commit buttons to my Eclipse toolbar?
Stumbled on this answer, but found this works:
Install the Egit plugin, add the Git command group in Customize Perspective|Command Groups Availability, not the (pretty much useless) "Team", then check "Git" in Customize Perspective|Tool Bar Visibility
First install EGit from http://download.eclipse.org/egit/updates. Then you should find the Git command group and be able to activate it. msysgit isn't integrated with Eclipse.
See "Activating the Git toolbar "
Nothing worked and I had begun getting an unrelated error on startup with a troubleshooting step requiring reinstall.
This time I downloaded Eclipse for Mobile Developers, and since then I have added my other packages and it's all working, but clicking the commit thing and clicking the arrow to merge my changes (with comment) results in nothing.
It isn't committed nor is an error given.
install a fresh copy of eclipse with a new fresh workplace
install egit
show egit in toolbar (from customise perspective, etc....)
copy \.metadata\.plugins\org.eclipse.e4.workbench\workbench.xmi from the fresh installed workplace into your current workplace
you'll loose some position settings of the layout, but most of the settings will be kept, and most important you'll have egit in toolbar in your current workplace.
if you like you can analyse/diff the file workbench.xmi and see what you have to set to get the toolbar; for me it was enough (most likely workplace was from previous versions of eclipse, and egit/eclipse does not update this xml file)

How to access SVN repository in XCode 4.2?

Now, i switched to developing from Xcode 4.2. In Xcode 3.2.5 i have used SVN repository to save my project details. But, in XCode 4.2 i dont know how to access SVN Repository? Can you please tell me what are the steps i need to follow to access SVN from XCode 4.2? Thanks in advance.
Windows > Organizer > Repositories > Add Repositories (bottom left +) > Type - Subversion
In XCode 4.4, I had some problems viewing repos that were setup in XCode 4.2. One of the great features of XCode is it's ability to connect to repo and show whether a file has been modified by showing an "M" next to the class file that hasn't been committed yet. When I added a new repo as I had before (the GameBit method), all of my projects stopped showing the "M" or "A" and all the commit messages weren't visible in the Organizer, and my trunk/branches/tags folder were disconnected (red dot).
When this happens, the first thing you should do is close the project and quit XCode. That should reset the svn configs of all your projects.
If that doesn't work, open Terminal and enter this command to checkout your new working copy:
svn co (http or https)://YOURsvnSERVERurl/PROJECTNAME(name of your new project folder you just added to Organizer)
That immediately resulted in all previous projects in the Organizer > Repositories to show the commit messages again and linked everything up as it was before. However, the new project still didn't show the "M" and "A" until I quit XCode and rebooted.
This answer is meant for anyone who tries to add a project under svn to XCode's source control management system and XCode is not showing the commit status.

SVN Switch with relocate in Eclipse

My question can be claimed to be an extension/similar to the question posted here.
basically, I need to do the same functionality using Eclipse plugin Subclipse. Subclipse has a functionality to "Switch branch/tag/revision", however, this is limited as it treats the new url as a repository and tries to compare them. I only wish to change the URL.
any ideas!
From SVN Repository Exploring perspective right click on your project repository and choose Relocate.. from contextual menu:
It will bring up a confirmation windows showing you active projects which will be affected by relocation.
In more recent versions of Eclipse/Subversive (which don't have the Relocate option) you can simply click Location Properties instead and change the URL. It will warn you that "The attached projects will be relocated because the repository root URL differs from the previously entered one." This is what you want!
I had the similar issue on Eclipse Luna 4.4.2 64 bit version. Initially I've relocated the project on the command line and Eclipse failed to recognize the relocation change. Alternatively I've tried to delete and re-import the projects, but sadly this approach failed to work out as well. Then sorted it out this way;
Closed all the projects,
Opened the SVN Repository Exploring perspective,
Right clicked on the repository >> Location properties,
In the properties pane, I've changed the url and in the below I choose "Use the repository URL as the label" clicked on finish,
Switched back to the Java perspective and reopened the projects.
After this alteration Eclipse stopped giving such errors and I was able to see the new root address of each project on the right side of the name
I found that if the projects that are related with the SVN you are trying to relocate are open in Eclipse, the operation fails with the following error in the 'SVN Console':
switch --relocate http://old.scm.com/svn/APP http://new.scm.com/svn/APP .../webapp
svn: E155019: Cannot relocate '...\webapp' as it is not the root of a working copy
svn: E155019: Cannot relocate '...\webapp' as it is not the root of a working copy
The solution was to close all the projects (Project Explorer -> right click on the project -> Close Project) and only after that, do the URL relocation in the SVN window (SVN Repositories window -> right click on the URL of the old SVN -> Relocate).
Notice that that the box 'Projects that will be relocated:' on the following screen is empty. Before it showed all the open projects in Eclipse IDE.
This was they only way I got it to succeed.
Using Eclipse Kepler Service Release 2, with Subclipse 1.10.10.

How do you make eclipse use an existing svn working copy?

I've got a working copy checked out with svn; furthermore, I've created a new project in Eclipse that has the root of the working copy as the project's location. I want to be able to do stuff like compare versions from Eclipse. I have Subclipse 1.4.8, but that doesn't seem to give me what I want. Am I doing something wrong?
i have an svn working copy that also is a project in eclipse. after installing the subclipse plugin i had the same problem, the working copy was not recognized as such.
i just managed by chance to get it recognized as an svn working copy by renaming the project in question and then renaming it back to its old name. not very nice, but it did the trick :-)
There is an option when creating a new project, to use an existing source directory:
New project/ new Java Project / Create project from existing source.
Use that, tell it where your source lives, and it should automatically detect if it's a SVN working copy.
I guess this is not possible with Subclipse as it's given in its documentation that, you can only import an existing svn-managed folder under one condition, according to the doc:
"The only requirement is that your
working copy has to also be a valid
Eclipse project."
So, if you have a working copy that is not a complete eclipse project, Subclipse will not connect it to SVN.
You can right click on the root node of your project and select: Team / Share project
Then you choose SVN, let the default settings and it should work fine!
I am answering this after a long time of the question being asked. I ended up here because I was facing the same problem.
My solution was to create an empty .svn folder at the root folder of the project (in the latest version of svn client tortoise all meta-data is at the root folder). Then did an eclipse refresh and voila it did the trick. I am running subclipse core - 1.8.4.
One step that seemed to work for me, that no one has explicitly mentioned yet: I closed and then re-opened the project. I tried the "rename" trick, above, and that didn't work, but perhaps the poster of that answer also closed the project - they didn't detail exactly what steps they went thru to rename it. (I found you don't have to close the project to rename it, but perhaps they did.)
< /rob>
In my case, I couldn't use an existing copy because I checked out the code using a newer version of Subversion on the command-line and Subclipse 1.4 couldn't recognize it. Upgrading and going through the improved "Share Project" menu resolved the problem.
I got this tip from the forums here:
http://subclipse.tigris.org/ds/viewMessage.do?dsForumId=1047&dsMessageId=2380064
I had the same issue and here are the details of the fix.
My Eclipse is "Helios Service Release 1".
I had an SVN checkout on my filesystem, I went to New Java Project, unchecked Use default location, chose the location, went to next step, chose the source folder and said Finish.
The project came up with no disk icon on it. As per few forum posts, right-clicked on the project, went to Team > Share Project, chose SVN, clicked Next, and the option was only to share the files to the SVN Repository for the first time.
I said Cancel, and the option is to make changes to the SVN plug-in settings. Went to Window menu, chose Preferences, browsed Team> SVN. Chose the SVN Connector tab, changed the SVNKit 1.2.3 to SVNKit 1.3.5 and said OK.
Then, right clicked on the project, said Team> SVN, on the next screen, chose the option Use Project Settings and clicked Finish. The disk button came to the project and the SVN URL got displayed on it.
Add the repository to your list of repositories in subclipse by choosing Window->Show View->Other... and choose SVN->SVN Repositories. Put in all the necessary info to connect to the repository.
Next, right click the repository and choose "checkout". If the project doesn't already have an eclipse .project file, you can create a new project from the source. If it already has a .project file, it will import that .project and use that as your eclipse project locally.
It will definitively not work if you use a different version of svn to checkout, that the one that is supported by Eclipse. I had this problem as I used svn 1.6 to checkout but I had an older eclipse version that had only 1.5. Subclipse has its own build-in svn client (Actually, in two flavors if I am not mistaken).
Check that the subclipse version matches the svn client that you used to checkout. You can check the plugin version number for subclipse (Help -> About -> Click on subversion logo) and match it against svn --version
This worked for me:
1) Go to the 'SVN Repository Exploring' perspective and add a folder somewhere above your working copy
2) Close and open the Eclipse projects.
This should then be enough to get them recognized by Subclipse.
I have encountered a similar situation were existing projects would not get associated with the Subversive plugin. Unfortunately, none of the previous suggestions helped (renaming projects etc.). What has helped is removing projects from Eclipse by deleting them -- just the projects from Package Explorer and not the actual directories and files on disc (the deletion prompt has a special checkbox for that, which is unchecked by default) -- and reimporting the deleted projects as existing projects back.
Of course, as mentioned in some of the answers here, the relevant SVN repositories need to be registered with Eclipse before reimporting the projects. Otherwise, there would no repositories to re-associate the projects with.
When you open a versioned project (i.e., a project in SVN working copy) in Eclipse, that was never previously used with Subclipse, you need to perform these steps:
Right-click the project in Project Explorer.
Select Team | Share Project.
At this point Subclipse will tell you that "The project is already configured with SVN repository information". Click Next.
Subclipse automatically recognizes this project as versioned and all the features of the SVN plug-in should become available.

Problems committing file to SVN repository

I have a maven pom build file in the root directory of my project. When trying to synchronize with SVN repository from Eclipse (Europa), red double directed arrow is being added to the file icon. This means that both my local copy and the one in the repository have been changed since last synchronization.
When I try to do do 'Override and update...' error message is being thrown:
Some resources were not reverted.
Attempted to lock an already-locked dir
svn: Working copy 'C:\Java\workspaces\pro\myProject-TRUNK' locked
Do you have an idea what should be done in this case?
svn cleanup ?
not sure how you'd do that from eclipse though ... but if its a standard svn working copy, you should still be able to do it with another tool.
In Eclipse, to do SVN clean up
Right Click on Locked Project -> Team ->Cleanup
delete the .loc and .log files from the directory if Team->Cleanup is not available to you from subeclipse and update the resources giving you the error message earlier.
It looks like the repository has got a bit confised! You could try a 'svn cleanup' in the project directory.
You can do it on the command line, or using a different tool...
From the command prompt, you'll have to have subversion installed and on the PATH. Close Eclipse, open up a command prompt and cd to the root of the project, then type 'svn cleanup'.
You could also use Tortoise SVN to do the same from Windows Explorer. Install Tortoise SVN and close Eclipse. Within Windows Explorer, navigate to the parent of your project directory, right click on the project folder and select 'Tortoise SVN' -> 'Clean up'
This normally happens when you paste a directory into another in your project.
You have to create the directories manually, then paste all the files.
To solve the issue:
Right click on the project (or on a parent directory)
Then team
Then clean up
This happens if we have some pending sessions on committing our changes so we’ll need to do some clean up before we’ll have another try on committing our changes. This is how to do it.
Click to Team->Clean Up
Try again to commit..
it's working for me.
add svn application
sudo apt-get install svn
cd <folder-project-name>
svn cleanup
Restart your eclipse (IDE) . Problem Solved.
I went to local svn folder and removed the log file and lock files did the svn update from eclipse and everything back on track
Right-click on project-->Team-->Refresh/Cleanup
Right click and select Team->Refresh/Cleanup
I see Team -> Cleanup in most answers- somehow did not work for me.
I did this -It happened twice for me.
Once I resolved Like this -- I made a backup file with my changes . I closed my eclipse -> go into the prject in windows explorer - > Go to the file in conflict -> right click -> SVN -> Revert. Now I started eclipse -> put back my changes and it worked.
Second time it happened -- That did not help. So, I had to delete the project on my eclipse workspace, and checked out the project from SVN and it worked.
-Hope it helps.
Use TortoiseSVN -> Release lock -> Break lock