D923: test-convert-cvs: make test compatible with chg

singhsrb (Saurabh Singh) phabricator at mercurial-scm.org
Tue Oct 3 19:50:13 UTC 2017


singhsrb created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  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.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D923

AFFECTED FILES
  tests/test-convert-cvs.t

CHANGE DETAILS

diff --git a/tests/test-convert-cvs.t b/tests/test-convert-cvs.t
--- a/tests/test-convert-cvs.t
+++ b/tests/test-convert-cvs.t
@@ -12,10 +12,10 @@
   $ echo "convert = " >> $HGRCPATH
   $ cat > cvshooks.py <<EOF
   > def cvslog(ui,repo,hooktype,log):
-  >     print("%s hook: %d entries"%(hooktype,len(log)))
+  >     ui.write('%s hook: %d entries\n' % (hooktype,len(log)))
   > 
   > def cvschangesets(ui,repo,hooktype,changesets):
-  >     print("%s hook: %d changesets"%(hooktype,len(changesets)))
+  >     ui.write('%s hook: %d changesets\n' % (hooktype,len(changesets)))
   > EOF
   $ hookpath=`pwd`
   $ cat <<EOF >> $HGRCPATH



To: singhsrb, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list