changeset 1326:0c3927a3b8a2

Getting syncing of pages working that are just on one side, still faulty, though.
author Alexander Schremmer <alex AT alexanderweb DOT de>
date Sat, 19 Aug 2006 01:01:58 +0200
parents c48e57b1460a
children 506d04a9ceee
files MoinMoin/action/SyncPages.py MoinMoin/wikisync.py docs/CHANGES.aschremmer
diffstat 3 files changed, 13 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/action/SyncPages.py	Sat Aug 19 01:01:03 2006 +0200
+++ b/MoinMoin/action/SyncPages.py	Sat Aug 19 01:01:58 2006 +0200
@@ -346,7 +346,7 @@
         #l_new_pages = u", ".join([unicode(x) for x in local_but_not_remote])
         #raise ActionStatus("These pages are in the remote wiki, but not local: " + wikiutil.escape(r_new_pages) + "<br>These pages are in the local wiki, but not in the remote one: " + wikiutil.escape(l_new_pages))
 
-        for rp in on_both_sides:
+        for rp in m_pages: #on_both_sides:
             handle_page(rp)
 
 
--- a/MoinMoin/wikisync.py	Sat Aug 19 01:01:03 2006 +0200
+++ b/MoinMoin/wikisync.py	Sat Aug 19 01:01:58 2006 +0200
@@ -64,6 +64,7 @@
         self.remote_deleted = remote_deleted
         self.local_mime_type = MIMETYPE_MOIN   # XXX no usable storage API yet
         self.remote_mime_type = MIMETYPE_MOIN
+        assert remote_rev != 99999999
 
     def __repr__(self):
         return repr("<Remote Page %r>" % unicode(self))
@@ -94,7 +95,7 @@
         elif self.remote_name is None:
             n_name = normalise_pagename(self.local_name, local.prefix)
             assert n_name is not None
-            self.remote_name = (local.prefix or "") + n_name
+            self.remote_name = (remote.prefix or "") + n_name
 
         return self # makes using list comps easier
 
@@ -252,7 +253,10 @@
             normalised_name = normalise_pagename(name, self.prefix)
             if normalised_name is None:
                 continue
-            rpages.append(SyncPage(normalised_name, remote_rev=abs(revno), remote_name=name, remote_deleted=revno < 0))
+            if abs(revno) != 99999999: # I love sane in-band signalling
+                remote_rev = abs(revno)
+                remote_deleted = revno < 0
+                rpages.append(SyncPage(normalised_name, remote_rev=remote_rev, remote_name=name, remote_deleted=remote_deleted))
         return rpages
 
     def __repr__(self):
@@ -280,7 +284,10 @@
         if normalised_name is None:
             return None
         page = Page(self.request, page_name)
-        return SyncPage(normalised_name, local_rev=page.get_real_rev(), local_name=page_name, local_deleted=not page.exists())
+        revno = page.get_real_rev()
+        if revno == 99999999: # I love sane in-band signalling
+            revno = None
+        return SyncPage(normalised_name, local_rev=revno, local_name=page_name, local_deleted=not page.exists())
 
     # Public methods:
 
--- a/docs/CHANGES.aschremmer	Sat Aug 19 01:01:03 2006 +0200
+++ b/docs/CHANGES.aschremmer	Sat Aug 19 01:01:58 2006 +0200
@@ -114,7 +114,8 @@
          normalised name. Implemented preliminary mime type support, only transmission of the mime type
          and the new storage API is missing. Changed getDiff interface. Detect renamed pages (and choke :).
          Added infrastructure support for detecting deleted pages (not used in the merging logic yet).
-         Reworked i18n and logging support. Added GetText2 macro.
+         Reworked i18n and logging support. Added GetText2 macro. Getting syncing of pages
+         working that are just available on one side, still faulty though.
 
 2006-07-18: the requested daily entry is missing here, see http://moinmoin.wikiwikiweb.de/GoogleSoc2006/BetterProgress
 2006-07-19: the requested daily entry is missing here, see http://moinmoin.wikiwikiweb.de/GoogleSoc2006/BetterProgress