Index: contrib/hook-scripts/svn2feed.py
===================================================================
--- contrib/hook-scripts/svn2feed.py	(revision 20819)
+++ contrib/hook-scripts/svn2feed.py	(working copy)
@@ -208,9 +208,22 @@
 
     def add_revision_item(self, revision):
         item = self._make_atom_item(revision)
-        self.feed.appendChild(item)
-        # FIXME: Process max_items
 
+        total = 0
+        for childNode in self.feed.childNodes:
+            # author is the last non-entry element. We insert the new
+            # element before its next sibling because it is obviously an
+            # 'entry' element. If there is no such element, then next
+            # sibling will be None and the element will be inserted
+            # after the 'author' element
+            if(childNode.nodeName == 'author'):
+                self.feed.insertBefore(item, childNode.nextSibling)
+            elif(childNode.nodeName == 'entry'):
+                total += 1
+
+        if (total > self.max_items):
+            self.feed.removeChild(self.feed.lastChild)
+
     def write_output(self):
         s = pickle.dumps(self.document)
         f = open(self.pickle_file, "w")
