From 313fc8ca0b2b77bf92ea1313ad054e04b85b1273 Mon Sep 17 00:00:00 2001 From: Antonio Terceiro Date: Mon, 29 Dec 2008 19:24:42 -0300 Subject: [PATCH] ActionItem862: more upgrade testing --- script/apply-template | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/script/apply-template b/script/apply-template index 88ef412..9e6924b 100755 --- a/script/apply-template +++ b/script/apply-template @@ -8,14 +8,22 @@ env = Environment.default def move_articles_to_blog(profile) profile.articles.each { |article| - puts 'including ' + article.path + ' in the blog' - if !article.blog? && !article.is_a?(RssFeed) - article.parent_id = profile.blog.id + if !article.blog? && !article.is_a?(RssFeed) && article.public_article + puts 'including ' + article.path + ' in the blog' + article.parent = profile.blog article.save! end } end +def report_doing(n, text) + puts "#{n} - #{text} ..." +end + +def report_done + puts "[done]" +end + case $ARGV[0] when 'inactive-enterprise' offset = 0 @@ -47,9 +55,10 @@ when 'community' offset = 0 while community = Community.find(:first, :order => :id, :offset => offset) if community != template && !excluded.include?(community.identifier) + report_doing offset, profile.name community.apply_template(template) move_articles_to_blog(community) - puts "#{offset} - #{community.identifier}" + report_done end offset = offset + 1 end @@ -58,9 +67,10 @@ when 'person' offset = 0 while person = Person.find(:first, :order => :id, :offset => offset) if person != template + report_doing offset, person.identifier person.apply_template(template) move_articles_to_blog(person) - puts "#{offset} - #{person.identifier}" + report_done end offset = offset + 1 end -- libgit2 0.21.2