diff options
author | Joey Hess <joey@kitenet.net> | 2010-10-08 19:31:06 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2010-10-08 19:31:06 -0400 |
commit | f826251a6d506d6f8a31e30abfbe89338351bd6a (patch) | |
tree | 0c15b7609f6e4c1efd7b9929ff877ca4e5c400e9 /doc/plugins | |
parent | c8214300ed6198d3a59cc1e3b3d74b0722c26b91 (diff) | |
parent | 2d99fe0d34be35d9e5d556d530f2d8993007cdf6 (diff) |
Merge branch 'revert'
Diffstat (limited to 'doc/plugins')
-rw-r--r-- | doc/plugins/recentchanges.mdwn | 2 | ||||
-rw-r--r-- | doc/plugins/write.mdwn | 30 |
2 files changed, 27 insertions, 5 deletions
diff --git a/doc/plugins/recentchanges.mdwn b/doc/plugins/recentchanges.mdwn index 823f68502..6fff18e8a 100644 --- a/doc/plugins/recentchanges.mdwn +++ b/doc/plugins/recentchanges.mdwn @@ -6,6 +6,8 @@ generates a page describing each recent change made to the wiki. These pages can be joined together with [[inline]] to generate the [[RecentChanges]] page. +This plugin also currently handles web-based reversion of changes. + Typically only the RecentChanges page will use the pages generated by this plugin, but you can use it elsewhere too if you like. It's used like this: diff --git a/doc/plugins/write.mdwn b/doc/plugins/write.mdwn index d5bd1dd76..6b751f0cd 100644 --- a/doc/plugins/write.mdwn +++ b/doc/plugins/write.mdwn @@ -1154,8 +1154,6 @@ context, and the whole diff in scalar context. This is used to get the page creation time for a file from the RCS, by looking it up in the history. -It's ok if this is not implemented, and throws an error. - If the RCS cannot determine a ctime for the file, return 0. #### `rcs_getmtime($)` @@ -1176,9 +1174,9 @@ sense to implement for all RCSs. It should examine the incoming changes, and do any sanity checks that are appropriate for the RCS to limit changes to safe file adds, -removes, and changes. If something bad is found, it should exit -nonzero, to abort the push. Otherwise, it should return a list of -files that were changed, in the form: +removes, and changes. If something bad is found, it should die, to abort +the push. Otherwise, it should return a list of files that were changed, +in the form: { file => # name of file that was changed @@ -1191,6 +1189,28 @@ files that were changed, in the form: The list will then be checked to make sure that each change is one that is allowed to be made via the web interface. +#### `rcs_preprevert($)` + +This is called by the revert web interface. It is passed a RCS-specific +change ID, and should determine what the effects would be of reverting +that change, and return the same data structure as `rcs_receive`. + +Like `rcs_receive`, it should do whatever sanity checks are appropriate +for the RCS to limit changes to safe changes, and die if a change would +be unsafe to revert. + +#### `rcs_revert($)` + +This is called by the revert web interface. It is passed a named +parameter rev that is the RCS-specific change ID to revert. + +It should try to revert the specified rev, and leave the reversion staged +so `rcs_commit_staged` will complete it. It should return undef on _success_ +and an error message on failure. + +This hook and `rcs_preprevert` are optional, if not implemented, no revert +web interface will be available. + ### PageSpec plugins It's also possible to write plugins that add new functions to |