Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

We use SVN and PhpStorm at work. Recently our team has grown a bit so there are several people working on the same project at a time, sometimes on the same file. We've run into the problem where people don't update before comitting and overwrite the changes that were made by someone else. This is a hassle. I don't know SVN very well, but it seems like this shouldn't even be possible. What are we doing wrong?

share|improve this question
3  
Are you sure they didnt mess up at the merge stage? –  Karthik T Feb 20 '13 at 9:36
1  
Which SVN-Client do you use? If it would not refuse the commit at all, there would be no point in using a version control software. –  mri Feb 20 '13 at 9:45
    
@mri We use PhpStorm as the SVN client too –  bernk Feb 20 '13 at 10:41
    
@KarthikT Nope, not sure. That's what I'm trying to figure out. I guess that is what happened behind the scenes in PhpStorm and I just didn't know... –  bernk Feb 20 '13 at 10:55
1  
Ok, i've not worked with this one before. But as i already pointed out - if it is the case that it will allow overriding newer versions of the file, there is no point in using a version control system. You could just copy the files on a network-share or even on a usb stick and pass it around... –  mri Feb 20 '13 at 11:01

2 Answers 2

SVN will not just warn you, it will outright refuse the commit. Then you have to do an update, handle any merge conflicts, typically by explicitly marking any conflicted files as "merged", and only then can you commit.

Of course, it's possible to have a client that does all this silently and just overwrites conflicted files. Such a client would be considered seriously broken and worse than useless. I doubt PHPStorm does that. Most likely, the developers don't know how to handle merge conflicts and just incorrectly mark the files as "merged" to get SVN to "work".

share|improve this answer
    
I'm one of those "developers" (actually an interaction designer who also does some front-end dev work), and I have never had to mark any conflicts as anything, and I know that I myself have overwritten someone else's changes without knowing because I didn't update before committing. –  bernk Feb 20 '13 at 10:43
1  
@bernk: I haven't really used PHPStorm myself, but the online help section concerning merge conflicts looks no different from what I'm used to in other IDEs: jetbrains.com/phpstorm/webhelp/resolving-conflicts.html - I can only speculate that you've chanced upon some strange configuration or workflow that appears to work to you but somehow circumvents conflict resolution. It's definitely not how SVN normally works. –  Michael Borgwardt Feb 20 '13 at 11:06

Yes, it should and it will. Accidentally erasing your coworker's work is only possible if you update and resolve all conflicts in your favor, and then commit your version. It is not unthinkable that people have automated their update process so that it automatically chooses "choose my version" because they don't know any better; find and eliminate such errors.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.