changeset 4498:910474dded06

merged moin/1.8
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sat, 24 Jan 2009 03:13:41 +0100
parents 4d95fa3b074d (current diff) 6beaf3e083c6 (diff)
children 6a6405b75dad b29674295262
files MoinMoin/Page.py MoinMoin/action/AttachFile.py MoinMoin/config/multiconfig.py MoinMoin/converter/text_html_text_moin_wiki.py MoinMoin/formatter/__init__.py MoinMoin/formatter/text_html.py MoinMoin/parser/text_moin_wiki.py MoinMoin/theme/__init__.py MoinMoin/user.py MoinMoin/widget/browser.py MoinMoin/wikiutil.py docs/CHANGES wiki/data/pages/BadContent/current
diffstat 21 files changed, 420 insertions(+), 252 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/Page.py	Mon Jan 05 23:56:02 2009 +0100
+++ b/MoinMoin/Page.py	Sat Jan 24 03:13:41 2009 +0100
@@ -1027,7 +1027,11 @@
             # redirect to another page
             # note that by including "action=show", we prevent endless looping
             # (see code in "request") or any cascaded redirection
-            request.http_redirect(request.href(pi['redirect'], action='show', redirect=self.page_name))
+            pagename, anchor = wikiutil.split_anchor(pi['redirect'])
+            redirect_url = Page(request, pagename).url(request,
+                                                       querystr={'action': 'show', 'redirect': self.page_name, },
+                                                       anchor=anchor)
+            request.http_redirect(redirect_url)
             return
 
         # if necessary, load the formatter
--- a/MoinMoin/action/AttachFile.py	Mon Jan 05 23:56:02 2009 +0100
+++ b/MoinMoin/action/AttachFile.py	Sat Jan 24 03:13:41 2009 +0100
@@ -427,7 +427,7 @@
     'pngpath': pngpath, 'timestamp': timestamp,
     'pubpath': pubpath, 'drawpath': drawpath,
     'savelink': savelink, 'pagelink': pagelink, 'helplink': helplink,
-    'basename': basename
+    'basename': wikiutil.escape(basename),
 })
 
 
@@ -470,7 +470,7 @@
     'action_name': action_name,
     'upload_label_file': _('File to upload'),
     'upload_label_rename': _('Rename to'),
-    'rename': request.form.get('rename', ''),
+    'rename': wikiutil.escape(request.form.get('rename', ''), 1),
     'upload_label_overwrite': _('Overwrite existing attachment of same name'),
     'overwrite_checked': ('', 'checked')[request.form.get('overwrite', '0') == '1'],
     'upload_button': _('Upload'),
--- a/MoinMoin/config/multiconfig.py	Mon Jan 05 23:56:02 2009 +0100
+++ b/MoinMoin/config/multiconfig.py	Sat Jan 24 03:13:41 2009 +0100
@@ -503,8 +503,8 @@
 """
 
         decode_names = (
-            'sitename', 'logo_string', 'navi_bar', 'page_front_page',
-            'page_category_regex', 'page_dict_regex',
+            'sitename', 'interwikiname', 'logo_string', 'navi_bar',
+            'page_front_page', 'page_category_regex', 'page_dict_regex',
             'page_group_regex', 'page_template_regex', 'page_license_page',
             'page_local_spelling_words', 'acl_rights_default',
             'acl_rights_before', 'acl_rights_after', 'mail_from'
@@ -793,11 +793,11 @@
   (
     ('sitename', u'Untitled Wiki',
      "Short description of your wiki site, displayed below the logo on each page, and used in RSS documents as the channel title [Unicode]"),
-    ('interwikiname', None, "unique and stable InterWiki name (prefix, moniker) of the site, or None"),
+    ('interwikiname', None, "unique and stable InterWiki name (prefix, moniker) of the site [Unicode], or None"),
     ('logo_string', None, "The wiki logo top of page, HTML is allowed (`<img>` is possible as well) [Unicode]"),
     ('html_pagetitle', None, "Allows you to set a specific HTML page title (if None, it defaults to the value of `sitename`)"),
     ('navi_bar', [u'RecentChanges', u'FindPage', u'HelpContents', ],
-     'Most important page names. Users can add more names in their quick links in user preferences. To link to URL, use `u"[url link title]"`, to use a shortened name for long page name, use `u"[LongLongPageName title]"`. To use page names with spaces, use `u"[page_name_with_spaces any title]"` [list of Unicode strings]'),
+     'Most important page names. Users can add more names in their quick links in user preferences. To link to URL, use `u"[[url|link title]]"`, to use a shortened name for long page name, use `u"[[LongLongPageName|title]]"`. [list of Unicode strings]'),
 
     ('theme_default', 'modern',
      "the name of the theme that is used by default (see HelpOnThemes)"),
--- a/MoinMoin/converter/text_html_text_moin_wiki.py	Mon Jan 05 23:56:02 2009 +0100
+++ b/MoinMoin/converter/text_html_text_moin_wiki.py	Sat Jan 24 03:13:41 2009 +0100
@@ -613,7 +613,7 @@
                 for i in listitem.childNodes:
                     if i.nodeType == Node.ELEMENT_NODE:
                         if i.localName == 'table':
-                            markup = " "
+                            markup = ""
             else:
                 markup = "* "
         elif name == 'dl':
--- a/MoinMoin/events/xapian_index.py	Mon Jan 05 23:56:02 2009 +0100
+++ b/MoinMoin/events/xapian_index.py	Sat Jan 24 03:13:41 2009 +0100
@@ -69,7 +69,7 @@
         handle_renamed(event)
     elif isinstance(event, ev.PageCopiedEvent):
         handle_copied(event)
-    elif isinstance(event, ev.PageChangedEvent):
+    elif isinstance(event, ev.PageChangedEvent) or isinstance(event, ev.TrivialPageChangedEvent):
         handle_changed(event)
     elif isinstance(event, ev.PageDeletedEvent):
         handle_deleted(event)
--- a/MoinMoin/formatter/__init__.py	Mon Jan 05 23:56:02 2009 +0100
+++ b/MoinMoin/formatter/__init__.py	Sat Jan 24 03:13:41 2009 +0100
@@ -14,7 +14,6 @@
 
 from MoinMoin.util import pysupport
 from MoinMoin import wikiutil
-from MoinMoin.support.python_compatibility import rsplit
 
 modules = pysupport.getPackageModules(__file__)
 
@@ -106,9 +105,6 @@
         """
         wikitag, wikiurl, wikitail, wikitag_bad = wikiutil.resolve_interwiki(self.request, interwiki, pagename)
         if wikitag == 'Self' or wikitag == self.request.cfg.interwikiname:
-            if '#' in wikitail:
-                wikitail, kw['anchor'] = rsplit(wikitail, '#', 1)
-                wikitail = wikiutil.url_unquote(wikitail)
             return self.pagelink(on, wikitail, **kw)
         return ''
 
--- a/MoinMoin/formatter/text_html.py	Mon Jan 05 23:56:02 2009 +0100
+++ b/MoinMoin/formatter/text_html.py	Sat Jan 24 03:13:41 2009 +0100
@@ -14,7 +14,7 @@
 from MoinMoin import wikiutil, i18n
 from MoinMoin.Page import Page
 from MoinMoin.action import AttachFile
-from MoinMoin.support.python_compatibility import set, rsplit
+from MoinMoin.support.python_compatibility import set
 
 # insert IDs into output wherever they occur
 # warning: breaks toggle line numbers javascript
@@ -488,8 +488,6 @@
         wikitag, wikiurl, wikitail, wikitag_bad = wikiutil.resolve_interwiki(self.request, interwiki, pagename)
         wikiurl = wikiutil.mapURL(self.request, wikiurl)
         if wikitag == 'Self': # for own wiki, do simple links
-            if '#' in wikitail:
-                wikitail, kw['anchor'] = rsplit(wikitail, '#', 1)
             wikitail = wikiutil.url_unquote(wikitail)
             try: # XXX this is the only place where we access self.page - do we need it? Crashes silently on actions!
                 pagename = wikiutil.AbsPageName(self.page.page_name, wikitail)
@@ -502,6 +500,9 @@
                 if querystr:
                     separator = ('?', '&')['?' in href]
                     href = '%s%s%s' % (href, separator, wikiutil.makeQueryString(querystr))
+                anchor = kw.get('anchor')
+                if anchor:
+                    href = '%s#%s' % (href, anchor)
                 if wikitag_bad:
                     html_class = 'badinterwiki'
                 else:
--- a/MoinMoin/log.py	Mon Jan 05 23:56:02 2009 +0100
+++ b/MoinMoin/log.py	Sat Jan 24 03:13:41 2009 +0100
@@ -88,7 +88,9 @@
 """
 
 import os
-import logging, logging.config
+import logging
+import logging.config
+import logging.handlers  # needed for handlers defined there being configurable in logging.conf file
 
 configured = False
 fallback_config = False
--- a/MoinMoin/parser/text_creole.py	Mon Jan 05 23:56:02 2009 +0100
+++ b/MoinMoin/parser/text_creole.py	Sat Jan 24 03:13:41 2009 +0100
@@ -25,7 +25,6 @@
 import StringIO
 from MoinMoin import config, wikiutil
 from MoinMoin.macro import Macro
-from MoinMoin.support.python_compatibility import rsplit # Needed for python 2.3
 from _creole import Parser as CreoleParser
 
 Dependencies = []
@@ -273,11 +272,7 @@
                 elif word.startswith(wikiutil.CHILD_PREFIX):
                     word = "%s/%s" % (self.formatter.page.page_name,
                         word[wikiutil.CHILD_PREFIX_LEN:])
-                # handle anchors
-                parts = rsplit(word, "#", 1)
-                anchor = ""
-                if len(parts) == 2:
-                    word, anchor = parts
+                word, anchor = wikiutil.split_anchor(word)
                 return ''.join([
                     self.formatter.pagelink(1, word, anchor=anchor),
                     self.emit_children(node) or self.formatter.text(target),
@@ -296,8 +291,9 @@
                 # interwiki link
                 wiki = m.group('inter_wiki')
                 page = m.group('inter_page')
+                page, anchor = wikiutil.split_anchor(page)
                 return ''.join([
-                    self.formatter.interwikilink(1, wiki, page),
+                    self.formatter.interwikilink(1, wiki, page, anchor=anchor),
                     self.emit_children(node) or self.formatter.text(page),
                     self.formatter.interwikilink(0),
                 ])
--- a/MoinMoin/parser/text_moin_wiki.py	Mon Jan 05 23:56:02 2009 +0100
+++ b/MoinMoin/parser/text_moin_wiki.py	Sat Jan 24 03:13:41 2009 +0100
@@ -15,7 +15,7 @@
 
 from MoinMoin import config, wikiutil, macro
 from MoinMoin.Page import Page
-from MoinMoin.support.python_compatibility import rsplit, set
+from MoinMoin.support.python_compatibility import set
 
 Dependencies = ['user'] # {{{#!wiki comment ... }}} has different output depending on the user's profile settings
 
@@ -600,7 +600,8 @@
             text = groups.get('interwiki')
             return self.formatter.text(text)
         else:
-            return (self.formatter.interwikilink(1, wiki, page) +
+            page, anchor = wikiutil.split_anchor(page)
+            return (self.formatter.interwikilink(1, wiki, page, anchor=anchor) +
                     self.formatter.text(page) +
                     self.formatter.interwikilink(0, wiki, page))
     _interwiki_wiki_repl = _interwiki_repl
@@ -623,11 +624,7 @@
         if abs_name == current_page:
             return self.formatter.text(word)
         else:
-            # handle anchors
-            try:
-                abs_name, anchor = rsplit(abs_name, "#", 1)
-            except ValueError:
-                anchor = ""
+            abs_name, anchor = wikiutil.split_anchor(abs_name)
             return (bang +
                     self.formatter.pagelink(1, abs_name, anchor=anchor) +
                     self.formatter.text(word) +
@@ -864,11 +861,7 @@
                 else:
                     err = True
                 if err: # not a interwiki link / not in interwiki map
-                    # handle anchors
-                    try:
-                        page_name, anchor = rsplit(page_name_and_anchor, "#", 1)
-                    except ValueError:
-                        page_name, anchor = page_name_and_anchor, ""
+                    page_name, anchor = wikiutil.split_anchor(page_name_and_anchor)
                     current_page = self.formatter.page.page_name
                     if not page_name:
                         page_name = current_page
@@ -881,10 +874,11 @@
                             self._link_description(desc, target, page_name_and_anchor) +
                             self.formatter.pagelink(0, abs_page_name))
                 else: # interwiki link
+                    page_name, anchor = wikiutil.split_anchor(page_name)
                     tag_attrs, query_args = self._get_params(params,
                                                              tag_attrs={},
                                                              acceptable_attrs=acceptable_attrs)
-                    return (self.formatter.interwikilink(1, wiki_name, page_name, querystr=query_args, **tag_attrs) +
+                    return (self.formatter.interwikilink(1, wiki_name, page_name, anchor=anchor, querystr=query_args, **tag_attrs) +
                             self._link_description(desc, target, page_name) +
                             self.formatter.interwikilink(0, wiki_name, page_name))
 
--- a/MoinMoin/parser/text_rst.py	Mon Jan 05 23:56:02 2009 +0100
+++ b/MoinMoin/parser/text_rst.py	Sat Jan 24 03:13:41 2009 +0100
@@ -20,7 +20,6 @@
 from MoinMoin.Page import Page
 from MoinMoin.action import AttachFile
 from MoinMoin import wikiutil
-from MoinMoin.support.python_compatibility import rsplit
 
 Dependencies = [] # this parser just depends on the raw text
 
@@ -400,10 +399,7 @@
                     node['classes'].append(prefix)
             else:
                 # Default case - make a link to a wiki page.
-                pagename = refuri
-                anchor = ''
-                if '#' in refuri:
-                    pagename, anchor = rsplit(refuri, '#', 1)
+                pagename, anchor = wikiutil.split_anchor(refuri)
                 page = Page(self.request, wikiutil.AbsPageName(self.formatter.page.page_name, pagename))
                 node['refuri'] = page.url(self.request, anchor=anchor)
                 if not page.exists():
--- a/MoinMoin/script/migration/_conv160a_wiki.py	Mon Jan 05 23:56:02 2009 +0100
+++ b/MoinMoin/script/migration/_conv160a_wiki.py	Sat Jan 24 03:13:41 2009 +0100
@@ -3,25 +3,13 @@
     MoinMoin - convert content in 1.6.0alpha (rev 1844: 58ebb64243cc) wiki markup to 1.6.0 style
                by using a modified 1.6.0alpha parser as translator.
 
-    Assuming we have this "renames" map:
-    -------------------------------------------------------
-    'PAGE', 'some_page'        -> 'some page'
-    'FILE', 'with%20blank.txt' -> 'with blank.txt'
-
-    Markup transformations needed:
-    -------------------------------------------------------
-    ["some_page"]           -> [[some page]] # renamed
-    [:some_page:some text]  -> [[some page|some text]]
-    [:page:text]            -> [[page|text]]
-                               (with a page not being renamed)
-
-    attachment:with%20blank.txt -> [[attachment:with blank.txt]]
-    attachment:some_page/with%20blank.txt -> [[attachment:some page/with blank.txt]]
-    The attachment processing should also urllib.unquote the filename (or at
-    least replace %20 by space) and put it into "quotes" if it contains spaces.
+    PLEASE NOTE: most moin users will never need to execute this code,
+                 because it is just for users of 1.6.0alpha version,
+                 that used modified link markup, but was never released.
+                 The 1.5.x/1.6.x releases use a different link markup than 1.6.0a.
 
     @copyright: 2007 MoinMoin:JohannesBerg,
-                2007 MoinMoin:ThomasWaldmann
+                2007-2009 MoinMoin:ThomasWaldmann
     @license: GNU GPL, see COPYING for details.
 """
 
@@ -276,29 +264,6 @@
         else:
             return text
 
-    ''' old:
-    def _interwiki_repl(self, word):
-        """Handle InterWiki links."""
-        wikitag, wikiurl, wikitail, wikitag_bad = wikiutil.resolve_wiki(self.request, word)
-        if wikitag_bad:
-            return word
-        else:
-            wikiname, pagename = word.split(':', 1)
-            pagename = wikiutil.url_unquote(pagename) # maybe someone has used %20 for blanks in pagename
-            camelcase = wikiutil.isStrictWikiname(pagename)
-            if wikiname in ('Self', self.request.cfg.interwikiname):
-                pagename = self._replace(('PAGE', pagename))
-                if camelcase:
-                    return '%s' % pagename # optimize special case
-                else:
-                    return '[[%s]]' % pagename # optimize special case
-            else:
-                if ' ' in pagename: # we could get a ' '  by urlunquoting
-                    return '[[%s:%s]]' % (wikiname, pagename)
-                else:
-                    return '%s:%s' % (wikiname, pagename)
-    '''
-
     def _interwiki_repl(self, word):
         """Handle InterWiki links."""
         wikitag, wikiurl, wikitail, wikitag_bad = wikiutil.resolve_wiki(self.request, word)
@@ -310,22 +275,24 @@
     def interwiki(self, target_and_text, **kw):
         scheme, rest = target_and_text.split(':', 1)
         wikiname, pagename, text = wikiutil160a.split_wiki(rest)
-        if text:
-            text = '|' + text
 
-        if (pagename.startswith(wikiutil.CHILD_PREFIX) or # fancy link to subpage [wiki:/SubPage text]
-            Page(self.request, pagename).exists()): # fancy link to local page [wiki:LocalPage text]
-            pagename = wikiutil.url_unquote(pagename)
-            pagename = self._replace_target(pagename)
-            return '[[%s%s]]' % (pagename, text)
+        #if (pagename.startswith(wikiutil.CHILD_PREFIX) or # fancy link to subpage [wiki:/SubPage text]
+        #    Page(self.request, pagename).exists()): # fancy link to local page [wiki:LocalPage text]
+        #    # XXX OtherWiki:FooPage markup -> checks for local FooPage -sense???
+        #    pagename = wikiutil.url_unquote(pagename)
+        #    pagename = self._replace_target(pagename)
+        #    return '[[%s%s]]' % (pagename, text)
 
         if wikiname in ('Self', self.request.cfg.interwikiname, ''): # [wiki:Self:LocalPage text] or [:LocalPage:text]
+            orig_pagename = pagename
             pagename = wikiutil.url_unquote(pagename)
             pagename = self._replace_target(pagename)
             camelcase = wikiutil.isStrictWikiname(pagename)
-            if camelcase and text == pagename:
-                return '%s' % pagename # optimize special case
+            if camelcase and (not text or text == orig_pagename):
+                return pagename # optimize special case
             else:
+                if text:
+                    text = '|' + text
                 return '[[%s%s]]' % (pagename, text)
 
         wikitag, wikiurl, wikitail, wikitag_bad = wikiutil.resolve_wiki(self.request, wikiname+':')
@@ -343,58 +310,27 @@
             if ' ' not in wikitail and not text:
                 return '%s:%s' % (wikitag, wikitail)
             else:
+                if text:
+                    text = '|' + text
                 return '[[%s:%s%s]]' % (wikitag, wikitail, text)
 
-    ''' old:
-    def interwiki(self, url_and_text):
-        # keep track of whether this is a self-reference, so links
-        # are always shown even the page doesn't exist.
-        wikiname, pagename = wikiutil.split_wiki(url)
-    '''
-    '''
-    def attachment(self, url_and_text):
-        """ This gets called on attachment URLs. """
-        if len(url_and_text) == 1:
-            url = url_and_text[0]
-            text = ''
-        else:
-            url, text = url_and_text
-            text = '|' + text
-
-        scheme, fname = url.split(":", 1)
-        #scheme, fname, text = wikiutil.split_wiki(target_and_text)
+    def attachment(self, target_and_text, **kw):
+        """ This gets called on attachment URLs """
+        _ = self._
+        scheme, fname, text = wikiutil160a.split_wiki(target_and_text)
 
         pagename, fname = AttachFile.absoluteName(fname, self.pagename)
         from_this_page = pagename == self.pagename
         fname = self._replace(('FILE', pagename, fname))
-        fname = wikiutil.url_unquote(fname, want_unicode=True)
-        fname = self._replace(('FILE', pagename, fname))
+        #fname = wikiutil.url_unquote(fname, want_unicode=True)
+        #fname = self._replace(('FILE', pagename, fname))
         pagename = self._replace(('PAGE', pagename))
         if from_this_page:
             name = fname
         else:
             name = "%s/%s" % (pagename, fname)
 
-        if scheme == 'drawing':
-            return "{{drawing:%s%s}}" % (name, text)
-
-        # check for image URL, and possibly return IMG tag
-        # (images are always inlined, just like for other URLs)
-        if wikiutil.isPicture(name):
-            return "{{attachment:%s%s}}" % (name, text)
-
-        # inline the attachment
-        if scheme == 'inline':
-            return '{{attachment:%s%s}}' % (name, text)
-        else: # 'attachment'
-            return '[[attachment:%s%s]]' % (name, text)
-    '''
-
-    def attachment(self, target_and_text, **kw):
-        """ This gets called on attachment URLs """
-        _ = self._
-        scheme, fname, text = wikiutil160a.split_wiki(target_and_text)
-        fn_txt = fname
+        fn_txt = name
         if text:
             fn_txt += '|' + text
 
@@ -433,30 +369,37 @@
         # Local extended link? [:page name:link text] XXX DEPRECATED
         if word[0] == ':':
             words = word[1:].split(':', 1)
-            pagename = self._replace(('PAGE', words[0]))
-            if len(words) == 1 or len(words) == 2 and not words[1]:
-                return '[[%s]]' % (pagename, )
-            else:
-                return '[[%s|%s]]' % (pagename, words[1])
+            link, text = (words + ['', ''])[:2]
+            if link.strip() == text.strip():
+                text = ''
+            link = self._replace_target(link)
+            if text:
+                text = '|' + text
+            return '[[%s%s]]' % (link, text)
 
         scheme_and_rest = word.split(":", 1)
         if len(scheme_and_rest) == 1: # no scheme
             # Traditional split on space
             words = word.split(None, 1)
-            if len(words) == 1:
-                words = words * 2
-
             if words[0].startswith('#'): # anchor link
-                if words[0] == words[1]:
-                    return '[[%s]]' % words[0]
-                else:
-                    return '[[%s|%s]]' % tuple(words)
+                link, text = (words + ['', ''])[:2]
+                if link.strip() == text.strip():
+                    text = ''
+                if text:
+                    text = '|' + text
+                return '[[%s%s]]' % (link, text)
         else:
-            scheme, rest = scheme_and_rest
+            scheme = scheme_and_rest[0]
             if scheme == "wiki":
                 return self.interwiki(word, pretty_url=1)
             if scheme in self.attachment_schemas:
-                return self.attachment(word)
+                m = self.attachment(word)
+                if scheme == 'attachment':
+                    # with url_bracket markup, 1.6.0a parser does not embed pictures, but link!
+                    return '[[%s]]' % m[2:-2]
+                else:
+                    # drawing and inline
+                    return m
 
             words = word.split(None, 1)
             if len(words) == 1:
@@ -471,65 +414,6 @@
             else:
                 return '[[%s|%s]]' % (target, text)
 
-
-    '''
-    def _url_bracket_repl(self, word):
-        """Handle bracketed URLs."""
-        word = word[1:-1] # strip brackets
-
-        # Local extended link?
-        if word[0] == ':':
-            words = word[1:].split(':', 1)
-            link, text = (words + ['', ''])[:2]
-            if link.strip() == text.strip():
-                text = ''
-            link = self._replace_target(link)
-            if text:
-                text = '|' + text
-            return '[[%s%s]]' % (link, text)
-
-        # Traditional split on space
-        words = word.split(None, 1)
-        if words[0][0] == '#':
-            # anchor link
-            link, text = (words + ['', ''])[:2]
-            if link.strip() == text.strip():
-                text = ''
-            #link = self._replace_target(link)
-            if text:
-                text = '|' + text
-            return '[[%s%s]]' % (link, text)
-
-        scheme = words[0].split(":", 1)[0]
-        if scheme == "wiki":
-            return self.interwiki(words)
-            #scheme, wikiname, pagename, text = self.interwiki(word)
-            #print "%r %r %r %r" % (scheme, wikiname, pagename, text)
-            #if wikiname in ('Self', self.request.cfg.interwikiname, ''):
-            #    if text:
-            #        text = '|' + text
-            #    return '[[%s%s]]' % (pagename, text)
-            #else:
-            #    if text:
-            #        text = '|' + text
-            #    return "[[%s:%s%s]]" % (wikiname, pagename, text)
-        if scheme in self.attachment_schemas:
-            m = self.attachment(words)
-            if m.startswith('{{') and m.endswith('}}'):
-                # with url_bracket markup, 1.5.8 parser does not embed, but link!
-                m = '[[%s]]' % m[2:-2]
-            return m
-
-        target, desc = (words + ['', ''])[:2]
-        if wikiutil.isPicture(desc) and re.match(self.url_rule, desc):
-            #return '[[%s|{{%s|%s}}]]' % (words[0], words[1], words[0])
-            return '[[%s|{{%s}}]]' % (target, desc)
-        else:
-            if desc:
-                desc = '|' + desc
-            return '[[%s%s]]' % (target, desc)
-    '''
-
     def _pre_repl(self, word):
         w = word.strip()
         if w == '{{{' and not self.in_pre:
--- a/MoinMoin/script/migration/_tests/test_conv160a_wiki.py	Mon Jan 05 23:56:02 2009 +0100
+++ b/MoinMoin/script/migration/_tests/test_conv160a_wiki.py	Sat Jan 24 03:13:41 2009 +0100
@@ -3,7 +3,6 @@
     MoinMoin - tests of wiki content conversion
 
     TODO:
-    * fix failing tests
     * fix parser/converter anchor link handling
     * emit a warning if we find some page name that was renamed as a macro argument?
     * shall we support camelcase renaming?
@@ -37,45 +36,56 @@
         }
 
         tests = [
-            # 1.6.0a specific tests
-            ('["some page" somepage]', {}, '[[some page|somepage]]'),
-            ("['some page' somepage]", {}, '[[some page|somepage]]'),
-            ("MoinMaster:'some page'", {}, '[[MoinMaster:some page]]'),
-            ('MoinMaster:"some page"', {}, '[[MoinMaster:some page]]'),
-            #("MoinMaster:'some page'", {}, '[[MoinMaster:some page]]'),
+            # attachment links
+            ("attachment:filename.ext", {}, "[[attachment:filename.ext]]"),
+            ("[attachment:'Filename.ext' Aliasname]", {}, "[[attachment:Filename.ext|Aliasname]]"),
+            ("[attachment:'Pagename/Filename.ext' Aliasname]", {}, "[[attachment:Pagename/Filename.ext|Aliasname]]"),
+            ("[attachment:'Pagename/Subpage/Filename.ext' Aliasname]", {}, "[[attachment:Pagename/Subpage/Filename.ext|Aliasname]]"),
+            ('[attachment:"Pagename/Subpage/File Name.ext" Aliasname]', {}, "[[attachment:Pagename/Subpage/File Name.ext|Aliasname]]"),
+            ('[inline:text.txt]', {}, '{{attachment:text.txt}}'), # inline is now implied by {{...}}
+            ('[inline:image.jpg]', {}, '{{attachment:image.jpg}}'), # inline is now implied by {{...}}
+            ('[drawing:image]', {}, '{{drawing:image}}'),
+            ('[inline:text.txt foo]', {}, '{{attachment:text.txt|foo}}'), # inline is now implied by {{...}}
+            ('[inline:image.jpg foo]', {}, '{{attachment:image.jpg|foo}}'), # inline is now implied by {{...}}
+            ('[drawing:image foo]', {}, '{{drawing:image|foo}}'),
+
             # "nothing changed" checks (except markup)
             ('', {}, ''),
             ('CamelCase', {}, 'CamelCase'),
-            # XXX TODO ('MoinMaster:CamelCase', {}, 'MoinMaster:CamelCase'),
+            ('["/Subpage"]', {}, "[[/Subpage]]"),
+            ('["Pagename/Subpage"]', {}, "[[Pagename/Subpage]]"),
+            ("['Pagename/Subpage' Aliasname]", {}, "[[Pagename/Subpage|Aliasname]]"),
+            ('["some page" somepage]', {}, '[[some page|somepage]]'),
+            ("['some page' somepage]", {}, '[[some page|somepage]]'),
 
-            # did not work in 1.6a
-            #('[wiki:LinuxWiki: LinuxWiki.de]', {}, '[[LinuxWiki:|LinuxWiki.de]]'),
-            #('[wiki:/OtherPage]', rename_some_page, '[[/OtherPage]]'),
-            #('[wiki:/OtherPage other page]', rename_some_page, '[[/OtherPage|other page]]'),
+            ('Doesnotexist:CamelCase', {}, 'Doesnotexist:CamelCase'),
+            ('MoinMaster:CamelCase', {}, 'MoinMaster:CamelCase'),
+            ("MoinMaster:'some page'", {}, '[[MoinMaster:some page]]'),
+            ('MoinMaster:"some page"', {}, '[[MoinMaster:some page]]'),
 
-            # XXX TODO  ('[wiki:MoinMoin/FrontPage]', {}, 'MoinMoin:FrontPage'),
+            ('[wiki:MoinMoin/FrontPage]', {}, 'MoinMoin:FrontPage'),
             ('some_text', {}, 'some_text'),
             ('["some_text"]', {}, '[[some_text]]'),
             ('some_page', rename_some_page, 'some_page'), # not a link
             ('{{{["some_page"]}}}', rename_some_page, '{{{["some_page"]}}}'), # not a link
             ('`["some_page"]`', rename_some_page, '`["some_page"]`'), # not a link
             ('["OtherPage/some_page"]', rename_some_page, '[[OtherPage/some_page]]'), # different link
-            # XXX TODO ('MoinMaster:some_page', rename_some_page, 'MoinMaster:some_page'), # external link
+            ('MoinMaster:some_page', rename_some_page, 'MoinMaster:some_page'), # external link
             ('http://some_server/some_page', rename_some_page, 'http://some_server/some_page'), # external link
             ('[http://some_server/some_page]', rename_some_page, '[[http://some_server/some_page]]'), # external link
+            ('[http://some_server/some_page foo]', rename_some_page, '[[http://some_server/some_page|foo]]'), # external link
             ('[#some_page]', rename_some_page, '[[#some_page]]'), # link to anchor that has same name
-            #XXX ('[attachment:some_page.png]', rename_some_page, '[[attachment:some_page.png]]'), # att, not page
-            #XXX ('[attachment:some_page.png test picture]', rename_some_page, '[[attachment:some_page.png|test picture]]'), # att, not page
-            # url unquote stuff (%20 was popular for space)
-            #XXX ('attachment:My%20Attachment.jpg', {}, '{{attachment:My Attachment.jpg}}'), # embed!
-            #XXX ('[attachment:My%20Attachment.jpg]', {}, '[[attachment:My Attachment.jpg]]'), # link!
-            #XXX ('[attachment:My%20Attachment.jpg it works]', {}, '[[attachment:My Attachment.jpg|it works]]'),
+            ('[attachment:some_page.png]', rename_some_page, '[[attachment:some_page.png]]'), # att, not page
+            ('[attachment:some_page.png test picture]', rename_some_page, '[[attachment:some_page.png|test picture]]'), # att, not page
 
             # page rename changes result
             ('["some_page"]', rename_some_page, '[[some page]]'),
             ('[:some_page]', rename_some_page, '[[some page]]'),
+            ('[:some_page#anchor]', rename_some_page, '[[some page#anchor]]'),
             ('[:some_page:]', rename_some_page, '[[some page]]'),
+            ('[:some_page#anchor:]', rename_some_page, '[[some page#anchor]]'),
             ('[:some_page:some text]', rename_some_page, '[[some page|some text]]'),
+            ('[:some_page#anchor:some text]', rename_some_page, '[[some page#anchor|some text]]'),
             ('Self:some_page', rename_some_page, '[[some page]]'),
             ('wiki:Self:some_page', rename_some_page, '[[some page]]'),
             ('[wiki:Self:some_page some text]', rename_some_page, '[[some page|some text]]'),
@@ -85,24 +95,18 @@
             ('[:other page]', {}, '[[other page]]'),
             ('[:other page:]', {}, '[[other page]]'),
             ('[:other page:other text]', {}, '[[other page|other text]]'),
-            # XXX TODO ('Self:CamelCase', {}, 'CamelCase'),
-            # XXX TODO ('[wiki:WikiPedia:Lynx_%28web_browser%29 Lynx]', {}, '[[WikiPedia:Lynx_(web_browser)|Lynx]]'),
-            # XXX TODO ('[:Something:Something]', {}, '[[Something]]'), # optimize markup
+            ('Self:CamelCase', {}, 'CamelCase'),
+            ('[wiki:WikiPedia:Lynx_%28web_browser%29 Lynx]', {}, '[[WikiPedia:Lynx_(web_browser)|Lynx]]'),
+            ('[:Something:Something]', {}, '[[Something]]'), # optimize markup
 
             # "nothing changed" checks
             ('attachment:OtherPage/with_underscore', rename_some_file, '[[attachment:OtherPage/with_underscore]]'),
 
             # file rename changes result
-            # XXX TODO ('attachment:with_underscore', rename_some_file, '[[attachment:without underscore]]'),
-            # XXX TODO ('attachment:TestPage/with_underscore', rename_some_file, '[[attachment:without underscore]]'), # remove superfluous pagename
+            ('attachment:with_underscore', rename_some_file, '[[attachment:without underscore]]'),
+            ('attachment:TestPage/with_underscore', rename_some_file, '[[attachment:without underscore]]'), # remove superfluous pagename
 
-            # attachment syntax: kill %20
-            # XXX TODO ('attachment:with%20blank', rename_some_file, '[[attachment:without_blank]]'), # plus rename
-            # XXX TODO ('attachment:keep%20blank', rename_some_file, '[[attachment:keep blank]]'), # no rename
-            # XXX TODO ('attachment:TestPage/keep%20blank', rename_some_file, '[[attachment:keep blank]]'), # remove superfluous pagename
-            # XXX TODO ('attachment:OtherPage/keep%20blank', rename_some_file, '[[attachment:OtherPage/keep blank]]'),
-
-            # embed images
+            # embed images, all verified on 160a
             ('http://server/image.png', {}, '{{http://server/image.png}}'),
             ('attachment:image.gif', {}, '{{attachment:image.gif}}'),
             ('inline:image.jpg', {}, '{{attachment:image.jpg}}'), # inline is now implied by {{...}}
@@ -158,4 +162,262 @@
         for data, renames, expected in tests:
             assert convert_wiki(request, pagename, data, renames) == expected
 
+    def test_full_page(self):
+        #py.test.skip("not wanted right now")
+        markup_160a = u"""\
+= CamelCase =
+== Pages ==
+ 1. SomePage
+ 2. TestPage (does not link to current page)
+ 3. SomePage/SubPage
 
+## not supported on 160a
+##== Pages with anchor ==
+## 1. SomePage#anchor
+## 2. TestPage#anchor
+## 3. SomePage/SubPage#anchor
+
+= Interwiki =
+== Pages ==
+ 1. Self:SomePage
+ 2. Self:some_page
+ 3. Self:'some page'
+ 4. Self:"some page"
+ 5. MoinMoin:SomePage
+ 6. MoinMoin:some_page
+ 7. MoinMoin:'some page'
+ 8. MoinMoin:"some page"
+
+== Pages with anchor ==
+ 1. Self:SomePage#anchor
+ 2. Self:some_page#anchor
+ 3. Self:'some page#anchor'
+ 4. Self:"some page#anchor"
+ 5. MoinMoin:SomePage#anchor
+ 6. MoinMoin:some_page#anchor
+ 7. MoinMoin:'some page#anchor'
+ 8. MoinMoin:"some page#anchor"
+
+== Invalid wiki name ==
+ 1. Doesnotexist:CamelCase (shall not link)
+ 2. Foo:bar (shall not link)
+
+= URL =
+== simple ==
+ 1. http://moinmo.in/MoinMoin
+ 2. http://static.moinmo.in/logos/moinmoin.png (renders image in 160a)
+ 3. mailto:someone@example.org
+ 4. wiki:Self:some_page
+
+== with anchor ==
+ 1. http://moinmo.in/MoinMoin#anchor
+ 2. wiki:Self:some_page#anchor
+
+= bracketed link =
+== Page ==
+ 1. ["some page"]
+ 2. ["some page" somepage]
+ 3. ['some page' somepage]
+ 4. ["/Subpage"]
+ 5. ["SomePage/Subpage"]
+ 6. ['SomePage/Subpage' Some Page]
+
+== Page with anchor ==
+ 1. ["some page#anchor"]
+ 2. ["some page#anchor" somepage]
+ 3. ['some page#anchor' somepage]
+ 4. ["/Subpage#anchor"]
+ 5. ["SomePage/Subpage#anchor"]
+ 6. ['SomePage/Subpage#anchor' Some Page]
+
+== Anchor on current page ==
+ 1. [#anchor]
+## 1. [TestPage#anchor]  not supported on 160a
+
+== URL ==
+ 1. [http://some_server/some_page]
+ 2. [http://some_server/some_page some page]
+ 3. [wiki:MoinMoin/FrontPage]
+ 4. [wiki:Self:some_page some page]
+ 5. [wiki:WikiPedia:Lynx_(web_browser) Lynx]
+ 6. [:some_page]
+ 7. [:some_page:]
+ 8. [:some_page:some page]
+ 9. [:Something:Something]
+
+== URL with anchor ==
+ 1. [http://some_server/some_page#anchor]
+ 2. [http://some_server/some_page#anchor some page]
+ 3. [wiki:MoinMoin/FrontPage#anchor]
+ 4. [wiki:Self:some_page#anchor some page]
+ 5. [wiki:WikiPedia:Lynx_(web_browser)#anchor Lynx]
+ 6. [:some_page#anchor]
+ 7. [:some_page#anchor:]
+ 8. [:some_page#anchor:some page]
+ 9. [:Something#anchor:Something]
+
+= preformatted =
+ 1. {{{["some_page"]}}} (converter shall not change pre content)
+ 2. `["some_page"]` (converter shall not change pre content)
+
+= Attachments, Drawings, Images =
+== simple ==
+ 1. attachment:text.txt is linking
+ 2. inline:text.txt is embedding
+ 3. attachment:image.png is embedding
+ 4. inline:image.png is embedding
+ 5. drawing:image is embedding
+
+== bracketed ==
+ 1. [attachment:text.txt] is linking
+ 2. [inline:text.txt] is embedding
+ 3. [attachment:image.png] is linking
+ 4. [drawing:image] is embedding png image
+ 5. [inline:image.png] is showing binary content as text in 160a (wrong)
+
+== bracketed with label ==
+ 1. [attachment:text.txt some label] is linking
+ 2. [inline:text.txt some label] is embedding
+ 3. [attachment:image.png some label] is linking
+ 4. [drawing:image some label] is embedding png image
+ 5. [inline:image.png some label] is showing binary content as text in 160a (wrong)
+
+== bracketed, on other page, with label ==
+ 1. [attachment:SomePage/text.txt some label] is linking
+ 2. [inline:SomePage/text.txt some label] is embedding
+ 3. [attachment:SomePage/image.png some label] is linking
+ 4. [drawing:SomePage/image some label] is embedding png image
+ 5. [inline:SomePage/image.png some label] is showing binary content as text in 160a (wrong)
+
+"""
+        expected_markup_160 = u"""\
+= CamelCase =
+== Pages ==
+ 1. SomePage
+ 2. TestPage (does not link to current page)
+ 3. [[SomePage/SubPage]]
+
+## not supported on 160a
+##== Pages with anchor ==
+## 1. SomePage#anchor
+## 2. TestPage#anchor
+## 3. SomePage/SubPage#anchor
+
+= Interwiki =
+== Pages ==
+ 1. SomePage
+ 2. [[some_page]]
+ 3. [[some page]]
+ 4. [[some page]]
+ 5. MoinMoin:SomePage
+ 6. MoinMoin:some_page
+ 7. [[MoinMoin:some page]]
+ 8. [[MoinMoin:some page]]
+
+== Pages with anchor ==
+ 1. [[SomePage#anchor]]
+ 2. [[some_page#anchor]]
+ 3. [[some page#anchor]]
+ 4. [[some page#anchor]]
+ 5. MoinMoin:SomePage#anchor
+ 6. MoinMoin:some_page#anchor
+ 7. [[MoinMoin:some page#anchor]]
+ 8. [[MoinMoin:some page#anchor]]
+
+== Invalid wiki name ==
+ 1. Doesnotexist:CamelCase (shall not link)
+ 2. Foo:bar (shall not link)
+
+= URL =
+== simple ==
+ 1. http://moinmo.in/MoinMoin
+ 2. {{http://static.moinmo.in/logos/moinmoin.png}} (renders image in 160a)
+ 3. mailto:someone@example.org
+ 4. [[some_page]]
+
+== with anchor ==
+ 1. http://moinmo.in/MoinMoin#anchor
+ 2. [[some_page#anchor]]
+
+= bracketed link =
+== Page ==
+ 1. [[some page]]
+ 2. [[some page|somepage]]
+ 3. [[some page|somepage]]
+ 4. [[/Subpage]]
+ 5. [[SomePage/Subpage]]
+ 6. [[SomePage/Subpage|Some Page]]
+
+== Page with anchor ==
+ 1. [[some page#anchor]]
+ 2. [[some page#anchor|somepage]]
+ 3. [[some page#anchor|somepage]]
+ 4. [[/Subpage#anchor]]
+ 5. [[SomePage/Subpage#anchor]]
+ 6. [[SomePage/Subpage#anchor|Some Page]]
+
+== Anchor on current page ==
+ 1. [[#anchor]]
+## 1. [TestPage#anchor]  not supported on 160a
+
+== URL ==
+ 1. [[http://some_server/some_page]]
+ 2. [[http://some_server/some_page|some page]]
+ 3. MoinMoin:FrontPage
+ 4. [[some_page|some page]]
+ 5. [[WikiPedia:Lynx_(web_browser)|Lynx]]
+ 6. [[some_page]]
+ 7. [[some_page]]
+ 8. [[some_page|some page]]
+ 9. [[Something]]
+
+== URL with anchor ==
+ 1. [[http://some_server/some_page#anchor]]
+ 2. [[http://some_server/some_page#anchor|some page]]
+ 3. MoinMoin:FrontPage#anchor
+ 4. [[some_page#anchor|some page]]
+ 5. [[WikiPedia:Lynx_(web_browser)#anchor|Lynx]]
+ 6. [[some_page#anchor]]
+ 7. [[some_page#anchor]]
+ 8. [[some_page#anchor|some page]]
+ 9. [[Something#anchor|Something]]
+
+= preformatted =
+ 1. {{{["some_page"]}}} (converter shall not change pre content)
+ 2. `["some_page"]` (converter shall not change pre content)
+
+= Attachments, Drawings, Images =
+== simple ==
+ 1. [[attachment:text.txt]] is linking
+ 2. {{attachment:text.txt}} is embedding
+ 3. {{attachment:image.png}} is embedding
+ 4. {{attachment:image.png}} is embedding
+ 5. {{drawing:image}} is embedding
+
+== bracketed ==
+ 1. [[attachment:text.txt]] is linking
+ 2. {{attachment:text.txt}} is embedding
+ 3. [[attachment:image.png]] is linking
+ 4. {{drawing:image}} is embedding png image
+ 5. {{attachment:image.png}} is showing binary content as text in 160a (wrong)
+
+== bracketed with label ==
+ 1. [[attachment:text.txt|some label]] is linking
+ 2. {{attachment:text.txt|some label}} is embedding
+ 3. [[attachment:image.png|some label]] is linking
+ 4. {{drawing:image|some label}} is embedding png image
+ 5. {{attachment:image.png|some label}} is showing binary content as text in 160a (wrong)
+
+== bracketed, on other page, with label ==
+ 1. [[attachment:SomePage/text.txt|some label]] is linking
+ 2. {{attachment:SomePage/text.txt|some label}} is embedding
+ 3. [[attachment:SomePage/image.png|some label]] is linking
+ 4. {{drawing:SomePage/image|some label}} is embedding png image
+ 5. {{attachment:SomePage/image.png|some label}} is showing binary content as text in 160a (wrong)
+
+"""
+        markup_160 = convert_wiki(self.request, u'TestPage', markup_160a, {})
+        #print markup_160a ; print "---" ; print markup_160
+        markup_160 = markup_160.replace('\r\n', '\n')
+        assert markup_160 == expected_markup_160
+
--- a/MoinMoin/search/Xapian.py	Mon Jan 05 23:56:02 2009 +0100
+++ b/MoinMoin/search/Xapian.py	Sat Jan 24 03:13:41 2009 +0100
@@ -327,7 +327,7 @@
         fs_rootpage = 'FS' # XXX FS hardcoded
 
         try:
-            wikiname = request.cfg.interwikiname or 'Self'
+            wikiname = request.cfg.interwikiname or u'Self'
             itemid = "%s:%s" % (wikiname, os.path.join(fs_rootpage, filename))
             mtime = os.path.getmtime(filename)
             mtime = wikiutil.timestamp2version(mtime)
@@ -349,7 +349,7 @@
             if updated:
                 xitemid = xapdoc.Keyword('itemid', itemid)
                 mimetype, file_content = self.contentfilter(filename)
-                xwname = xapdoc.SortKey('wikiname', request.cfg.interwikiname or "Self")
+                xwname = xapdoc.SortKey('wikiname', request.cfg.interwikiname or u"Self")
                 xpname = xapdoc.SortKey('pagename', fs_rootpage)
                 xattachment = xapdoc.SortKey('attachment', filename) # XXX we should treat files like real pages, not attachments
                 xmtime = xapdoc.SortKey('mtime', mtime)
@@ -441,7 +441,7 @@
                    'update' = check if already in index and update if needed (mtime)
         """
         request = page.request
-        wikiname = request.cfg.interwikiname or "Self"
+        wikiname = request.cfg.interwikiname or u"Self"
         pagename = page.page_name
         mtime = page.mtime_usecs()
         revision = str(page.get_real_rev())
@@ -537,7 +537,7 @@
             if updated:
                 xatt_itemid = xapdoc.Keyword('itemid', att_itemid)
                 xpname = xapdoc.SortKey('pagename', pagename)
-                xwname = xapdoc.SortKey('wikiname', request.cfg.interwikiname or "Self")
+                xwname = xapdoc.SortKey('wikiname', request.cfg.interwikiname or u"Self")
                 xattachment = xapdoc.SortKey('attachment', att) # this is an attachment, store its filename
                 xmtime = xapdoc.SortKey('mtime', mtime)
                 xrev = xapdoc.SortKey('revision', '0')
@@ -572,7 +572,7 @@
 
     def _remove_item(self, writer, page, attachment=None):
         request = page.request
-        wikiname = request.cfg.interwikiname or 'Self'
+        wikiname = request.cfg.interwikiname or u'Self'
         pagename = page.page_name
 
         if not attachment:
--- a/MoinMoin/theme/__init__.py	Mon Jan 05 23:56:02 2009 +0100
+++ b/MoinMoin/theme/__init__.py	Sat Jan 24 03:13:41 2009 +0100
@@ -210,7 +210,7 @@
         """
         if self.request.cfg.show_interwiki:
             page = wikiutil.getFrontPage(self.request)
-            text = self.request.cfg.interwikiname or 'Self'
+            text = self.request.cfg.interwikiname or u'Self'
             link = page.link_to(self.request, text=text, rel='nofollow')
             html = u'<div id="interwiki"><span>%s</span></div>' % link
         else:
--- a/MoinMoin/user.py	Mon Jan 05 23:56:02 2009 +0100
+++ b/MoinMoin/user.py	Sat Jan 24 03:13:41 2009 +0100
@@ -639,7 +639,7 @@
         @param tm: timestamp
         """
         if self.valid:
-            interwikiname = unicode(self._cfg.interwikiname or '')
+            interwikiname = self._cfg.interwikiname or u''
             bookmark = unicode(tm)
             self.bookmarks[interwikiname] = bookmark
             self.save()
@@ -651,7 +651,7 @@
         @return: bookmark timestamp or None
         """
         bm = None
-        interwikiname = unicode(self._cfg.interwikiname or '')
+        interwikiname = self._cfg.interwikiname or u''
         if self.valid:
             try:
                 bm = int(self.bookmarks[interwikiname])
@@ -665,7 +665,7 @@
         @rtype: int
         @return: 0 on success, 1 on failure
         """
-        interwikiname = unicode(self._cfg.interwikiname or '')
+        interwikiname = self._cfg.interwikiname or u''
         if self.valid:
             try:
                 del self.bookmarks[interwikiname]
@@ -991,7 +991,6 @@
         return msg + '-' + h
 
     def apply_recovery_token(self, tok, newpass):
-        key = self.recoverpass_key
         parts = tok.split('-')
         if len(parts) != 2:
             return False
@@ -1003,7 +1002,8 @@
         if stamp + 12*60*60 < time.time():
             return False
         # check hmac
-        h = hmac_new(self.recoverpass_key, str(stamp)).hexdigest()
+        # key must be of type string
+        h = hmac_new(str(self.recoverpass_key), str(stamp)).hexdigest()
         if h != parts[1]:
             return False
         self.recoverpass_key = ""
--- a/MoinMoin/widget/browser.py	Mon Jan 05 23:56:02 2009 +0100
+++ b/MoinMoin/widget/browser.py	Sat Jan 24 03:13:41 2009 +0100
@@ -15,7 +15,8 @@
         _ = request.getText
         base.Widget.__init__(self, request, **kw)
         self.data = None
-        self.data_id = 'dbw.'
+        self.unqual_data_id = 'dbw.'
+        self.data_id = request.formatter.qualify_id(self.unqual_data_id)
         # prefixed with __ are untranslated and to be used in the JS
         self._all = _('[all]')
         self.__all = '[all]'
@@ -37,7 +38,8 @@
         """
         self.data = dataset
         if dataset.data_id:
-            self.data_id = 'dbw.%s.' % dataset.data_id
+            self.unqual_data_id = 'dbw.%s.' % dataset.data_id
+            self.data_id = self.request.formatter.qualify_id(self.unqual_data_id)
 
     def _name(self, elem):
         """ return name tag for a HTML element
@@ -115,7 +117,7 @@
         if havefilters:
             result.append(fmt.rawHTML('<input type="submit" value="%s" %s>' % (self._filter, self._name('submit'))))
 
-        result.append(fmt.table(1, id='%stable' % self.data_id))
+        result.append(fmt.table(1, id='%stable' % self.unqual_data_id))
 
         # add header line
         if self._show_header:
--- a/MoinMoin/wikiutil.py	Mon Jan 05 23:56:02 2009 +0100
+++ b/MoinMoin/wikiutil.py	Sat Jan 24 03:13:41 2009 +0100
@@ -22,6 +22,7 @@
 
 from MoinMoin import config
 from MoinMoin.util import pysupport, lock
+from MoinMoin.support.python_compatibility import rsplit
 from inspect import getargspec, isfunction, isclass, ismethod
 
 
@@ -2466,6 +2467,31 @@
         return 'A%s' % res
     return res
 
+def split_anchor(pagename):
+    """
+    Split a pagename that (optionally) has an anchor into the real pagename
+    and the anchor part. If there is no anchor, it returns an empty string
+    for the anchor.
+
+    Note: if pagename contains a # (as part of the pagename, not as anchor),
+          you can use a trick to make it work nevertheless: just append a
+          # at the end:
+          "C##" returns ("C#", "")
+          "Problem #1#" returns ("Problem #1", "")
+
+    TODO: We shouldn't deal with composite pagename#anchor strings, but keep
+          it separate.
+          Current approach: [[pagename#anchor|label|attr=val,&qarg=qval]]
+          Future approach:  [[pagename|label|attr=val,&qarg=qval,#anchor]]
+          The future approach will avoid problems when there is a # in the
+          pagename part (and no anchor). Also, we need to append #anchor
+          at the END of the generated URL (AFTER the query string).
+    """
+    parts = rsplit(pagename, '#', 1)
+    if len(parts) == 2:
+        return parts
+    else:
+        return pagename, ""
 
 ########################################################################
 ### Tickets - used by RenamePage and DeletePage
--- a/docs/CHANGES	Mon Jan 05 23:56:02 2009 +0100
+++ b/docs/CHANGES	Sat Jan 24 03:13:41 2009 +0100
@@ -31,6 +31,7 @@
     editor_force = True
     editor_default = 'text'  # internal default, just for completeness
 
+
 Version 1.9.current:
   New features:
     * HINT: MoinMoin is now a WSGI application.
@@ -44,6 +45,10 @@
       so the old syntax #!python/pascal/cplusplus/... still works.
 
 
+Version 1.8.current:
+  Bug fixes:
+    * Fix update xapian index by trivial changes (MoinMoinBugs/TrivialChangesDoesNotUpdateTheXapianIndex)
+
 
 Version 1.8.1:
   Bug fixes:
--- a/wiki/data/pages/BadContent/current	Mon Jan 05 23:56:02 2009 +0100
+++ b/wiki/data/pages/BadContent/current	Sat Jan 24 03:13:41 2009 +0100
@@ -1,1 +1,1 @@
-00000001
+00000002
--- a/wiki/htdocs/common/js/common.js	Mon Jan 05 23:56:02 2009 +0100
+++ b/wiki/htdocs/common/js/common.js	Sat Jan 24 03:13:41 2009 +0100
@@ -302,7 +302,7 @@
             elem = form.elements[eidx];
             name = elem.name;
             if (name) {
-                if (name.substr(0,4) == 'dbw.' && name.substr(-7) == '.submit')
+                if (name.indexOf('dbw.') >= 0 && name.substr(-7) == '.submit')
                     elem.style.display = 'none';
             }
         }