Mercurial > hgsubversion
view tests/fixtures/invalid_utf8.sh @ 922:6b7ac659c855
updatemeta: correctly handle empty metadata
When the repo metadata is empty (just created/cloned but not populated yet),
there is no lastpulled file or the revmap doesn't have a last entry with hash.
Currently "hg svn updatemeta" would crash due to unexpected exception.
See issue reported at https://bitbucket.org/durin42/hgsubversion/issue/356/updatemeta-crashes-with-traceback-if-there
The fix is to check the existence of lastpulled file and the hash entry in
revmap, as part of "hg svn updatemeta" command. When they are not present,
do a rebuildmetadata.
Also added a new unit test, test_updatemeta.py.
author | Jun Fang <junfang@fb.com> |
---|---|
date | Mon, 06 Aug 2012 10:35:51 -0700 |
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 .