How to change subversion settings in xcode?

14,315

Solution 1

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.

Solution 2

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:

  1. Open up Terminal and go to your XCode project directory:

    $ cd /path/to/your/project

  2. 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

  3. Fire up XCode, close your project's window and open up Organizer (⇧⌘2)

  4. Go to the Projects tab, locate your project in the list on the left, right-click it and click Remove from Organizer...
  5. 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

Solution 3

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://[email protected]/mypath svn://[email protected]/mypath

Share:
14,315
Gogo
Author by

Gogo

Updated on June 05, 2022

Comments

  • Gogo
    Gogo almost 2 years

    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

  • Gogo
    Gogo almost 15 years
    I think this is probably the answer however when i try it i get the following svn switch [email protected]:8443/svn/iphone svn: '[email protected]:8443/svn/iphone' is not the same repository as '[email protected]:8443/svn/iphone' any idea what I'm doing wrong?
  • Gogo
    Gogo almost 15 years
    can you explain how you 'set the project to the new one'?
  • Jasarien
    Jasarien almost 15 years
    Sure! You can create a new repository in the "Configure SCM Repositories..." menu item under SCM in Xcode. Once you've created a new repo, go to SCM > Configure SCM For This Project... In the new window that appears, towards the bottom should be a drop down menu labelled "SCM Repository" choose the new one you just created in this drop down and see if that works.
  • Gogo
    Gogo almost 15 years
    ah .. i don't seem to have the 'Configure SCM for this project'. Maybe one a project is bound to SCM that option disappears ...
  • Jasarien
    Jasarien almost 15 years
    Interesting. You should be able to reach the same config window by choosing Project > Edit Project Settings from within XCode.
  • Gogo
    Gogo almost 15 years
    managed to find the option ... however it still refers to the old ip :(
  • Jasarien
    Jasarien almost 15 years
    Then, I'm sorry, but I don't know what else to suggest. There are many knowledgeable people on this site, I'm sure someone will come up with the answer soon enough.
  • IlDan
    IlDan almost 15 years
    Well, you can't ask us so much as your exact URL repository... ;) So, you may just check out a new project tree with Xcode or with 'svn co URL NewProject' and copy any new code you left on the old tree to the new one. Then delete the old tree. Double check before deleting.
  • user3137901
    user3137901 about 13 years
    Would've been better if you had just commented on Brian Stormont's answer.
  • Brynjar
    Brynjar about 13 years
    @Chry - yes, but I didn't have the rep at the time to comment, so what you gonna do?
  • johnnieb
    johnnieb almost 13 years
    @IlDan If the location of your repository changes, you’ll need to use the following command: switch --relocate [FROM PATH] [TO PATH] .
  • Paul Collins
    Paul Collins almost 11 years
    If after doing this, Xcode still thinks your repo is somewhere else, check the parent directory above your project directory and see if it happens to be under version control and also needs svn switch. If so, in some cases you might also want to add the -N (nonrecursive) flag to the switch command for the parent.