You are here: Foswiki>Tasks Web>Item13890 (08 Feb 2016, GeorgeClark)Edit Attach

Item13890: bulk_copy ignores --latest option

pencil
Priority: Urgent
Current State: Closed
Released In: 2.1.0
Target Release: minor
Applies To: Engine
Component: FoswikiTools
Branches: master Release02x00
Reported By: BenjaminMartin
Waiting For:
Last Change By: GeorgeClark
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
 
Topic revision: r3 - 08 Feb 2016, GeorgeClark - This page was cached on 28 Mar 2017 - 14:03.

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License