view tests/test-debugbuilddag @ 11765:aff419e260f9 stable

templatefilters: make json filter handle multibyte characters correctly It aims to fix javascript error of hgweb's graph view in Japanese 'cp932' encoding. 'cp932' contains multibyte characters ending with '\x5c' (backslash), e.g. '\x94\x5c' for Japanese Kanji 'Noh'. Due to json filter escapes '\' to '\\', multibyte string ending with '\x5c' is translated to "xxx\", resulting javascript parse error on a web browser. This patch changes json() to pass unicode to jsonescape(). Unicode decoding error handler changed to 'replace' by Patrick Mézard.
author Yuya Nishihara <yuya@tcha.org>
date Sat, 07 Aug 2010 16:27:16 +0900
parents 0f3c8a47960e
children fc360de66217
line wrap: on
line source

#! /bin/sh

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



echo ---- overwritten and appended files

rm -rf repo
hg init repo
cd repo
hg debugbuilddag '+2:f +3:p2 @temp <f+4 @default /p2 +2' -q -oa
echo -- dag
hg debugdag -t -b
echo -- glog
hg glog --template '{rev}: {desc} [{branches}] @ {date}\n'
echo -- glog of
hg glog --template '{rev}: {desc} [{branches}]\n' of
echo -- glog af
hg glog --template '{rev}: {desc} [{branches}]\n' af
echo -- tags
hg tags -v
echo -- cat of
hg cat of
echo -- cat af
hg cat af
cd ..

echo ---- new and mergeable files

rm -rf repo
hg init repo
cd repo
hg debugbuilddag '+2:f +3:p2 @temp <f+4 @default /p2 +2' -q -mn
echo -- dag
hg debugdag -t -b
echo -- glog
hg glog --template '{rev}: {desc} [{branches}] @ {date}\n'
echo -- glog mf
hg glog --template '{rev}: {desc} [{branches}]\n' mf

echo -- man r4
hg manifest -r4
echo -- cat r4 mf
hg cat -r4 mf
echo -- man r8
hg manifest -r8
echo -- cat r8 mf
hg cat -r8 mf
echo -- man
hg manifest
echo -- cat mf
hg cat mf
cd ..

echo ---- command

rm -rf repo
hg init repo
cd repo
hg debugbuilddag '+2 !"touch X" +2' -q -o
echo -- dag
hg debugdag -t -b
echo -- glog
hg glog --template '{rev}: {desc} [{branches}]\n'
echo -- glog X
hg glog --template '{rev}: {desc} [{branches}]\n' X
cd ..