-
- my @fixedlinks;
- if ($src ne $dest) {
- push @fixedlinks, fixlinks($src, $dest, $session);
+ IkiWiki::rcs_commit_staged(
+ sprintf(gettext("rename %s to %s"), $srcfile, $destfile),
+ $session->param("name"), $ENV{REMOTE_ADDR}) if $config{rcs};
+
+ # Then link fixups.
+ foreach my $rename (@torename) {
+ next if $rename->{src} eq $rename->{dest};
+ next if $rename->{error};
+ foreach my $p (fixlinks($rename, $session)) {
+ # map old page names to new
+ foreach my $r (@torename) {
+ next if $rename->{error};
+ if ($r->{src} eq $p) {
+ $p=$r->{dest};
+ last;
+ }
+ }
+ push @{$rename->{fixedlinks}}, $p;
+ }