title: Prevent users overwriting each others work in svn
body: <p>I'm using subversion for version control.</p>
  
  <p>I frequently see instances where commits overwrite each other. In git this is prevented as you cannot push until you have pulled if your local repo is out of date. Is there a similar mechanism in subversion?</p>
  
  <p>e.g.</p>
  
  <ol>
  <li><p>Bob updates his working copy with svn update. He proceeds to work on some changes to file A over several days.</p></li>
  <li><p>Meanwhile, Alice update her working copy, and makes a small change to file A, then commits it in the same day.</p></li>
  <li><p>A day or so later, Bob commits his changes - which won't include Alice's changes to file A - overwriting and removing Alice's changes. When Bob makes his commit, he gets no warning, no conflict or any indication that he needed to update first because the repo has changed.</p></li>
  <li><p>Bob does not deliberately touch any of the lines of code that Alice changed, but because his working copy does not contain Alice's code when he commits it, the result is that the repo has Bob's changes only, and Alice's have vanished.</p></li>
  </ol>
  
  <p>Although Bob and Alice both have a process in place that means they are supposed to use svn update before they commit, it seems (to Bob) that svn does not enforce this and Bob frequently forgets.</p>
  
  <p>How can we prevent this?</p>
  
  <p><strong>[Edit]</strong> Thanks to everyone who has waded in so far. It looks like you're all saying the same thing - that what I'm describing can't happen. Unfortunately my experience with svn, using different clients, and different versions of svn over several years (on and off) is exactly as described above. It looks like there's a fundamental thing I'm missing in svn to make it prevent committing code when your working copy is out of sync - it's happened too many times for me to believe that svn can prevent it, despite all the answers here. So something is screwy - I need to find out what - does anyone have any suggestions about how the perceived effect described could happen (without Bob deliberately deleting Alice's code and then lying to the world)?</p>
  
  <p><strong>PS:</strong> I'm Bob.</p>