changeset 1325:c48e57b1460a

Allow passing None for some rev parameters of mergeDiff.
author Alexander Schremmer <alex AT alexanderweb DOT de>
date Sat, 19 Aug 2006 01:01:03 +0200
parents 2e29ef86be26
children 0c3927a3b8a2
files MoinMoin/xmlrpc/__init__.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/xmlrpc/__init__.py	Sat Aug 19 00:00:04 2006 +0200
+++ b/MoinMoin/xmlrpc/__init__.py	Sat Aug 19 01:01:03 2006 +0200
@@ -722,14 +722,14 @@
         # current version of the page
         currentpage = PageEditor(self.request, pagename, do_editor_backup=0)
 
-        if currentpage.get_real_rev() != last_remote_rev:
+        if last_remote_rev is not None and currentpage.get_real_rev() != last_remote_rev:
             return LASTREV_INVALID
 
         if not currentpage.exists() and diff is None:
             return xmlrpclib.Fault("NOT_EXIST", "The page does not exist and no diff was supplied.")
 
         # base revision used for the diff
-        basepage = Page(self.request, pagename, rev=delta_remote_rev)
+        basepage = Page(self.request, pagename, rev=(delta_remote_rev or 0))
 
         # generate the new page revision by applying the diff
         newcontents = patch(basepage.get_raw_body_str(), decompress(str(diff)))
@@ -737,7 +737,7 @@
 
         # write page
         try:
-            currentpage.saveText(newcontents.decode("utf-8"), last_remote_rev, comment=comment)
+            currentpage.saveText(newcontents.decode("utf-8"), last_remote_rev or 0, comment=comment)
         except PageEditor.Unchanged: # could happen in case of both wiki's pages being equal
             pass
         except PageEditor.EditConflict: