comparison tests/fixtures/invalid_utf8.sh @ 910:312f36a425f0

Ignore invalid utf8 in commit messages Old svn allowed users to include invalid utf8 in their commits. Since there are real repos with said invalid utf8, we need to be able to import them, even if svn won't.
author David Schleimer <dschleimer@fb.com>
date Thu, 17 May 2012 14:15:14 -0700
parents
children
comparison
equal deleted inserted replaced
909:e42a05915edf 910:312f36a425f0
1 #!/bin/bash
2 #-*- coding: utf-8 -*-
3 #
4 # Generate invalid_utf8.svndump
5 #
6
7 #check svnadmin version, must be >= 1.7
8 SVNVERSION=$(svnadmin --version | head -n 1 | cut -d \ -f 3)
9 if [[ "$SVNVERSION" < '1.7' ]] ; then
10 echo "You MUST have svn 1.7 or above to use this script"
11 exit 1
12 fi
13
14 set -x
15
16 TMPDIR=$(mktemp -d)
17 WD=$(pwd)
18
19 cd $TMPDIR
20
21 svnadmin create failrepo
22 svn co file://$PWD/failrepo fail
23 (
24 cd fail
25 touch A
26 svn add A
27 svn ci -m blabargrod
28 )
29 svnadmin --pre-1.6-compatible create invalid_utf8
30 svnadmin dump failrepo | \
31 sed "s/blabargrod/$(echo blåbærgrød | iconv -f utf-8 -t latin1)/g" | \
32 svnadmin load --bypass-prop-validation invalid_utf8
33
34 tar cz -C invalid_utf8 -f "$WD"/invalid_utf8.tar.gz .