tests: port inline extensions in test-obsolete.t to Python 3
authorAugie Fackler <augie@google.com>
Sat, 19 May 2018 16:50:30 -0400
changeset 38132 5a87bf0bd343
parent 38131 c3eda7207f25
child 38133 18424aeece7f
tests: port inline extensions in test-obsolete.t to Python 3 Still some lingering failure in here, but it's much better. Differential Revision: https://phab.mercurial-scm.org/D3626
tests/test-obsolete.t
--- a/tests/test-obsolete.t	Sat May 19 16:22:15 2018 -0400
+++ b/tests/test-obsolete.t	Sat May 19 16:50:30 2018 -0400
@@ -1318,16 +1318,18 @@
   $ cat >$TESTTMP/test_extension.py  << EOF
   > from __future__ import absolute_import
   > from mercurial.i18n import _
-  > from mercurial import cmdutil, registrar
+  > from mercurial import cmdutil, pycompat, registrar
+  > from mercurial.utils import stringutil
   > 
   > cmdtable = {}
   > command = registrar.command(cmdtable)
   > @command(b"amendtransient",[], _(b'hg amendtransient [rev]'))
   > def amend(ui, repo, *pats, **opts):
-  >   opts['message'] = 'Test'
-  >   opts['logfile'] = None
-  >   cmdutil.amend(ui, repo, repo['.'], {}, pats, opts)
-  >   ui.write(b'%s\n' % repo.changelog.headrevs())
+  >   opts = pycompat.byteskwargs(opts)
+  >   opts[b'message'] = b'Test'
+  >   opts[b'logfile'] = None
+  >   cmdutil.amend(ui, repo, repo[b'.'], {}, pats, opts)
+  >   ui.write(b'%s\n' % stringutil.pprint(repo.changelog.headrevs()))
   > EOF
   $ cat >> $HGRCPATH << EOF
   > [extensions]
@@ -1365,7 +1367,7 @@
   >   hidden = repoview.filterrevs(repo, b'visible')
   >   if sorted(hidden1) != sorted(hidden):
   >     print("cache inconsistency")
-  >  bkmstoreinst._repo.currenttransaction().addpostclose('test_extension', trhook)
+  >  bkmstoreinst._repo.currenttransaction().addpostclose(b'test_extension', trhook)
   >  orig(bkmstoreinst, *args, **kwargs)
   > def extsetup(ui):
   >   extensions.wrapfunction(bookmarks.bmstore, '_recordchange',