changeset 3378:dd7df6fe929a

merge main
author Radomir Dopieralski <moindev@sheep.art.pl>
date Thu, 20 Mar 2008 22:51:04 +0100
parents 4aeb96183e04 (current diff) 0215dd9fa6ee (diff)
children d0cc11c9c821 779f2ab6cb91
files
diffstat 2 files changed, 10 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/action/revert.py	Thu Mar 20 22:50:41 2008 +0100
+++ b/MoinMoin/action/revert.py	Thu Mar 20 22:51:04 2008 +0100
@@ -34,7 +34,7 @@
         return allowed, _('You are not allowed to revert this page!')
 
     def check_condition(self):
-        """ checks page and revision """
+        """ checks valid page and rev """
         _ = self._
         if not self.request.rev:
             # same string as in PageEditor...
@@ -49,23 +49,15 @@
             return None
 
     def do_action(self):
-        """ Revert pagename """
-        _ = self._
+        """ revert pagename """
+        form = self.form
+        comment = form.get('comment', [u''])[0]
+        comment = wikiutil.clean_input(comment)
 
         if self.request.request_method != 'POST':
             return False, u''
 
-        form = self.form
         rev = self.request.rev
-        comment = form.get('comment', [u''])[0]
-        system_comment = _(u"Revert to revision %(rev)d.") % {'rev': int(rev)}
-        if not comment:
-            comment = system_comment
-        else:
-            comment = "%(comment)s (%(system_comment)s)" % {"comment": comment,
-                                                            "system_comment": system_comment}
-
-        comment = wikiutil.clean_input(comment)
         pg = PageEditor(self.request, self.pagename)
 
         try:
--- a/MoinMoin/macro/RecentChanges.py	Thu Mar 20 22:50:41 2008 +0100
+++ b/MoinMoin/macro/RecentChanges.py	Thu Mar 20 22:51:04 2008 +0100
@@ -39,12 +39,11 @@
         elif action == 'ATTDRW':
             comment = _("Drawing '%(filename)s' saved.") % {
                 'filename': filename}
-    elif not comment:
-        if '/REVERT' in action:
-            rev = int(line.extra)
-            comment = _("Revert to revision %(rev)d.") % {'rev': rev}
-        elif '/RENAME' in action:
-            comment = _("Renamed from '%(oldpagename)s'.") % {'oldpagename': line.extra}
+    elif '/REVERT' in action:
+        rev = int(line.extra)
+        comment = (_("Revert to revision %(rev)d.") % {'rev': rev}) + " " + comment
+    elif '/RENAME' in action:
+        comment = (_("Renamed from '%(oldpagename)s'.") % {'oldpagename': line.extra}) + " " + comment
 
     return wikiutil.make_breakable(comment, _MAX_COMMENT_LENGTH)