changeset 3816:6e7ab559c67d

merge fixes from 1.7
author Johannes Berg <johannes AT sipsolutions DOT net>
date Thu, 03 Jul 2008 15:26:24 +0200
parents 30ed528054ed (current diff) dcd932f8c4ec (diff)
children 98660492e634
files MoinMoin/wikiutil.py
diffstat 5 files changed, 22 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/_tests/test_wikiutil.py	Wed Jul 02 01:05:09 2008 +0200
+++ b/MoinMoin/_tests/test_wikiutil.py	Thu Jul 03 15:26:24 2008 +0200
@@ -297,6 +297,21 @@
             for val in result[2]:
                 assert val is None or isinstance(val, unicode)
 
+    def testDoubleNameValueSeparator(self):
+        tests = [
+                  # regular and quoting tests
+                  (u'd==4,=3 ',    ([], {u'd': u'=4', u'': u'3'}, [])),
+                  (u'===a,b,c,d',  ([], {u'': u'==a'}, [u'b', u'c', u'd'])),
+                  (u'a,b,===,c,d', ([u'a', u'b'], {u'': u'=='}, [u'c', u'd'])),
+                ]
+
+        def _check(a, e):
+            r = wikiutil.parse_quoted_separated(a)
+            assert r == e
+
+        for args, expected in tests:
+            yield _check, args, expected
+
     def testNoNameValue(self):
         abcd = [u'a', u'b', u'c', u'd']
         tests = [
--- a/MoinMoin/search/Xapian.py	Wed Jul 02 01:05:09 2008 +0200
+++ b/MoinMoin/search/Xapian.py	Thu Jul 03 15:26:24 2008 +0200
@@ -414,7 +414,7 @@
         while next:
             if next != 1:
                 pos += next.end()
-            prev, next = next, re.search(r'----*\r?\n', body[pos:])
+            prev, next = next, re.search(r'-----*\s*\r?\n', body[pos:])
 
         if not prev or prev == 1:
             return []
--- a/MoinMoin/search/queryparser.py	Wed Jul 02 01:05:09 2008 +0200
+++ b/MoinMoin/search/queryparser.py	Thu Jul 03 15:26:24 2008 +0200
@@ -730,7 +730,7 @@
         """
         kwargs['use_re'] = True
         TextSearch._build_re(self,
-                r'(?m)(^-----*\r?\n)(^##.*\r?\n)*^(?!##)(.*)\b%s\b' % pattern, **kwargs)
+                r'(?m)(^-----*\s*\r?\n)(^##.*\r?\n)*^(?!##)(.*)\b%s\b' % pattern, **kwargs)
 
     def costs(self):
         return 5000 # cheaper than a TextSearch
--- a/MoinMoin/theme/__init__.py	Wed Jul 02 01:05:09 2008 +0200
+++ b/MoinMoin/theme/__init__.py	Thu Jul 03 15:26:24 2008 +0200
@@ -1719,6 +1719,7 @@
 
         # In standard mode, emit theme.header
         else:
+            exists = pagename and page.exists(includeDeleted=True)
             # prepare dict for theme code:
             d = {
                 'theme': self.name,
@@ -1729,7 +1730,8 @@
                 'page': page,
                 'rev': rev,
                 'pagesize': pagename and page.size() or 0,
-                'last_edit_info': pagename and page.lastEditInfo() or '',
+                # exists checked to avoid creation of empty edit-log for non-existing pages
+                'last_edit_info': exists and page.lastEditInfo() or '',
                 'page_name': pagename or '',
                 'page_find_page': page_find_page,
                 'page_front_page': page_front_page,
--- a/MoinMoin/wikiutil.py	Wed Jul 02 01:05:09 2008 +0200
+++ b/MoinMoin/wikiutil.py	Thu Jul 03 15:26:24 2008 +0200
@@ -1439,6 +1439,8 @@
                 cur.append(None)
             else:
                 if not multikey:
+                    if cur[-1] is None:
+                        cur[-1] = ''
                     cur[-1] += name_value_separator
                 else:
                     cur.append(None)