<commit_before>#!/usr/bin/env bash

#
#  This script updates the compiled versions of the JS and CSS
#  in DNZO and increments the version number in the app.yaml file.
#

exit_unless_confirmed ()
{
  CONTINUE=""
  while [ "$CONTINUE" = "" ]
  do
    echo ""
    echo "$1 Can we continue? [y/n]"
    read CONTINUE
  done

  if ! [[ "$CONTINUE" =~ y|Y ]]
  then
    echo "Yikes, aborting."
    exit
  fi
}

echo "Updating so we know we're at the head revision ..."
svn up
if ! [ $? -eq 0 ]
then
  echo "Subversion update failed; exiting."
  
  exit
fi

if [ -n "$(svn status)" ]
then
  echo "Subversion shows outstanding changes."
  echo "Please commit those changes before running this script."
  
  exit
fi

# Update the _compiled JS/CSS files
./compile_resources.sh

# Get the current svn revision number.
REV=$(svn info . | grep Revision | sed -E -e s/[^0-9]+//g)

exit_unless_confirmed "Looks like the revision number is $REV. Is that correct?"
echo "Great, updating dnzo/app.yaml version to match this revision ..."

# Update dnzo/app.yaml with the correct revision number.
sed -E -e \
    "s/^version:[[:space:]]+[[:digit:]]+/version: $REV/" \
    dnzo/app.yaml > dnzo/app.yaml.new
mv dnzo/app.yaml.new dnzo/app.yaml

echo "Commiting the following files for deployment:"

echo
svn status
echo

svn commit -m "Commit to deploy r$REV at http://$REV.latest.dnzo.appspot.com/"
if ! [ $? -eq 0 ]
then
  echo "Subversion commit failed; exiting."
  
  exit
fi

echo "Submitting to App Engine ..."

appcfg.py update dnzo

echo "Done!"<commit_msg>Test commit with getdnzo.com commit hook.<commit_after>#!/usr/bin/env bash

#
#  This script updates the compiled versions of the JS and CSS
#  in DNZO and increments the version number in the app.yaml file.
#

exit_unless_confirmed ()
{
  CONTINUE=""
  while [ "$CONTINUE" = "" ]
  do
    echo ""
    echo "$1 Can we continue? [y/n]"
    read CONTINUE
  done

  if ! [[ "$CONTINUE" =~ y|Y ]]
  then
    echo "Yikes, aborting."
    exit
  fi
}

echo "Updating so we know we're at the head revision ..."
svn up
if ! [ $? -eq 0 ]
then
  echo "Subversion update failed; exiting."
  
  exit
fi

if [ -n "$(svn status)" ]
then
  echo "Subversion shows outstanding changes."
  echo "Please commit those changes before running this script."
  
  exit
fi

# Update the _compiled JS/CSS files
./compile_resources.sh

# Get the current svn revision number.
REV=$(svn info . | grep Revision | sed -E -e s/[^0-9]+//g)

exit_unless_confirmed "Looks like the revision number is $REV. Is that correct?"
echo "Great, updating dnzo/app.yaml version to match this revision ..."

# Update dnzo/app.yaml with the correct revision number.
sed -E -e \
    "s/^version:[[:space:]]+[[:digit:]]+/version: $REV/" \
    dnzo/app.yaml > dnzo/app.yaml.new
mv dnzo/app.yaml.new dnzo/app.yaml

echo "Commiting the following files for deployment:"

echo
svn status
echo

svn commit -m "Commit to deploy r$REV at http://$REV.latest.dnzo.appspot.com/"
if ! [ $? -eq 0 ]
then
  echo "Subversion commit failed; exiting."
  
  exit
fi

echo "Submitting to App Engine ..."

appcfg.py update dnzo

echo "Done!"


{'fraction_non_alphanumeric': 0.12708600770218229, 'fraction_numerical': 0.003209242618741977, 'mean_word_length': 3.090551181102362, 'pattern_counts': {'":': 0, '<': 3, '<?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': '1934790', 'n_tokens_mistral': 1146, 'n_tokens_neox': 1088, 'n_words': 384}