py3: use byte strings for @command registrations
authorMartin von Zweigbergk <martinvonz@google.com>
Tue, 09 Jul 2019 10:56:42 -0700
changeset 4715 12c8b24757f4
parent 4714 c51fc0ae7a7e
child 4716 d587611d0c78
py3: use byte strings for @command registrations
hgext3rd/evolve/__init__.py
hgext3rd/evolve/cmdrewrite.py
hgext3rd/evolve/debugcmd.py
hgext3rd/evolve/depthcache.py
hgext3rd/evolve/obsdiscovery.py
hgext3rd/evolve/obshashtree.py
hgext3rd/evolve/obshistory.py
hgext3rd/evolve/rewind.py
hgext3rd/evolve/stablerange.py
hgext3rd/evolve/stablesort.py
hgext3rd/topic/__init__.py
--- a/hgext3rd/evolve/__init__.py	Wed Jul 03 11:13:47 2019 -0700
+++ b/hgext3rd/evolve/__init__.py	Tue Jul 09 10:56:42 2019 -0700
@@ -467,7 +467,7 @@
     _alias, statuscmd = cmdutil.findcmd('status', commands.table)
     pstatusopts = [o for o in statuscmd[1] if o[1] != 'rev']
 
-    @eh.command('pstatus', pstatusopts)
+    @eh.command(b'pstatus', pstatusopts)
     def pstatus(ui, repo, *args, **kwargs):
         """show status combining committed and uncommited changes
 
@@ -482,7 +482,7 @@
     _alias, diffcmd = cmdutil.findcmd('diff', commands.table)
     pdiffopts = [o for o in diffcmd[1] if o[1] != 'rev']
 
-    @eh.command('pdiff', pdiffopts)
+    @eh.command(b'pdiff', pdiffopts)
     def pdiff(ui, repo, *args, **kwargs):
         """show diff combining committed and uncommited changes
 
@@ -983,14 +983,14 @@
     return target, bookmark
 
 @eh.command(
-    'previous',
-    [('B', 'move-bookmark', False,
-        _('move active bookmark after update')),
-     ('m', 'merge', False, _('bring uncommitted change along')),
-     ('', 'no-topic', False, _('ignore topic and move topologically')),
-     ('n', 'dry-run', False,
-        _('do not perform actions, just print what would be done'))],
-    '[OPTION]...',
+    b'previous',
+    [(b'B', b'move-bookmark', False,
+        _(b'move active bookmark after update')),
+     (b'm', b'merge', False, _(b'bring uncommitted change along')),
+     (b'', b'no-topic', False, _(b'ignore topic and move topologically')),
+     (b'n', b'dry-run', False,
+        _(b'do not perform actions, just print what would be done'))],
+    b'[OPTION]...',
     helpbasic=True)
 def cmdprevious(ui, repo, **opts):
     """update to parent revision
@@ -1041,15 +1041,15 @@
         lockmod.release(wlock)
 
 @eh.command(
-    'next',
-    [('B', 'move-bookmark', False,
-        _('move active bookmark after update')),
-     ('m', 'merge', False, _('bring uncommitted change along')),
-     ('', 'evolve', True, _('evolve the next changeset if necessary')),
-     ('', 'no-topic', False, _('ignore topic and move topologically')),
-     ('n', 'dry-run', False,
-      _('do not perform actions, just print what would be done'))],
-    '[OPTION]...',
+    b'next',
+    [(b'B', b'move-bookmark', False,
+        _(b'move active bookmark after update')),
+     (b'm', b'merge', False, _(b'bring uncommitted change along')),
+     (b'', b'evolve', True, _(b'evolve the next changeset if necessary')),
+     (b'', b'no-topic', False, _(b'ignore topic and move topologically')),
+     (b'n', b'dry-run', False,
+      _(b'do not perform actions, just print what would be done'))],
+    b'[OPTION]...',
     helpbasic=True)
 def cmdnext(ui, repo, **opts):
     """update to next child revision
@@ -1302,9 +1302,9 @@
             raise error.Abort(msg, hint=hint)
 
 @eh.command(
-    'debugobsconvert',
-    [('', 'new-format', obsexchange._bestformat, _('Destination format for markers.'))],
-    '')
+    b'debugobsconvert',
+    [(b'', b'new-format', obsexchange._bestformat, _(b'Destination format for markers.'))],
+    b'')
 def debugobsconvert(ui, repo, new_format):
     origmarkers = repo.obsstore._all  # settle version
     if new_format == repo.obsstore._version:
--- a/hgext3rd/evolve/cmdrewrite.py	Wed Jul 03 11:13:47 2019 -0700
+++ b/hgext3rd/evolve/cmdrewrite.py	Tue Jul 09 10:56:42 2019 -0700
@@ -86,28 +86,28 @@
         opts['user'] = ui.username()
 
 commitopts3 = [
-    ('D', 'current-date', None,
-     _('record the current date as commit date')),
-    ('U', 'current-user', None,
-     _('record the current user as committer')),
+    (b'D', b'current-date', None,
+     _(b'record the current date as commit date')),
+    (b'U', b'current-user', None,
+     _(b'record the current user as committer')),
 ]
 
-interactiveopt = [['i', 'interactive', None, _('use interactive mode')]]
+interactiveopt = [[b'i', b'interactive', None, _(b'use interactive mode')]]
 
 @eh.command(
-    'amend|refresh',
-    [('A', 'addremove', None,
-      _('mark new/missing files as added/removed before committing')),
-     ('a', 'all', False, _("match all files")),
-     ('e', 'edit', False, _('invoke editor on commit messages')),
-     ('', 'extract', False, _('extract changes from the commit to the working copy')),
-     ('', 'patch', False, _('make changes to wdir parent by editing patch')),
-     ('', 'close-branch', None,
-      _('mark a branch as closed, hiding it from the branch list')),
-     ('s', 'secret', None, _('use the secret phase for committing')),
-     ('n', 'note', '', _('store a note on amend'), _('TEXT')),
-    ] + walkopts + commitopts + commitopts2 + commitopts3 + interactiveopt,
-    _('[OPTION]... [FILE]...'),
+    b'amend|refresh',
+    [(b'A', b'addremove', None,
+      _(b'mark new/missing files as added/removed before committing')),
+     (b'a', b'all', False, _(b"match all files")),
+     (b'e', b'edit', False, _(b'invoke editor on commit messages')),
+     (b'', b'extract', False, _(b'extract changes from the commit to the working copy')),
+     (b'', b'patch', False, _(b'make changes to wdir parent by editing patch')),
+     (b'', b'close-branch', None,
+      _(b'mark a branch as closed, hiding it from the branch list')),
+     (b's', b'secret', None, _(b'use the secret phase for committing')),
+     (b'n', b'note', b'', _(b'store a note on amend'), _(b'TEXT')),
+     ] + walkopts + commitopts + commitopts2 + commitopts3 + interactiveopt,
+    _(b'[OPTION]... [FILE]...'),
     helpbasic=True)
 def amend(ui, repo, *pats, **opts):
     """combine a changeset with updates and replace it with a new one
@@ -449,14 +449,14 @@
         ds.copy(src, dst)
 
 @eh.command(
-    'uncommit',
-    [('a', 'all', None, _('uncommit all changes when no arguments given')),
-     ('i', 'interactive', False, _('interactive mode to uncommit (EXPERIMENTAL)')),
-     ('r', 'rev', '', _('revert commit content to REV instead'), _('REV')),
-     ('', 'revert', False, _('discard working directory changes after uncommit')),
-     ('n', 'note', '', _('store a note on uncommit'), _('TEXT')),
+    b'uncommit',
+    [(b'a', b'all', None, _(b'uncommit all changes when no arguments given')),
+     (b'i', b'interactive', False, _(b'interactive mode to uncommit (EXPERIMENTAL)')),
+     (b'r', b'rev', b'', _(b'revert commit content to REV instead'), _(b'REV')),
+     (b'', b'revert', False, _(b'discard working directory changes after uncommit')),
+     (b'n', b'note', b'', _(b'store a note on uncommit'), _(b'TEXT')),
      ] + commands.walkopts + commitopts + commitopts2 + commitopts3,
-    _('[OPTION]... [NAME]'))
+    _(b'[OPTION]... [NAME]'))
 def uncommit(ui, repo, *pats, **opts):
     """move changes from parent revision to working directory
 
@@ -685,13 +685,13 @@
     return newcm
 
 @eh.command(
-    'fold|squash',
-    [('r', 'rev', [], _("revision to fold"), _('REV')),
-     ('', 'exact', None, _("only fold specified revisions")),
-     ('', 'from', None, _("fold revisions linearly to working copy parent")),
-     ('n', 'note', '', _('store a note on fold'), _('TEXT')),
-    ] + commitopts + commitopts2 + commitopts3,
-    _('hg fold [OPTION]... [-r] REV'),
+    b'fold|squash',
+    [(b'r', b'rev', [], _(b"revision to fold"), _(b'REV')),
+     (b'', b'exact', None, _(b"only fold specified revisions")),
+     (b'', b'from', None, _(b"fold revisions linearly to working copy parent")),
+     (b'n', b'note', b'', _(b'store a note on fold'), _(b'TEXT')),
+     ] + commitopts + commitopts2 + commitopts3,
+    _(b'hg fold [OPTION]... [-r] REV'),
     helpbasic=True)
 def fold(ui, repo, *revs, **opts):
     """fold multiple revisions into a single one
@@ -813,12 +813,12 @@
         lockmod.release(lock, wlock)
 
 @eh.command(
-    'metaedit',
-    [('r', 'rev', [], _("revision to edit"), _('REV')),
-     ('', 'fold', None, _("also fold specified revisions into one")),
-     ('n', 'note', '', _('store a note on metaedit'), _('TEXT')),
-    ] + commitopts + commitopts2 + commitopts3,
-    _('hg metaedit [OPTION]... [-r] [REV]'))
+    b'metaedit',
+    [(b'r', b'rev', [], _(b"revision to edit"), _(b'REV')),
+     (b'', b'fold', None, _(b"also fold specified revisions into one")),
+     (b'n', b'note', b'', _(b'store a note on metaedit'), _(b'TEXT')),
+     ] + commitopts + commitopts2 + commitopts3,
+    _(b'hg metaedit [OPTION]... [-r] [REV]'))
 def metaedit(ui, repo, *revs, **opts):
     """edit commit information
 
@@ -939,10 +939,10 @@
             hg.update(repo, newp1)
 
 metadataopts = [
-    ('d', 'date', '',
-     _('record the specified date in metadata'), _('DATE')),
-    ('u', 'user', '',
-     _('record the specified user in metadata'), _('USER')),
+    (b'd', b'date', b'',
+     _(b'record the specified date in metadata'), _(b'DATE')),
+    (b'u', b'user', b'',
+     _(b'record the specified user in metadata'), _(b'USER')),
 ]
 
 def _getmetadata(**opts):
@@ -956,22 +956,22 @@
     return metadata
 
 @eh.command(
-    'prune|obsolete',
-    [('n', 'new', [], _("successor changeset (DEPRECATED)")),
-     ('s', 'succ', [], _("successor changeset"), _('REV')),
-     ('r', 'rev', [], _("revisions to prune"), _('REV')),
-     ('k', 'keep', None, _("does not modify working copy during prune")),
-     ('n', 'note', '', _('store a note on prune'), _('TEXT')),
-     ('', 'pair', False, _("record a pairing, such as a rebase or divergence resolution "
-                           "(pairing multiple precursors to multiple successors)")),
-     ('', 'biject', False, _("alias to --pair (DEPRECATED)")),
-     ('', 'fold', False,
-      _("record a fold (multiple precursors, one successors)")),
-     ('', 'split', False,
-      _("record a split (on precursor, multiple successors)")),
-     ('B', 'bookmark', [], _("remove revs only reachable from given"
-                             " bookmark"), _('BOOKMARK'))] + metadataopts,
-    _('[OPTION] [-r] REV...'),
+    b'prune|obsolete',
+    [(b'n', b'new', [], _(b"successor changeset (DEPRECATED)")),
+     (b's', b'succ', [], _(b"successor changeset"), _(b'REV')),
+     (b'r', b'rev', [], _(b"revisions to prune"), _(b'REV')),
+     (b'k', b'keep', None, _(b"does not modify working copy during prune")),
+     (b'n', b'note', b'', _(b'store a note on prune'), _(b'TEXT')),
+     (b'', b'pair', False, _(b"record a pairing, such as a rebase or divergence resolution "
+                             b"(pairing multiple precursors to multiple successors)")),
+     (b'', b'biject', False, _(b"alias to --pair (DEPRECATED)")),
+     (b'', b'fold', False,
+      _(b"record a fold (multiple precursors, one successors)")),
+     (b'', b'split', False,
+      _(b"record a split (on precursor, multiple successors)")),
+     (b'B', b'bookmark', [], _(b"remove revs only reachable from given"
+                               b" bookmark"), _(b'BOOKMARK'))] + metadataopts,
+    _(b'[OPTION] [-r] REV...'),
     helpbasic=True)
 # XXX -U  --noupdate option to prevent wc update and or bookmarks update ?
 def cmdprune(ui, repo, *revs, **opts):
@@ -1153,12 +1153,12 @@
         lockmod.release(tr, lock, wlock)
 
 @eh.command(
-    'split',
-    [('i', 'interactive', True, _('use interactive mode')),
-     ('r', 'rev', [], _("revision to split"), _('REV')),
-     ('n', 'note', '', _("store a note on split"), _('TEXT')),
-    ] + commitopts + commitopts2 + commitopts3,
-    _('hg split [OPTION] [-r REV] [FILES]'),
+    b'split',
+    [(b'i', b'interactive', True, _(b'use interactive mode')),
+     (b'r', b'rev', [], _(b"revision to split"), _(b'REV')),
+     (b'n', b'note', b'', _(b"store a note on split"), _(b'TEXT')),
+     ] + commitopts + commitopts2 + commitopts3,
+    _(b'hg split [OPTION] [-r REV] [FILES]'),
     helpbasic=True)
 def cmdsplit(ui, repo, *pats, **opts):
     """split a changeset into smaller changesets
@@ -1325,14 +1325,14 @@
         lockmod.release(tr, lock, wlock)
 
 @eh.command(
-    'touch',
-    [('r', 'rev', [], _('revision to update'), _('REV')),
-     ('n', 'note', '', _('store a note on touch'), _('TEXT')),
-     ('D', 'duplicate', False,
-      'do not mark the new revision as successor of the old one'),
-     ('A', 'allowdivergence', False,
-      'mark the new revision as successor of the old one potentially creating '
-      'divergence')],
+    b'touch',
+    [(b'r', b'rev', [], _(b'revision to update'), _(b'REV')),
+     (b'n', b'note', b'', _(b'store a note on touch'), _(b'TEXT')),
+     (b'D', b'duplicate', False,
+      b'do not mark the new revision as successor of the old one'),
+     (b'A', b'allowdivergence', False,
+      b'mark the new revision as successor of the old one potentially creating '
+      b'divergence')],
     # allow to choose the seed ?
     _('[-r] revs'))
 def touch(ui, repo, *revs, **opts):
@@ -1417,12 +1417,12 @@
                 repo.dirstate.setparents(new, node.nullid)
 
 @eh.command(
-    'pick|grab',
-    [('r', 'rev', '', _('revision to pick'), _('REV')),
-     ('c', 'continue', False, 'continue interrupted pick'),
-     ('a', 'abort', False, 'abort interrupted pick'),
+    b'pick|grab',
+    [(b'r', b'rev', b'', _(b'revision to pick'), _(b'REV')),
+     (b'c', b'continue', False, b'continue interrupted pick'),
+     (b'a', b'abort', False, b'abort interrupted pick'),
     ] + mergetoolopts,
-    _('[-r] rev'))
+    _(b'[-r] rev'))
 def cmdpick(ui, repo, *revs, **opts):
     """move a commit on the top of working directory parent and updates to it."""
 
--- a/hgext3rd/evolve/debugcmd.py	Wed Jul 03 11:13:47 2019 -0700
+++ b/hgext3rd/evolve/debugcmd.py	Tue Jul 09 10:56:42 2019 -0700
@@ -21,7 +21,7 @@
 
 eh = exthelper.exthelper()
 
-@eh.command('debugobsstorestat', [], '')
+@eh.command(b'debugobsstorestat', [], b'')
 def cmddebugobsstorestat(ui, repo):
     """print statistics about obsolescence markers in the repo"""
     def _updateclustermap(nodes, mark, clustersmap):
--- a/hgext3rd/evolve/depthcache.py	Wed Jul 03 11:13:47 2019 -0700
+++ b/hgext3rd/evolve/depthcache.py	Tue Jul 09 10:56:42 2019 -0700
@@ -35,12 +35,12 @@
     return len(repo.revs('::%d', rev))
 
 @eh.command(
-    'debugdepth',
+    b'debugdepth',
     [
-        ('r', 'rev', [], 'revs to print depth for'),
-        ('', 'method', 'cached', "one of 'simple', 'cached', 'compare'"),
+        (b'r', b'rev', [], b'revs to print depth for'),
+        (b'', b'method', b'cached', b"one of 'simple', 'cached', 'compare'"),
     ],
-    _('REVS'))
+    _(b'REVS'))
 def debugdepth(ui, repo, **opts):
     """display depth of REVS
     """
--- a/hgext3rd/evolve/obsdiscovery.py	Wed Jul 03 11:13:47 2019 -0700
+++ b/hgext3rd/evolve/obsdiscovery.py	Tue Jul 09 10:56:42 2019 -0700
@@ -186,12 +186,12 @@
 ##############################
 
 @eh.command(
-    'debugobshashrange',
+    b'debugobshashrange',
     [
-        ('', 'rev', [], 'display obshash for all (rev, 0) range in REVS'),
-        ('', 'subranges', False, 'display all subranges'),
+        (b'', b'rev', [], b'display obshash for all (rev, 0) range in REVS'),
+        (b'', b'subranges', False, b'display all subranges'),
     ],
-    _(''))
+    _(b''))
 def debugobshashrange(ui, repo, **opts):
     """display the ::REVS set topologically sorted in a stable way
     """
--- a/hgext3rd/evolve/obshashtree.py	Wed Jul 03 11:13:47 2019 -0700
+++ b/hgext3rd/evolve/obshashtree.py	Tue Jul 09 10:56:42 2019 -0700
@@ -28,9 +28,9 @@
 # the obshash of its parents.  This is similar to what happend for changeset
 # node where the parent is used in the computation
 @eh.command(
-    'debugobsrelsethashtree',
-    [('', 'v0', None, 'hash on marker format "0"'),
-     ('', 'v1', None, 'hash on marker format "1" (default)')], _(''))
+    b'debugobsrelsethashtree',
+    [(b'', b'v0', None, b'hash on marker format "0"'),
+     (b'', b'v1', None, b'hash on marker format "1" (default)')], _(b''))
 def debugobsrelsethashtree(ui, repo, v0=False, v1=False):
     """display Obsolete markers, Relevant Set, Hash Tree
     changeset-node obsrelsethashtree-node
--- a/hgext3rd/evolve/obshistory.py	Wed Jul 03 11:13:47 2019 -0700
+++ b/hgext3rd/evolve/obshistory.py	Tue Jul 09 10:56:42 2019 -0700
@@ -42,14 +42,14 @@
         efd.clear()
 
 @eh.command(
-    'obslog|olog',
-    [('G', 'graph', True, _("show the revision DAG")),
-     ('r', 'rev', [], _('show the specified revision or revset'), _('REV')),
-     ('a', 'all', False, _('show all related changesets, not only precursors')),
-     ('p', 'patch', False, _('show the patch between two obs versions')),
-     ('f', 'filternonlocal', False, _('filter out non local commits')),
-    ] + commands.formatteropts,
-    _('hg olog [OPTION]... [REV]'))
+    b'obslog|olog',
+    [(b'G', b'graph', True, _(b"show the revision DAG")),
+     (b'r', b'rev', [], _(b'show the specified revision or revset'), _(b'REV')),
+     (b'a', b'all', False, _(b'show all related changesets, not only precursors')),
+     (b'p', b'patch', False, _(b'show the patch between two obs versions')),
+     (b'f', b'filternonlocal', False, _(b'filter out non local commits')),
+     ] + commands.formatteropts,
+    _(b'hg olog [OPTION]... [REV]'))
 def cmdobshistory(ui, repo, *revs, **opts):
     """show the obsolescence history of the specified revisions
 
--- a/hgext3rd/evolve/rewind.py	Wed Jul 03 11:13:47 2019 -0700
+++ b/hgext3rd/evolve/rewind.py	Tue Jul 09 10:56:42 2019 -0700
@@ -26,14 +26,14 @@
 identicalflag = 4
 
 @eh.command(
-    'rewind|undo',
-    [('', 'to', [], _("rewind to these revisions"), _('REV')),
-     ('', 'as-divergence', None, _("preserve current latest successors")),
-     ('', 'exact', None, _("only rewind explicitly selected revisions")),
-     ('', 'from', [],
-      _("rewind these revisions to their predecessors"), _('REV')),
-    ],
-    _(''),
+    b'rewind|undo',
+    [(b'', b'to', [], _(b"rewind to these revisions"), _(b'REV')),
+     (b'', b'as-divergence', None, _(b"preserve current latest successors")),
+     (b'', b'exact', None, _(b"only rewind explicitly selected revisions")),
+     (b'', b'from', [],
+      _(b"rewind these revisions to their predecessors"), _(b'REV')),
+     ],
+    _(b''),
     helpbasic=True)
 def rewind(ui, repo, **opts):
     """rewind a stack of changesets to a previous state
--- a/hgext3rd/evolve/stablerange.py	Wed Jul 03 11:13:47 2019 -0700
+++ b/hgext3rd/evolve/stablerange.py	Tue Jul 09 10:56:42 2019 -0700
@@ -72,15 +72,15 @@
 }
 
 @eh.command(
-    'debugstablerange',
+    b'debugstablerange',
     [
-        ('r', 'rev', [], 'operate on (rev, 0) ranges for rev in REVS'),
-        ('', 'subranges', False, 'recursively display data for subranges too'),
-        ('', 'verify', False, 'checks subranges content (EXPENSIVE)'),
-        ('', 'method', 'branchpoint',
-         'method to use, one of "branchpoint", "mergepoint"')
+        (b'r', b'rev', [], b'operate on (rev, 0) ranges for rev in REVS'),
+        (b'', b'subranges', False, b'recursively display data for subranges too'),
+        (b'', b'verify', False, b'checks subranges content (EXPENSIVE)'),
+        (b'', b'method', b'branchpoint',
+         b'method to use, one of "branchpoint", "mergepoint"')
     ],
-    _(''))
+    _(b''))
 def debugstablerange(ui, repo, **opts):
     """display standard stable subrange for a set of ranges
 
--- a/hgext3rd/evolve/stablesort.py	Wed Jul 03 11:13:47 2019 -0700
+++ b/hgext3rd/evolve/stablesort.py	Tue Jul 09 10:56:42 2019 -0700
@@ -52,14 +52,14 @@
     return key
 
 @eh.command(
-    'debugstablesort',
+    b'debugstablesort',
     [
-        ('r', 'rev', [], 'heads to start from'),
-        ('', 'method', 'branchpoint', "method used for sorting, one of: "
-         "branchpoint, basic-mergepoint and basic-headstart"),
-        ('l', 'limit', '', 'number of revision display (default to all)')
+        (b'r', b'rev', [], b'heads to start from'),
+        (b'', b'method', b'branchpoint', b"method used for sorting, one of: "
+         b"branchpoint, basic-mergepoint and basic-headstart"),
+        (b'l', b'limit', b'', b'number of revision display (default to all)')
     ] + commands.formatteropts,
-    _(''))
+    _(b''))
 def debugstablesort(ui, repo, **opts):
     """display the ::REVS set topologically sorted in a stable way
     """
--- a/hgext3rd/topic/__init__.py	Wed Jul 03 11:13:47 2019 -0700
+++ b/hgext3rd/topic/__init__.py	Tue Jul 09 10:56:42 2019 -0700
@@ -626,14 +626,14 @@
 # revset predicates are automatically registered at loading via this symbol
 revsetpredicate = topicrevset.revsetpredicate
 
-@command('topics', [
-        ('', 'clear', False, 'clear active topic if any'),
-        ('r', 'rev', [], 'revset of existing revisions', _('REV')),
-        ('l', 'list', False, 'show the stack of changeset in the topic'),
-        ('', 'age', False, 'show when you last touched the topics'),
-        ('', 'current', None, 'display the current topic only'),
+@command(b'topics', [
+        (b'', b'clear', False, b'clear active topic if any'),
+        (b'r', b'rev', [], b'revset of existing revisions', _(b'REV')),
+        (b'l', b'list', False, b'show the stack of changeset in the topic'),
+        (b'', b'age', False, b'show when you last touched the topics'),
+        (b'', b'current', None, b'display the current topic only'),
     ] + commands.formatteropts,
-    _('hg topics [TOPIC]'))
+    _(b'hg topics [TOPIC]'))
 def topics(ui, repo, topic=None, **opts):
     """View current topic, set current topic, change topic for a set of revisions, or see all topics.