comparison MoinMoin/action/SyncPages.py @ 1888:ffe2e789a7c6

SyncPages: fixed direction both from cgi server to standalone server and immutable pages on both servers.
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Sat, 17 Mar 2007 10:32:50 +0100
parents da6479b19bd2
children b06ef2a53efa
comparison
equal deleted inserted replaced
1887:447c183a41bc 1888:ffe2e789a7c6
304 local_rev = sp.local_rev # merge against the newest version 304 local_rev = sp.local_rev # merge against the newest version
305 old_contents = "" 305 old_contents = ""
306 306
307 if matching_tags: 307 if matching_tags:
308 newest_tag = matching_tags[-1] 308 newest_tag = matching_tags[-1]
309 309
310 local_change = newest_tag.current_rev != sp.local_rev 310 local_change = newest_tag.current_rev != sp.local_rev
311 remote_change = newest_tag.remote_rev != sp.remote_rev 311 remote_change = newest_tag.remote_rev != sp.remote_rev
312 312
313 # handle some cases where we cannot continue for this page 313 # handle some cases where we cannot continue for this page
314 if not remote_change and (direction == DOWN or not local_change): 314 if not remote_change and (direction == DOWN or not local_change):
466 self.log_status(ActionClass.ERROR, _("The page %s could not be merged because you are not allowed to modify the page in the remote wiki."), (sp.name, )) 466 self.log_status(ActionClass.ERROR, _("The page %s could not be merged because you are not allowed to modify the page in the remote wiki."), (sp.name, ))
467 return 467 return
468 else: 468 else:
469 very_current_remote_rev = current_remote_rev 469 very_current_remote_rev = current_remote_rev
470 470
471
471 if local_change_done: 472 if local_change_done:
472 self.remove_rollback(rollback_local_change) 473 self.remove_rollback(rollback_local_change)
473 474
474 tags.add(remote_wiki=remote_full_iwid, remote_rev=very_current_remote_rev, current_rev=new_local_rev, direction=direction, normalised_name=sp.name) 475 # this is needed at least for direction both and cgi sync to standalone for immutable pages on both
476 # servers. It is not needed for the opposite direction
477 try:
478 tags.add(remote_wiki=remote_full_iwid, remote_rev=very_current_remote_rev, current_rev=new_local_rev, direction=direction, normalised_name=sp.name)
479 except:
480 self.log_status(ActionClass.ERROR, _("The page %s could not be merged because you are not allowed to modify the page in the remote wiki."), (sp.name, ))
481 return
475 482
476 if sp.local_mime_type != MIMETYPE_MOIN or not wikiutil.containsConflictMarker(merged_text): 483 if sp.local_mime_type != MIMETYPE_MOIN or not wikiutil.containsConflictMarker(merged_text):
477 self.log_status(ActionClass.INFO, _("Page %s successfully merged."), (sp.name, )) 484 self.log_status(ActionClass.INFO, _("Page %s successfully merged."), (sp.name, ))
478 elif is_remote_conflict: 485 elif is_remote_conflict:
479 self.log_status(ActionClass.WARN, _("Page %s contains conflicts that were introduced on the remote side."), (sp.name, )) 486 self.log_status(ActionClass.WARN, _("Page %s contains conflicts that were introduced on the remote side."), (sp.name, ))