Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 08-31-2010, 04:44 PM   #1 (permalink)
Registered Member
 
Join Date: Apr 2009
Location: Setauket, NY
Posts: 133
Question How to replace files in a project under SVN

Hello;
I am using the Reachability code from Apple in my project. My project is under SCM using Subversion.
I tried dragging in a new version of the Reachability code in to Xcode, but it won't copy in to my project. I want to update my version in my project from 1.5 to version 2.0.
What is the best way to do this? Do I have to checkout the file using the command line tool via Terminal and then commit the new version from the command line? I figure if I do this, then Xcode will indicate a "U" next to the file name and I can update my project's working directory that way. But that seems like a pain using the Terminal.
Any ideas are appreciated.
Thanks.
hstaniloff is offline   Reply With Quote
Old 09-02-2010, 12:56 PM   #2 (permalink)
Registered Member
 
Join Date: Aug 2010
Location: Edinburgh
Posts: 209
Default

I always use the terminal to manage Subversion and I don't feel it is a hassle.

You should be able to drag the reachability files into xCode but make sure you tell it to Copy the original files. However, I think it is better to copy the files to your project folder on the fileystem and import references to your classes in xCode. This keeps both xCode and the SCM happy.
__________________
Justinmichael is offline   Reply With Quote
Old 09-02-2010, 04:24 PM   #3 (permalink)
Registered Member
 
Join Date: Apr 2009
Location: Setauket, NY
Posts: 133
Default

Quote:
Originally Posted by Justinmichael View Post
I always use the terminal to manage Subversion and I don't feel it is a hassle.

You should be able to drag the reachability files into xCode but make sure you tell it to Copy the original files. However, I think it is better to copy the files to your project folder on the fileystem and import references to your classes in xCode. This keeps both xCode and the SCM happy.
I understand, thanks. But I already have the two Reachability files (.h, .m), v1.5, in my Xcode project already and wish to update them to the new v2.04 versions. When I drag the new version in to Xcode, it doesn't copy the new files in to my project - the copy fails.
Do I have to delete them first - which will delete them out of the SVN repository - then drag the new files in? Seems like there should be an easier way. No? Am I missing something here?
hstaniloff is offline   Reply With Quote
Old 09-02-2010, 06:52 PM   #4 (permalink)
Super Moderator
 
Join Date: Oct 2009
Location: San Diego, CA
Posts: 1,578
Default

Personally, I would just close XCode, replace the files from within Finder or the command line, and open XCode to check the files into SVN.
JasonR is online now   Reply With Quote
Old 09-02-2010, 07:00 PM   #5 (permalink)
Registered Member
 
Join Date: Apr 2009
Location: Setauket, NY
Posts: 133
Default

Quote:
Originally Posted by JasonR View Post
Personally, I would just close XCode, replace the files from within Finder or the command line, and open XCode to check the files into SVN.
I'm a noob with XCode and SVN. I close Xcode; replace the two files in the working directory with the new ones, then open XCode and check in the files? I thought it wasn't a good idea to mess with the directories directly; always letting XCode handle it.
I guess I need a bit of hand-holding with this one. I understand the concept that you always work in a working directory with SVN and XCode compares the date/times (or something) to see if it's been modified from the one in the repository. You can then update the one in the repository with the one that XCode has in it's file system.
I'm hung up on the actual procedure for replacing two files that are under SVN control and managed by XCode. Use the terminal commands? Some detail would help here; having a brain drain with this.
Thanks.
hstaniloff is offline   Reply With Quote
Old 09-03-2010, 01:10 PM   #6 (permalink)
Super Moderator
 
Join Date: Oct 2009
Location: San Diego, CA
Posts: 1,578
Default

XCode is actually not tracking the files at all, it just passes on the information it gets from SVN. The only reason I recommend closing XCode is that XCode might have the file loaded into memory, which could overwrite your changes.

And SVN does not care if you changed the files from inside XCode or not. All it knows is that the files are changed, and stores the changes when you check them in. So you can change them anyway you like. You can drag and drop from finder, copy them from terminal, or even change them from the text editor if you like.

ETA: One warning, though. Make sure you only overwrite files. If you overwrite the entire directory, you might erase the hidden files SVN relies on.

Last edited by JasonR; 09-03-2010 at 01:13 PM. Reason: Add directory warning.
JasonR is online now   Reply With Quote
Old 09-03-2010, 01:16 PM   #7 (permalink)
Registered Member
 
Join Date: Apr 2009
Location: Setauket, NY
Posts: 133
Smile

Understood.
I went in to another project that was under SVN control and did a test run. I created a dummy file; then outside of XCode, I created a new version of the dummy file with some modifications. I closed XCode; then just overwrote the dummy file in the working directory with the modified dummy file.
I then started XCode; it reported that the file is different than what's in the repository by putting an "M" next to it on the left. I opened the file; saw that it was my newly modified one and then committed my changes to the repository. So it worked.
I'll do the same procedure with the other files that I need to update.
Thanks for your help. Had a brain drain on this one for some reason.
Cheers!
hstaniloff is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Stats
Members: 158,885
Threads: 89,230
Posts: 380,765
Top Poster: BrianSlick (7,129)
Welcome to our newest member, bookesp
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 02:34 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0