Item13890: bulk_copy ignores --latest option
Priority: Urgent
Current State: Closed
Released In: 2.1.0
Target Release: minor
Applies To: Engine
Component: FoswikiTools
Branches: master Release02x00
Running with option "--latest" from documentation:
perl bulk_copy.pl --xweb System --iweb '*' --latest '*.WebStatistics' --latest '*.WebStatisticsBis2014' /var/www/f119/bin /var/www/foswiki/bin
ignores "--latest" and creates all the revision files.
--
BenjaminMartin - 08 Dec 2015
Problem is that the code is comparing just the Topic name against a Web.Topic regex.
diff --git a/core/tools/bulk_copy.pl b/core/tools/bulk_copy.pl
index f743e73..1568bca 100755
--- a/core/tools/bulk_copy.pl
+++ b/core/tools/bulk_copy.pl
@@ -277,7 +277,8 @@ sub copy_topic {
# The revision list is sorted starting with the most recent revision
my @rev_list = $topicMO->getRevisionHistory()->all();
- if ( grep { $topic =~ /^$_$/ } @{ $control{latest} } ) {
+
+ if ( grep { "$web.$topic" =~ /^$_$/ } @{ $control{latest} } ) {
announce "\t-only latest";
# Only do latest rev
--
GeorgeClark - 08 Dec 2015