From f586eafe90510a49b37052c39b1b60e23c20e081 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Tue, 30 Dec 2008 23:00:46 +0100 Subject: [PATCH] po: remove renamed pages special handling, not needed anymore Thanks to the new rename hook behaviour, the whole renaming work is now done by the rename plugin, and we don't need to remember which pages were renamed. --- IkiWiki/Plugin/po.pm | 46 +------------------------------------------- 1 file changed, 1 insertion(+), 45 deletions(-) diff --git a/IkiWiki/Plugin/po.pm b/IkiWiki/Plugin/po.pm index 15b07e84b..d8a7de8eb 100644 --- a/IkiWiki/Plugin/po.pm +++ b/IkiWiki/Plugin/po.pm @@ -337,7 +337,6 @@ sub renamepages() { #{{{ foreach my $rename (@torename) { next unless istranslatable($rename->{src}); - setrenamed($rename->{src}, $rename->{dest}); my %otherpages=%{otherlanguages($rename->{src})}; debug "bla".$rename->{src}; while (my ($lang, $otherpage) = each %otherpages) { @@ -358,18 +357,12 @@ sub mydelete(@) { #{{{ map { deletetranslations($_); - } grep { istranslatablefile($_) && ! renamed(pagename($_))} @deleted; + } grep { istranslatablefile($_) } @deleted; } #}}} sub change(@) { #{{{ my @rendered=@_; - my $eachrenamed=eachrenamed(); - while (my ($oldpage, $newpage) = $eachrenamed->()) { - renametranslations($oldpage, $newpage); - } - resetrenamed(); - my $updated_po_files=0; # Refresh/create POT and PO files as needed. @@ -531,35 +524,6 @@ sub myurlto ($$;$) { #{{{ } #}}} } -{ - my %renamed; - - sub renamed ($) { #{{{ - my $page=shift; - - if (exists $renamed{$page} && - defined $renamed{$page}) { - return $renamed{$page}; - } - return; - } #}}} - - sub setrenamed ($$) { #{{{ - my $oldpage=shift; - my $newpage=shift; - - $renamed{$oldpage}=$newpage; - } #}}} - - sub resetrenamed () { #{{{ - undef %renamed; - } #}}} - - sub eachrenamed () { #{{{ - return sub { each %renamed }; - } #}}} -} - # ,---- # | Helper functions # `---- @@ -833,14 +797,6 @@ sub deletetranslations ($) { #{{{ debug "po(deletetranslations): TODO: delete translations of $deletedmasterfile"; } #}}} -sub renametranslations (@) { #{{{ - my ($oldpage, $newpage)=(shift, shift); - - # FIXME - not needed anymore : debug "po(renametranslations): TODO: rename translations of $oldpage to $newpage"; - -} #}}} - - # ,---- # | PageSpec's # `---- -- 2.26.2