view tests/test-repair-strip @ 9021:2ccb527c7b1a

gendoc: fix localization of help topic When a topic provides a callable method for its text, most likely this text will be generated from different parts, so it does not make sense to apply gettext on the whole result, rather the method should provide translation by itself. This is the case with the extensions topic, which triggers a double gettext call, making the ASCII codec fail when it encounters 8 bit characters, and prevents the documentation from being built.
author Cédric Duval <cedricduval@free.fr>
date Sat, 04 Jul 2009 12:12:36 +0200
parents f00573bc93f8
children 4a1b24dbf753
line wrap: on
line source

#!/bin/sh

echo "[extensions]" >> $HGRCPATH
echo "mq=">> $HGRCPATH

teststrip() {
    hg -q up -C $1
    echo % before update $1, strip $2
    hg parents
    chmod -$3 $4
    hg strip $2 2>&1 | sed 's/\(saving bundle to \).*/\1/' | sed 's/Permission denied.*\.hg\/store\/\(.*\)/Permission denied \.hg\/store\/\1/'
    echo % after update $1, strip $2
    chmod +$3 $4
    hg verify
    echo % journal contents
    cat .hg/store/journal | sed 's/\.i[^\n]*/\.i/'
    ls .hg/store/journal >/dev/null 2>&1 && hg recover
    ls .hg/strip-backup/* >/dev/null 2>&1 && hg unbundle -q .hg/strip-backup/*
    rm -rf .hg/strip-backup
}

hg init test
cd test

echo a > a
hg -q ci -m "a" -A

echo b > b
hg -q ci -m "b" -A

echo b2 >> b
hg -q ci -m "b2" -A

echo c > c
hg -q ci -m "c" -A
 
teststrip 0 2 w .hg/store/data/b.i
teststrip 0 2 r .hg/store/data/b.i
teststrip 0 2 w .hg/store/00manifest.i