diff MoinMoin/action/SyncPages.py @ 1343:144c3281e88f

Now the deletion of remote pages is working.
author Alexander Schremmer <alex AT alexanderweb DOT de>
date Sun, 20 Aug 2006 15:49:12 +0200
parents bf59bd23289b
children 564cc2b53ea9
line wrap: on
line diff
--- a/MoinMoin/action/SyncPages.py	Sun Aug 20 13:48:16 2006 +0200
+++ b/MoinMoin/action/SyncPages.py	Sun Aug 20 15:49:12 2006 +0200
@@ -48,7 +48,6 @@
         self.pagename = pagename
         self.page = PageEditor(request, pagename)
         self.status = []
-        request.flush()
 
     def log_status(self, level, message="", substitutions=(), raw_suffix=""):
         """ Appends the message with a given importance level to the internal log. """
@@ -147,7 +146,7 @@
         self.page.saveText(self.page.get_raw_body() + "\n\n" + self.generate_log_table(), 0)
         # XXX release readlock on self.page
 
-        return self.page.send_page(self.request, msg=msg)
+        self.page.send_page(self.request, msg=msg)
     
     def sync(self, params, local, remote):
         """ This method does the syncronisation work.
@@ -249,9 +248,11 @@
                 if rp.local_deleted and not remote_change:
                     if direction == DOWN:
                         return
-                    self.log_status(ActionClass.ERROR, "Nothing done, I should have deleted %r remotely" % rp) # XXX add
-                    msg = remote.delete_page(rp.remote_name)
-                    self.log_status(ActionClass.INFO, _("Deleted page %s remotely."), (rp.name, ))
+                    msg = remote.delete_page(rp.remote_name, rp.remote_rev, local_full_iwid)
+                    if not msg:
+                        self.log_status(ActionClass.INFO, _("Deleted page %s remotely."), (rp.name, ))
+                    else:
+                        self.log_status(ActionClass.ERROR, _("Error while deleting page %s remotely:"), (rp.name, ), msg)
                     return
                 if rp.local_mime_type != MIMETYPE_MOIN and not (local_change ^ remote_change):
                     self.log_status(ActionClass.WARN, _("The item %s cannot be merged but was changed in both wikis. Please delete it in one of both wikis and try again."), (rp.name, ))