# HG changeset patch # User Paul Boddie # Date 1383331477 -3600 # Node ID 28a7c5cc9e2910e0297fd895d45b1a29851a2b8e # Parent cfb5c203b6f4d9b49a49280fd0c0bd0010837421 Fixed the addrevision mtime patch; added mtime support to addattachment. diff -r cfb5c203b6f4 -r 28a7c5cc9e29 patches/patch-moin-1.9-MoinMoin-packages.diff --- a/patches/patch-moin-1.9-MoinMoin-packages.diff Fri Nov 01 19:30:41 2013 +0100 +++ b/patches/patch-moin-1.9-MoinMoin-packages.diff Fri Nov 01 19:44:37 2013 +0100 @@ -1,6 +1,6 @@ diff -r 77533e162654 MoinMoin/packages.py --- a/MoinMoin/packages.py Tue Aug 13 12:17:47 2013 +0200 -+++ b/MoinMoin/packages.py Fri Nov 01 19:28:42 2013 +0100 ++++ b/MoinMoin/packages.py Fri Nov 01 19:43:59 2013 +0100 @@ -96,6 +96,10 @@ """ return (string.lower() in ('yes', 'true', '1')) @@ -12,6 +12,24 @@ class ScriptEngine: """ The script engine supplies the needed commands to execute the installation +@@ -118,7 +122,7 @@ + self.msg = getattr(self, "msg", "") + self.request = getattr(self, "request", None) + +- def do_addattachment(self, zipname, filename, pagename, author=u"Scripting Subsystem", comment=u""): ++ def do_addattachment(self, zipname, filename, pagename, author=u"Scripting Subsystem", comment=u"", mtime=None): + """ + Installs an attachment + +@@ -133,7 +137,7 @@ + filename = wikiutil.taintfilename(filename) + zipname = wikiutil.taintfilename(zipname) + target = os.path.join(attachments, filename) +- page = PageEditor(self.request, pagename, do_editor_backup=0, uid_override=author) ++ page = PageEditor(self.request, pagename, do_editor_backup=0, uid_override=author, mtime=mtime) + rev = page.current_rev() + path = page.getPagePath(check_create=0) + if not os.path.exists(target): @@ -286,7 +290,7 @@ self.msg += package.msg @@ -21,15 +39,18 @@ """ Adds a revision to a page. @param filename: name of the file in this package -@@ -298,7 +302,7 @@ +@@ -298,9 +302,9 @@ _ = self.request.getText trivial = str2boolean(trivial) if self.request.user.may.write(pagename): - page = PageEditor(self.request, pagename, do_editor_backup=0) + page = PageEditor(self.request, pagename, do_editor_backup=0, uid_override=author) try: - page.saveText(self.extract_file(filename).decode("utf-8"), 0, trivial=trivial, comment=comment) +- page.saveText(self.extract_file(filename).decode("utf-8"), 0, trivial=trivial, comment=comment) ++ page.saveText(self.extract_file(filename).decode("utf-8"), 0, trivial=trivial, comment=comment, mtime=mtime) except PageEditor.Unchanged: + pass + else: @@ -555,6 +559,7 @@ # Setup MoinMoin environment from MoinMoin.web.contexts import ScriptContext