changeset 36511:9660e629352b

py3: port the markdirver extension in tests/test-resolve.t Differential Revision: https://phab.mercurial-scm.org/D2505
author Pulkit Goyal <7895pulkit@gmail.com>
date Wed, 28 Feb 2018 21:57:22 +0530
parents 4dc6f0905722
children 14d2371216ba
files tests/test-resolve.t
diffstat 1 files changed, 7 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- 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()