comparison tests/test-convert-cvs.t @ 34449:47b9c572ca32

test-convert-cvs: make test compatible with chg The test uses the 'print' method instead of writing to stdout using 'ui.write' which leads to incompatibility with chg. This commit modifies the test to use the 'ui' object instead which fixes the problem. Test Plan: Ran the test 'test-convert-cvs.t' with and without '--chg' option. Differential Revision: https://phab.mercurial-scm.org/D923
author Saurabh Singh <singhsrb@fb.com>
date Tue, 03 Oct 2017 12:49:28 -0700
parents 24849d53697d
children 6a1a0a023fc1
comparison
equal deleted inserted replaced
34448:1f5bd3e1a7fe 34449:47b9c572ca32
10 > } 10 > }
11 $ echo "[extensions]" >> $HGRCPATH 11 $ echo "[extensions]" >> $HGRCPATH
12 $ echo "convert = " >> $HGRCPATH 12 $ echo "convert = " >> $HGRCPATH
13 $ cat > cvshooks.py <<EOF 13 $ cat > cvshooks.py <<EOF
14 > def cvslog(ui,repo,hooktype,log): 14 > def cvslog(ui,repo,hooktype,log):
15 > print("%s hook: %d entries"%(hooktype,len(log))) 15 > ui.write('%s hook: %d entries\n' % (hooktype,len(log)))
16 > 16 >
17 > def cvschangesets(ui,repo,hooktype,changesets): 17 > def cvschangesets(ui,repo,hooktype,changesets):
18 > print("%s hook: %d changesets"%(hooktype,len(changesets))) 18 > ui.write('%s hook: %d changesets\n' % (hooktype,len(changesets)))
19 > EOF 19 > EOF
20 $ hookpath=`pwd` 20 $ hookpath=`pwd`
21 $ cat <<EOF >> $HGRCPATH 21 $ cat <<EOF >> $HGRCPATH
22 > [hooks] 22 > [hooks]
23 > cvslog = python:$hookpath/cvshooks.py:cvslog 23 > cvslog = python:$hookpath/cvshooks.py:cvslog