<commit_before>#!/bin/bash
#
# export current working directory in a format suitable for sending to MySQL
# as a snapshot. also generates the actual snapshot and sends it to MySQL.

set -eu

die () {
  echo $*
  exit 1
}

if [ $# -ne 2 ] ; then
  die "Usage: export.sh revision-number-of-last-snapshot current-revision-number"
fi

set +u
if test -z $EDITOR; then
  die "\$EDITOR is not set"
fi
set -u

rm -rf to-mysql
mkdir to-mysql{,/storage,/patches,/mysql-test{,/t,/r,/include}}
svn log -v -r "$(($1 + 1)):BASE" > to-mysql/log
svn export -q . to-mysql/storage/innobase

seq $(($1+1)) $2|while read REV
do
  PATCH=to-mysql/patches/r$REV.patch
  svn log -v -r$REV > $PATCH
  if [ $(wc -c < $PATCH) -gt 73 ]
  then
    svn diff -r$(($REV-1)):$REV >> $PATCH
  else
    rm $PATCH
  fi
done

cd to-mysql/storage/innobase

mv mysql-test/*.test mysql-test/*.opt ../../mysql-test/t
mv mysql-test/*.result ../../mysql-test/r
mv mysql-test/*.inc ../../mysql-test/include
rmdir mysql-test

rm setup.sh export.sh revert_gen.sh compile-innodb-debug compile-innodb

cd ../..
$EDITOR log
cd ..

fname="innodb-5.1-ss$2.tar.gz"
<commit_msg>* Use START_REV instead of $(($1 + 1)) and END_REV instead of $2 * Use standard while-loop instead of the seq command<commit_after>#!/bin/bash
#
# export current working directory in a format suitable for sending to MySQL
# as a snapshot. also generates the actual snapshot and sends it to MySQL.

set -eu

die () {
  echo $*
  exit 1
}

if [ $# -ne 2 ] ; then
  die "Usage: export.sh revision-number-of-last-snapshot current-revision-number"
fi

START_REV=$(($1 + 1))
END_REV=$2

set +u
if test -z $EDITOR; then
  die "\$EDITOR is not set"
fi
set -u

rm -rf to-mysql
mkdir to-mysql{,/storage,/patches,/mysql-test{,/t,/r,/include}}
svn log -v -r "$START_REV:BASE" > to-mysql/log
svn export -q . to-mysql/storage/innobase

REV=$START_REV
while [ $REV -le $END_REV ]
do
  PATCH=to-mysql/patches/r$REV.patch
  svn log -v -r$REV > $PATCH
  if [ $(wc -c < $PATCH) -gt 73 ]
  then
    svn diff -r$(($REV-1)):$REV >> $PATCH
  else
    rm $PATCH
  fi
  REV=$(($REV + 1))
done

cd to-mysql/storage/innobase

mv mysql-test/*.test mysql-test/*.opt ../../mysql-test/t
mv mysql-test/*.result ../../mysql-test/r
mv mysql-test/*.inc ../../mysql-test/include
rmdir mysql-test

rm setup.sh export.sh revert_gen.sh compile-innodb-debug compile-innodb

cd ../..
$EDITOR log
cd ..

fname="innodb-5.1-ss$2.tar.gz"

{'fraction_non_alphanumeric': 0.16914805624483042, 'fraction_numerical': 0.011579818031430935, 'mean_word_length': 2.9526143790849675, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, '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': '3330615', 'n_tokens_mistral': 1001, 'n_tokens_neox': 962, 'n_words': 275}