comparison MoinMoin/action/SyncPages.py @ 1272:e85ad6a95ae5

Documented new ideas in the docstring, changed tag format (store normalised name), transmit normalised name in mergeDiff.
author Alexander Schremmer <alex AT alexanderweb DOT de>
date Mon, 14 Aug 2006 22:26:41 +0200
parents bb2f70fc9734
children 93ecff3f806f
comparison
equal deleted inserted replaced
1271:bb2f70fc9734 1272:e85ad6a95ae5
139 exists | deleted | In this case, we do a normal merge if there 139 exists | deleted | In this case, we do a normal merge if there
140 | | are no tags. If there were changes in 140 | | are no tags. If there were changes in
141 | | Wiki A, there is a merge with a conflict. 141 | | Wiki A, there is a merge with a conflict.
142 | | Otherwise (no changes past last merge), 142 | | Otherwise (no changes past last merge),
143 | | the page is deleted in Wiki A. 143 | | the page is deleted in Wiki A.
144 | | This needs static info that could be
145 | | transferred with the pagelist.
144 ----------+----------+------------------------------- 146 ----------+----------+-------------------------------
145 exists | non- | Now the wiki knows that the page was renamed. 147 exists | non- | Now the wiki knows that the page was renamed.
146 with tags | existant | There should be an RPC method that asks 148 with tags | existant | There should be an RPC method that asks
147 | | for the new name (which could be recorded 149 | | for the new name (which could be recorded
148 | | on page rename). Then the page is 150 | | on page rename). Then the page is
149 | | renamed in Wiki A as well and the sync 151 | | renamed in Wiki A as well and the sync
150 | | is done normally. 152 | | is done normally.
153 | | Every wiki retains a dict that maps
154 | | (IWID, oldname) => newname and that is
155 | | updated on every rename. oldname refers
156 | | to the pagename known by the old wiki (can be
157 | | gathered from tags).
151 ----------+----------+------------------------------- 158 ----------+----------+-------------------------------
152 exists | any case | Do a sync without considering tags 159 exists | any case | Try a rename search first, then
160 | | do a sync without considering tags
153 with tags | with non | to ensure data integrity. 161 with tags | with non | to ensure data integrity.
154 | matching | 162 | matching |
155 | tags | 163 | tags |
156 ----------+----------+------------------------------- 164 ----------+----------+-------------------------------
157 """ 165 """
270 278
271 new_local_rev = current_page.get_real_rev() 279 new_local_rev = current_page.get_real_rev()
272 280
273 if direction == BOTH: 281 if direction == BOTH:
274 try: 282 try:
275 very_current_remote_rev = remote.merge_diff(rp.remote_name, compress(diff), new_local_rev, current_remote_rev, current_remote_rev, local_full_iwid) 283 very_current_remote_rev = remote.merge_diff(rp.remote_name, compress(diff), new_local_rev, current_remote_rev, current_remote_rev, local_full_iwid, rp.name)
276 except Exception, e: 284 except Exception, e:
277 raise # XXX rollback locally and do not tag locally 285 raise # XXX rollback locally and do not tag locally
278 else: 286 else:
279 very_current_remote_rev = current_remote_rev 287 very_current_remote_rev = current_remote_rev
280 288
281 tags.add(remote_wiki=remote_full_iwid, remote_rev=very_current_remote_rev, current_rev=new_local_rev, direction=direction) 289 tags.add(remote_wiki=remote_full_iwid, remote_rev=very_current_remote_rev, current_rev=new_local_rev, direction=direction, normalised_name=rp.name)
282 290
283 if not wikiutil.containsConflictMarker(verynewtext): 291 if not wikiutil.containsConflictMarker(verynewtext):
284 self.log_status(ActionClass.INFO, _("Page successfully merged.")) 292 self.log_status(ActionClass.INFO, _("Page successfully merged."))
285 else: 293 else:
286 self.log_status(ActionClass.WARN, _("Page merged with conflicts.")) 294 self.log_status(ActionClass.WARN, _("Page merged with conflicts."))