changeset 3366:80ecec6e008b

action.revert: keep revert action in log
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Thu, 20 Mar 2008 21:14:58 +0100
parents e64bb042f178
children 48acb9e0a097
files MoinMoin/action/revert.py
diffstat 1 files changed, 11 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/action/revert.py	Thu Mar 20 20:16:44 2008 +0100
+++ b/MoinMoin/action/revert.py	Thu Mar 20 21:14:58 2008 +0100
@@ -49,14 +49,22 @@
 
     def do_action(self):
         """ Delete pagename """
-        form = self.form
-        comment = form.get('comment', [u''])[0]
-        comment = wikiutil.clean_input(comment)
+        _ = self._
 
         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: