changeset 634:31797904ee5a

do not offer revert for empty revisions (as that does not work anyway)
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Fri, 12 May 2006 17:35:50 +0200
parents 1b852a8055fe
children 9e17ec23650c
files MoinMoin/wikiaction.py docs/CHANGES
diffstat 2 files changed, 9 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/wikiaction.py	Fri May 12 17:05:22 2006 +0200
+++ b/MoinMoin/wikiaction.py	Fri May 12 17:35:50 2006 +0200
@@ -515,6 +515,7 @@
             rev = int(line.rev)
             actions = ""
             if line.action in ['SAVE','SAVENEW','SAVE/REVERT',]:
+                size = page.size(rev=rev)
                 if count == 0: # latest page
                     actions = '%s&nbsp;%s' % (actions, page.link_to(request,
                         text=_('view'),
@@ -535,7 +536,7 @@
                     actions = '%s&nbsp;%s' % (actions, page.link_to(request,
                         text=_('print'),
                         querystr='action=print&rev=%d' % rev))
-                    if may_revert:
+                    if may_revert and size: # you can only revert to nonempty revisions
                         actions = '%s&nbsp;%s' % (actions, page.link_to(request,
                             text=_('revert'),
                             querystr='action=revert&rev=%d' % (rev,)))
@@ -548,11 +549,9 @@
                 else:
                     lchecked = rchecked = ''
                 diff = '<input type="radio" name="rev1" value="%d"%s><input type="radio" name="rev2" value="%d"%s>' % (rev,lchecked,rev,rchecked)
-      
                 comment = line.comment
                 if not comment and line.action.find('/REVERT') != -1:
                         comment = _("Revert to revision %(rev)d.") % {'rev': int(line.extra)}
-                size = page.size(rev=rev)
             else: # ATT*
                 rev = '-'
                 diff = '-'
--- a/docs/CHANGES	Fri May 12 17:05:22 2006 +0200
+++ b/docs/CHANGES	Fri May 12 17:35:50 2006 +0200
@@ -33,9 +33,14 @@
     critical stuff gets committed with -m "... (backport to 1.5)" and then
     backported to 1.5. :) Commits to 1.5 done in any other way are likely to
     get reverted.
-  * refactored some actions to use ActionBase base class
-  * moved "test" action from wikiaction to MoinMoin/action/ (and use ActionBase)
 
+  Developer notes:
+    * refactored some actions to use ActionBase base class
+    * moved "test" action from wikiaction to MoinMoin/action/ (and use ActionBase)
+
+  Bugfixes:
+    * on action "info" page, "revert" link will not be displayed for empty page
+      revisions (but you just can delete the current page to get an empty rev.)
 
 Version 1.5.current:
   Developer notes: