<commit_before>require 'flash_flow/merge/base'

module FlashFlow
  module Merge
    class Release < Base

      class PendingReleaseError < RuntimeError; end
      class GitPushFailure < RuntimeError; end

      def initialize(opts={})
        super(opts)

        @force = opts[:force]
        @release_branches = parse_branches(opts[:release_branches])

        @data = Data::Base.new({}, Config.configuration.branch_info_file, @git, logger: logger)
      end

      def run
        begin
          check_version
          check_branches
          puts "Merging these branches into #{@git.release_branch}:\n  #{@release_branches.map(&:ref).join("\n  ")}"
          logger.info "\n\n### Beginning #{@local_git.merge_branch} merge ###\n\n"

          mergers, errors = [], []

          @lock.with_lock do
            release = pending_release
            if release
              raise PendingReleaseError.new("There is already a pending release: #{release}")
            elsif release_ahead_of_master
              raise PendingReleaseError.new("The release branch '#{@git.release_branch}' has commits that are not in master")
            end

            @git.in_original_merge_branch do<commit_msg>Fixed method call.<commit_after>require 'flash_flow/merge/base'

module FlashFlow
  module Merge
    class Release < Base

      class PendingReleaseError < RuntimeError; end
      class GitPushFailure < RuntimeError; end

      def initialize(opts={})
        super(opts)

        @force = opts[:force]
        @release_branches = parse_branches(opts[:release_branches])

        @data = Data::Base.new({}, Config.configuration.branch_info_file, @git, logger: logger)
      end

      def run
        begin
          check_version
          check_branches
          puts "Merging these branches into #{@git.release_branch}:\n  #{@release_branches.map(&:ref).join("\n  ")}"
          logger.info "\n\n### Beginning #{@local_git.merge_branch} merge ###\n\n"

          mergers, errors = [], []

          @lock.with_lock do
            release = pending_release
            if release
              raise PendingReleaseError.new("There is already a pending release: #{release}")
            elsif release_ahead_of_master?
              raise PendingReleaseError.new("The release branch '#{@git.release_branch}' has commits that are not in master")
            end

            @git.in_original_merge_branch do
{'fraction_non_alphanumeric': 0.1020746887966805, 'fraction_numerical': 0.0, 'mean_word_length': 2.4442857142857144, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 3, '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': '2952397', 'n_tokens_mistral': 672, 'n_tokens_neox': 657, 'n_words': 165}