comparison MoinMoin/action/SyncPages.py @ 1271:bb2f70fc9734

Have been thinking about a solution for the remaining sync cases, put the thoughts into a docstring."
author Alexander Schremmer <alex AT alexanderweb DOT de>
date Mon, 14 Aug 2006 22:06:53 +0200
parents eb9e5e21b0e5
children e85ad6a95ae5
comparison
equal deleted inserted replaced
1270:db1811c83ccc 1271:bb2f70fc9734
129 129
130 # XXX append self.status to the job page 130 # XXX append self.status to the job page
131 return self.page.send_page(self.request, msg=msg) 131 return self.page.send_page(self.request, msg=msg)
132 132
133 def sync(self, params, local, remote): 133 def sync(self, params, local, remote):
134 """ This method does the syncronisation work. """ 134 """ This method does the syncronisation work.
135 Currently, it handles the case where the pages exist on both sides.
136 Now there are a few other cases left that have to be implemented:
137 Wiki A | Wiki B | Remark
138 ----------+----------+------------------------------
139 exists | deleted | In this case, we do a normal merge if there
140 | | are no tags. If there were changes in
141 | | Wiki A, there is a merge with a conflict.
142 | | Otherwise (no changes past last merge),
143 | | the page is deleted in Wiki A.
144 ----------+----------+-------------------------------
145 exists | non- | Now the wiki knows that the page was renamed.
146 with tags | existant | There should be an RPC method that asks
147 | | for the new name (which could be recorded
148 | | on page rename). Then the page is
149 | | renamed in Wiki A as well and the sync
150 | | is done normally.
151 ----------+----------+-------------------------------
152 exists | any case | Do a sync without considering tags
153 with tags | with non | to ensure data integrity.
154 | matching |
155 | tags |
156 ----------+----------+-------------------------------
157 """
135 _ = self.request.getText 158 _ = self.request.getText
136 direction = params["direction"] 159 direction = params["direction"]
137 160
138 l_pages = local.get_pages() 161 l_pages = local.get_pages()
139 r_pages = remote.get_pages(exclude_non_writable=direction != DOWN) 162 r_pages = remote.get_pages(exclude_non_writable=direction != DOWN)