po: remove renamed pages special handling, not needed anymore
authorintrigeri <intrigeri@boum.org>
Tue, 30 Dec 2008 22:00:46 +0000 (23:00 +0100)
committerintrigeri <intrigeri@boum.org>
Tue, 30 Dec 2008 22:00:46 +0000 (23:00 +0100)
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

index 15b07e84b481c6a82f5930ce14c79828303e26ec..d8a7de8eb529600204ccdf0eaac4e467a70477c7 100644 (file)
@@ -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
 # `----