diff MoinMoin/action/SyncPages.py @ 1264:064778edb38c

Started integration of direction DOWN support.
author Alexander Schremmer <alex AT alexanderweb DOT de>
date Sat, 12 Aug 2006 23:54:14 +0200
parents e313c2187271
children ff08338e67fe
line wrap: on
line diff
--- a/MoinMoin/action/SyncPages.py	Sat Aug 12 23:20:57 2006 +0200
+++ b/MoinMoin/action/SyncPages.py	Sat Aug 12 23:54:14 2006 +0200
@@ -28,6 +28,7 @@
 from MoinMoin.util.bdiff import decompress, patch, compress, textdiff
 from MoinMoin.util import diff3
 
+
 # directions
 UP, DOWN, BOTH = range(3)
 directions_map = {"up": UP, "down": DOWN, "both": BOTH}
@@ -131,9 +132,10 @@
     def sync(self, params, local, remote):
         """ This method does the syncronisation work. """
         _ = self.request.getText
+        direction = params["direction"]
 
         l_pages = local.get_pages()
-        r_pages = remote.get_pages(exclude_non_writable=params["direction"] != DOWN)
+        r_pages = remote.get_pages(exclude_non_writable=direction != DOWN)
 
         if params["groupList"]:
             pages_from_groupList = set(local.getGroupItems(params["groupList"]))
@@ -180,7 +182,7 @@
                 newest_tag = matching_tags[-1]
                 local_rev = newest_tag.current_rev
                 remote_rev = newest_tag.remote_rev
-                if remote_rev == rp.remote_rev and local_rev == current_rev:
+                if remote_rev == rp.remote_rev and (direction == DOWN or local_rev == current_rev):
                     continue # no changes done, next page
                 old_page = Page(self.request, local_pagename, rev=local_rev)
                 old_contents = old_page.get_raw_body_str()