$hooks{rcs}{rcs_revert}{call}->(@_);
}
-sub rcs_showpatch (@) {
- $hooks{rcs}{rcs_showpatch}{call}->(@_);
-}
-
sub add_depends ($$;$) {
my $page=shift;
my $pagespec=shift;
hook(type => "rcs", id => "rcs_receive", call => \&rcs_receive);
hook(type => "rcs", id => "rcs_preprevert", call => \&rcs_preprevert);
hook(type => "rcs", id => "rcs_revert", call => \&rcs_revert);
- hook(type => "rcs", id => "rcs_showpatch", call => \&rcs_showpatch);
}
sub checkconfig () {
}
}
-sub rcs_showpatch (@) {
- # Show the patch with the given revision id.
- my %params = @_;
- my $rev = $params{rev};
-
- return join "\n", run_or_die('git', 'show', $rev);
-}
-
1
}
else {
$form->title(sprintf(gettext("confirm reversion of %s"), $rev));
- my $patch_contents = IkiWiki::rcs_showpatch(rev => $rev);
+ my $patch_contents = IkiWiki::rcs_diff($rev);
$form->tmpl_param(patch_contents => encode_entities($patch_contents));
$form->field(name => "rev", type => "hidden", value => $rev, force => 1);
IkiWiki::showform($form, $buttons, $session, $q);
the reversion, and returns undef on _success_ and an error message
on failure.
-#### `rcs_showpatch(@)`
-
-This is passed a named parameter rev that is a RCS-specific
-change ID. It should generate a diff-style patch showing the changes
-made and return it.
-
### PageSpec plugins
It's also possible to write plugins that add new functions to
> (The data from `rcs_preprevert` could also be used for a confirmation
> prompt -- it doesn't currently include enough info for diffs, but at
> least could have a list of changed files.)
->> I added `rcs_showpatch` which simply yields the output of `git show <patch-id>`. -- [[peteg]]
>
> Note that it's possible for a git repo to have commits that modify wiki
> files in a subdir, and code files elsewhere. `rcs_preprevert` should
>>> (and fixed all the indention..). Issues I noticed but have not gotten
>>> to: --[[Joey]]
>>>> Please change the git pointer above, then. I will work on your branch. -- [[peteg]]
->>>
->>> * `rcs_diff` already exists; why add `rcs_showpatch`?
->>>> If `rcs_diff` is intended for human consumption, by all means we can use that. -- [[peteg]]
>>> * Would it be better for `rcs_revert` to not commit, and
>>> `rcs_commit_staged` to then be used? This would work for git, but