py3: port the markdirver extension in tests/test-resolve.t
authorPulkit Goyal <7895pulkit@gmail.com>
Wed, 28 Feb 2018 21:57:22 +0530
changeset 36511 9660e629352b
parent 36510 4dc6f0905722
child 36512 14d2371216ba
py3: port the markdirver extension in tests/test-resolve.t Differential Revision: https://phab.mercurial-scm.org/D2505
tests/test-resolve.t
--- a/tests/test-resolve.t	Wed Feb 28 21:48:30 2018 +0530
+++ b/tests/test-resolve.t	Wed Feb 28 21:57:22 2018 +0530
@@ -85,24 +85,25 @@
 
   $ cat > $TESTTMP/markdriver.py << EOF
   > '''mark and unmark files as driver-resolved'''
-  > from mercurial import merge, registrar, scmutil
+  > from mercurial import merge, registrar, scmutil, pycompat
   > cmdtable = {}
   > command = registrar.command(cmdtable)
   > @command(b'markdriver',
-  >   [('u', 'unmark', None, '')],
-  >   'FILE...')
+  >   [(b'u', b'unmark', None, b'')],
+  >   b'FILE...')
   > def markdriver(ui, repo, *pats, **opts):
   >     wlock = repo.wlock()
+  >     opts = pycompat.byteskwargs(opts)
   >     try:
   >         ms = merge.mergestate.read(repo)
   >         m = scmutil.match(repo[None], pats, opts)
   >         for f in ms:
   >             if not m(f):
   >                 continue
-  >             if not opts['unmark']:
-  >                 ms.mark(f, 'd')
+  >             if not opts[b'unmark']:
+  >                 ms.mark(f, b'd')
   >             else:
-  >                 ms.mark(f, 'u')
+  >                 ms.mark(f, b'u')
   >         ms.commit()
   >     finally:
   >         wlock.release()