summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorintrigeri <intrigeri@boum.org>2009-03-08 15:47:50 +0100
committerintrigeri <intrigeri@boum.org>2009-03-08 15:47:50 +0100
commit1efb182d56931974aebbc9029e98ccf28adcf043 (patch)
tree2d2c361aaf80bc1f77752c70d51132d9af417219
parent1bf21d2a375c7cf29c6e6436e253cf715717919c (diff)
rename: remove duplicates that hook functions may have added to @torename
Signed-off-by: intrigeri <intrigeri@boum.org>
-rw-r--r--IkiWiki/Plugin/rename.pm10
1 files changed, 8 insertions, 2 deletions
diff --git a/IkiWiki/Plugin/rename.pm b/IkiWiki/Plugin/rename.pm
index 38cebdba5..d3ca8bd3a 100644
--- a/IkiWiki/Plugin/rename.pm
+++ b/IkiWiki/Plugin/rename.pm
@@ -318,8 +318,14 @@ sub sessioncgi ($$) {
cgi => $q,
session => $session,
);
- # FIXME: remove duplicates (based on src or srcfile key)
- # from @torename
+
+ # remove duplicates from @torename
+ my %seen=();
+ my @uniq_torename;
+ foreach my $item (@torename) {
+ push(@uniq_torename, $item) unless $seen{$item->{src}}++;
+ }
+ @torename=@uniq_torename;
require IkiWiki::Render;
IkiWiki::disable_commit_hook() if $config{rcs};