<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>p5w/skins/CleanAndSoft/page_too_old.tmpl</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -550,6 +550,22 @@ sub edit_page {
     # page source?
 
     if ( my $article_text = $cgi-&gt;param('articletext') ) {
+        # Check if the page has been saved since editing begun, and pull the
+        # brakes if it has.
+        if ( $cgi-&gt;param('old-revision') &lt; latest_revision($page) ) {
+            my $template = HTML::Template-&gt;new(
+                filename =&gt; $TEMPLATE_PATH.'page_too_old.tmpl');
+
+            $template-&gt;param(PAGE =&gt; $page);
+            $template-&gt;param(TITLE =&gt; pp($page));
+            $template-&gt;param(LOGGED_IN =&gt; logged_in($cgi));
+
+            print status_ok(),
+                  $template-&gt;output();
+
+            return;
+        }
+
         my $session_id = $cgi-&gt;cookie('session_id');
         my $author = $sessions{$session_id}{user_name};
         my $tags = $cgi-&gt;param('tags');</diff>
      <filename>p5w/November.pm</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>a5ac1223d865288f5ae99acfa995d8e7efdb5a5a</id>
    </parent>
  </parents>
  <author>
    <name>Carl Masak</name>
    <email>cmasak@gmail.com</email>
  </author>
  <url>http://github.com/viklund/november/commit/d732120520ae2c736bad7155a9e7e0330e24c774</url>
  <id>d732120520ae2c736bad7155a9e7e0330e24c774</id>
  <committed-date>2009-03-31T13:26:31-07:00</committed-date>
  <authored-date>2009-03-31T13:26:31-07:00</authored-date>
  <message>[p5w] implemented edit conflict prevention

Now you can only save pages that have not been saved since you started editing.</message>
  <tree>d2ded4c368afef816fe1322a67abf2d4c4cd3583</tree>
  <committer>
    <name>Carl Masak</name>
    <email>cmasak@gmail.com</email>
  </committer>
</commit>
