view tests/fixtures/invalid_utf8.sh @ 1500:f75c1d112793

tox: give up on Mercurial older than 3.2 Mercurial 3.2 is from November of 2014, and there's a more recent Ubuntu LTS release than 2014 now available. Debian stable has 3.1, but the backports get users up to 3.7.x, so I'm comfortable just letting these older versions of hg be broken.
author Augie Fackler <raf@durin42.com>
date Sun, 12 Feb 2017 18:31:47 -0500
parents 312f36a425f0
children
line wrap: on
line source

#!/bin/bash
#-*- coding: utf-8 -*-
#
# Generate invalid_utf8.svndump
#

#check svnadmin version, must be >= 1.7
SVNVERSION=$(svnadmin --version | head -n 1 | cut -d \  -f 3)
if [[ "$SVNVERSION" < '1.7' ]] ; then
    echo "You MUST have svn 1.7 or above to use this script"
    exit 1
fi

set -x

TMPDIR=$(mktemp -d)
WD=$(pwd)

cd $TMPDIR

svnadmin create failrepo
svn co file://$PWD/failrepo fail
(
   cd fail
   touch A
   svn add A
   svn ci -m blabargrod
)
svnadmin --pre-1.6-compatible create invalid_utf8
svnadmin dump failrepo | \
    sed "s/blabargrod/$(echo blåbærgrød | iconv -f utf-8 -t latin1)/g" | \
    svnadmin load --bypass-prop-validation invalid_utf8

tar cz -C invalid_utf8 -f "$WD"/invalid_utf8.tar.gz .