<commit_before>package net.sourceforge.pebble.util;

import net.sourceforge.pebble.domain.Blog;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

/**
 * Utilities for upgrading blogs.
 *
 * @author    <NAME>
 */
public class UpgradeUtilities {

  /** the logger used by this action */
  private static final Log log = LogFactory.getLog(UpgradeUtilities.class);

  public static void upgradeBlog(Blog blog, String fromVersion, String toVersion) throws Exception {
    log.info("Upgrading blog from " + fromVersion + " to " + toVersion);
    if (fromVersion == null) {
      Utilities.restructureStaticPages(blog);
      Utilities.buildIndexes(blog);
    }
  }

}
<commit_msg>PEBBLE-2 migrate static pages on upgrade from 2.3.x<commit_after>package net.sourceforge.pebble.util;

import net.sourceforge.pebble.domain.Blog;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

/**
 * Utilities for upgrading blogs.
 *
 * @author    <NAME>
 */
public class UpgradeUtilities {

  /** the logger used by this action */
  private static final Log log = LogFactory.getLog(UpgradeUtilities.class);

  public static void upgradeBlog(Blog blog, String fromVersion, String toVersion) throws Exception {
    log.info("Upgrading blog from " + fromVersion + " to " + toVersion);
    if (fromVersion == null || fromVersion.startsWith("2.3")) {
      log.info("restructuring static pages");
      Utilities.restructureStaticPages(blog);
      log.info("building indizes");
      Utilities.buildIndexes(blog);
      log.info("upgrade done");
    } else {
      log.info("No upgrade required");
    }
  }

}

{'fraction_non_alphanumeric': 0.11273364485981309, 'fraction_numerical': 0.0029205607476635513, 'mean_word_length': 3.3148614609571787, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7316407', 'n_tokens_mistral': 523, 'n_tokens_neox': 501, 'n_words': 121}