changeset 58:edd248672292

patch fs19 to handle items with missing revs gracefully
author MattMaker <trip@entropyreductionservices.com>
date Tue, 01 Mar 2011 17:20:01 -0600
parents 5ac57ba008b5
children c72182a5251c
files MoinMoin/storage/backends/__init__.py MoinMoin/storage/backends/fs19.py
diffstat 2 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/storage/backends/__init__.py	Mon Feb 28 22:42:52 2011 +0100
+++ b/MoinMoin/storage/backends/__init__.py	Tue Mar 01 17:20:01 2011 -0600
@@ -18,6 +18,8 @@
 from MoinMoin.error import ConfigurationError
 from MoinMoin.storage.backends import router, fs, fs2, fs19, memory
 
+from MoinMoin import log
+logging = log.getLogger(__name__)
 
 CONTENT = 'content'
 USERPROFILES = 'userprofiles'
@@ -104,6 +106,7 @@
         # special case: old moin19 stuff
         from os import path
         data_dir = backend_uri[len(FS19_PREFIX):]
+        logging.debug("backend: %s" % data_dir)
         userprofile = fs19.FSUserBackend(path.join(data_dir, 'user'), '/dev/shm') # assumes user below data_dir
         content = fs19.FSPageBackend(data_dir, '/dev/shm', deleted_mode='keep', default_markup=u'wiki')
         namespace_mapping = [
--- a/MoinMoin/storage/backends/fs19.py	Mon Feb 28 22:42:52 2011 +0100
+++ b/MoinMoin/storage/backends/fs19.py	Tue Mar 01 17:20:01 2011 -0600
@@ -548,6 +548,7 @@
             if meta['__rev'] == revno:
                 break
         else:
+            self.to_end()
             raise KeyError
         del meta['__rev']
         meta = dict([(k, v) for k, v in meta.items() if v]) # remove keys with empty values
@@ -564,6 +565,7 @@
                 meta[EXTRA] == attachname):
                 break
         else:
+            self.to_begin()
             raise KeyError
         del meta['__rev']
         del meta[EXTRA] #  we have full name in NAME