# HG changeset patch # User Augie Fackler # Date 1526763030 14400 # Node ID 5a87bf0bd34377f10b19d770acb943d7fda250f3 # Parent c3eda7207f25b555cdf58803fc57e94146c3dc25 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 diff -r c3eda7207f25 -r 5a87bf0bd343 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',