0

I have a checked out project in Xcode from an SVN repository. Someone else changed two of the files I had checked out, and caused them to be updated (they should not have) on SVN, so now two of my files are out of date. I cannot update those two files to my machine for fear of loosing all my changes.

When I try and commit my changes now (about 60 files), everything checks in, except I get an error that two of my files cannot be checked in. The project file itself, and one .mm file. Xcode & SVN insist that I must update those two files before I check them in.

OK, on the .mm file, I have rolled his changes into my copy of the file already. I would like to just FORCE a check in. But I can copy the contents, do an update, and then paste the copy back into the file. That should work for the .mm file since it will think it was updated.

But what about the project file? Is there some way to just force a check in? If not, how exactly does one merge a project file? I am happy to overwrite the project file at this time.

Thanks in advance

MajorHavoc
  • 321
  • 2
  • 11
  • 1
    Can you just copy your project file to a temp directory, then revert your local copy back, pull his changes, and then copy/paste your project file to overwrite and commit? – trnelson Nov 07 '14 at 19:50
  • I am not sure as I do not know what is in the project file. I can see a lot of XML, but is there anything hidden in there that I should know about? It is not as easy as a copy paste like in a text file. Just want to be sure I do not screw it up. – MajorHavoc Nov 07 '14 at 19:53
  • 1
    Do you have a comparison tool like Beyond Compare or Araxis Merge? (No affiliation). That will let you compare the files to see if there are differences. If it's just XML, you will be able to see a diff of the changes. You mentioned you were fine to overwrite the project file, so what is your hesitation exactly? Losing the other developer's work (which you stated isn't needed) or your own (which you'd retain if you overwrite his). – trnelson Nov 07 '14 at 19:56
  • If I could just FORCE CHECKIN it would be fine, yes. So if I copy my file out, do an update, and then replace the checked out file with my copy, will SVN recognize it as the same file and allow it to check in? I assume SVN keeps no info in the file itself? – MajorHavoc Nov 07 '14 at 19:59
  • 1
    Yes, SVN should recognize the file as having local modifications and allow you to re-commit it. Your other option is to branch your working copy's changes, pull the other developer's stuff, and merge your stuff into that. But that might be overkill if you just want to replace what he's done. – trnelson Nov 07 '14 at 20:02
  • 1
    Thanks. I will give this a try, and also try your compare idea as well. I will report back when I try this. – MajorHavoc Nov 07 '14 at 20:03
  • OK, copying contents worked. Still, would like to see a FORCE CHECKIN option for SVN! Thanks for the help – MajorHavoc Nov 07 '14 at 21:58
  • 1
    No, the correct action is to update, merge your changes, then check in. "Force commit" would make it too easy to clobber somebody else's changes. – Ben Nov 09 '14 at 12:55
  • possible duplicate of [Svn commit failed out of date](http://stackoverflow.com/questions/1610897/svn-commit-failed-out-of-date) – Ben Nov 09 '14 at 12:56
  • Ben, I would normally agree, but right now, I am the only user. :-) – MajorHavoc Feb 11 '15 at 22:49

1 Answers1

3

Easy:

  1. Copy your project file to a new location
  2. Do an svn revert path/to/project/file in your working copy
  3. Do an update in your working copy with svn up
  4. Commit any uncommitted changes
  5. Copy project file back from backup location into working copy
  6. Commit new project file
  • Thanks Michael. That is what I did for the .mm file. Got it working. – MajorHavoc Nov 09 '14 at 06:38
  • 2
    God I hate SVN. It makes no sense. No disrespect to Michael, but plenty of disrespect to SVN. This isn't a solution, it's a hack, required by SVN's shortcomings. **pulls out hair** – MaxRocket Jun 02 '16 at 21:14
  • 2
    SVN is garbage. How is this a version control system? I can do the same thing without one -- i.e., copy and paste. That's what people did back in the dark ages. SVN still hasn't come out of it. – MaxRocket Aug 02 '16 at 17:53