changeset 3727:fd63e84632df

fix tests failing due to rename by making the comment default u'' rather than None
author Johannes Berg <johannes AT sipsolutions DOT net>
date Fri, 20 Jun 2008 22:00:21 +0200
parents cf391507fe8e
children bba0d3392918 fef3c5039997
files MoinMoin/PageEditor.py
diffstat 1 files changed, 2 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/PageEditor.py	Fri Jun 20 13:07:14 2008 +0200
+++ b/MoinMoin/PageEditor.py	Fri Jun 20 22:00:21 2008 +0200
@@ -520,7 +520,7 @@
             request.theme.add_msg(_('Edit was cancelled.'), "error")
             self.send_page()
 
-    def copyPage(self, newpagename, comment=None):
+    def copyPage(self, newpagename, comment=u''):
         """ Copy the current version of the page (keeping the backups, logs and attachments).
 
         @param comment: Comment given by user
@@ -557,8 +557,6 @@
         try:
             filesys.copytree(oldpath, newpath)
             self.error = None
-            if not comment:
-                comment = u"## page was copied from %s" % self.page_name
             savetext = u"## page was copied from %s\n%s" % (self.page_name, savetext)
             Page.__init__(self, request, newpagename)
             self._write_file(savetext, "SAVENEW", comment)
@@ -575,7 +573,7 @@
             else:
                 return False, _('Could not copy page because of file system error: %s.') % unicode(err)
 
-    def renamePage(self, newpagename, comment=None):
+    def renamePage(self, newpagename, comment=u''):
         """ Rename the current version of the page (making a backup before deletion
             and keeping the backups, logs and attachments).