<commit_before>
module GWT
  module Command
    module Integrate
      
      GWT::Command::Help.set_help <<-HELP
|integrate [<feature>]
  Integrate a given feature
  Merge the specified feature (or current feature branch) into the 
  integration branch and look for conflicts. 
HELP
      
      module_function 
      def perform(repo, args)
        # check for if the feature branch is specified
        if args.size == 1
          feature_branch = args[0]
        else 
          # check to see if the current branch is a feature
          feature_branch = repo.current_branch
        end
        
        unless GWT::is_feature_branch? feature_branch
          puts "#{feature_branch} is not a feature branch. Please specify a feature."
          exit 2
        end

        # insure that we are clean
        unless repo.status.changed.nil? and repo.status.added.nil? and repo.status.deleted.nil?
          puts "Not all changes have been committed. Please commit all changes first."
          exit 2
        end
        
        # save the branch so as to return to it after integration
        save_branch = repo.current_branch
        
        #TODO Check to see if all files have been committed

        # switch to integration branch and merge the feature branch
        begin
          repo.branch(GWT::integration_branch).checkout
          repo.pull
          repo.branch(feature_branch).merge
        rescue Git::GitExecuteError => e
          if e.message.match "would be overwritten"
            puts "Current branch is not clean please commit before proceeding"
            exit 2
          end
          puts "Unknown git failure: #{e.message}"<commit_msg>Testing integration<commit_after>
module GWT
  module Command
    module Integrate
      
      GWT::Command::Help.set_help <<-HELP
|integrate [<feature>]
  Integrate a given feature
  Merge the specified feature (or current feature branch) into the 
  integration branch and look for conflicts. 
HELP
      
      module_function 
      def perform(repo, args)
        # check for if the feature branch is specified
        if args.size == 1
          feature_branch = args[0]
        else 
          # check to see if the current branch is a feature
          feature_branch = repo.current_branch
        end
        
        unless GWT::is_feature_branch? feature_branch
          puts "#{feature_branch} is not a feature branch. Please specify a feature."
          exit 2
        end

        # insure that we are clean
        puts "changed = #{repo.status.changed}"
        puts "added = #{repo.status.added}"
        puts "deleted = #{repo.status.deleted}"
        unless repo.status.changed.nil? and repo.status.added.nil? and repo.status.deleted.nil?
          puts "Not all changes have been committed. Please commit all changes first."
          exit 2
        end
        
        # save the branch so as to return to it after integration
        save_branch = repo.current_branch
        
        #TODO Check to see if all files have been committed

        # switch to integration branch and merge the feature branch
        begin
          repo.branch(GWT::integration_branch).checkout
          repo.pull
          repo.branch(feature_branch).merge
        rescue Git::GitExecuteError => e
          if e.message.match "would be overwritten"
            puts "Current branch is not clean please commit before proceeding"
            exit 2
          end
          puts "Unknown git failure: #{e.message}"
{'fraction_non_alphanumeric': 0.059496567505720827, 'fraction_numerical': 0.002860411899313501, 'mean_word_length': 2.0303292894280762, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, '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': '2240160', 'n_tokens_mistral': 889, 'n_tokens_neox': 871, 'n_words': 345}