I would like to propose a new builtin variable, @REVISION@,
which would contain the revision number that will be created by this
"Edit" action.  You could use to add something like

  Revision @REVISION@ approved by @[EMAIL PROTECTED]

...which really means that @USERNAME@ is approving the version including
his edits, which I think is fine.

This is *tentative*: I'm not sure I will need it, but it was so easy to
write the patch that I just did it in 10 minutes.  So I'm going to play
around with it and see if it is useful for me.  If so, I will try to get
it merged upstream.  Thought I would share the idea here and see if
anyone else thinks it would be useful.  I will attach my patch (relative
to moin/1.8 branch).

        Greg
diff -r 4186e90ead06 MoinMoin/PageEditor.py
--- a/MoinMoin/PageEditor.py    Sat Oct 04 23:16:54 2008 +0200
+++ b/MoinMoin/PageEditor.py    Tue Oct 21 10:41:13 2008 -0400
@@ -775,7 +775,8 @@
             'USERNAME': signature,
             'USER': "-- %s" % signature,
             'SIG': "-- %s <<DateTime(%s)>>" % (signature, now),
-            'EMAIL': "<<MailTo(%s)>>" % (obfuscated_email_address)
+            'EMAIL': "<<MailTo(%s)>>" % (obfuscated_email_address),
+            'REVISION': str(self.get_real_rev() + 1),
         }
 
         if u.valid and u.name:
diff -r 4186e90ead06 MoinMoin/_tests/test_PageEditor.py
--- a/MoinMoin/_tests/test_PageEditor.py        Sat Oct 04 23:16:54 2008 +0200
+++ b/MoinMoin/_tests/test_PageEditor.py        Tue Oct 21 10:41:13 2008 -0400
@@ -19,6 +19,7 @@
 class TestExpandVars(object):
     """PageEditor: testing page editor"""
     pagename = u'AutoCreatedMoinMoinTemporaryTestPage'
+    revision = 37
 
     _tests = (
         # Variable,             Expanded
@@ -26,10 +27,11 @@
         ("[EMAIL PROTECTED]@bedded", "em%sbedded" % pagename),
         ("@NOVAR@", "@NOVAR@"),
         ("[EMAIL PROTECTED]@sensitive", "[EMAIL PROTECTED]@sensitive"),
+        ("@REVISION@", unicode(revision + 1)),
         )
 
     def setup_method(self, method):
-        self.page = PageEditor(self.request, self.pagename)
+        self.page = PageEditor(self.request, self.pagename, rev=self.revision)
 
     def testExpandVariables(self):
         """ PageEditor: expand general variables """
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Moin-user mailing list
Moin-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/moin-user

Reply via email to