comparison hgext/children.py @ 43077:687b865b95ad

formatting: byteify all mercurial/ and hgext/ string literals Done with python3.7 contrib/byteify-strings.py -i $(hg files 'set:mercurial/**.py - mercurial/thirdparty/** + hgext/**.py - hgext/fsmonitor/pywatchman/** - mercurial/__init__.py') black -l 80 -t py33 -S $(hg files 'set:**.py - mercurial/thirdparty/** - "contrib/python-zstandard/**" - hgext/fsmonitor/pywatchman/**') # skip-blame mass-reformatting only Differential Revision: https://phab.mercurial-scm.org/D6972
author Augie Fackler <augie@google.com>
date Sun, 06 Oct 2019 09:48:39 -0400
parents 2372284d9457
children 5105a9975407
comparison
equal deleted inserted replaced
43076:2372284d9457 43077:687b865b95ad
31 command = registrar.command(cmdtable) 31 command = registrar.command(cmdtable)
32 # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for 32 # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for
33 # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should 33 # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should
34 # be specifying the version(s) of Mercurial they are tested with, or 34 # be specifying the version(s) of Mercurial they are tested with, or
35 # leave the attribute unspecified. 35 # leave the attribute unspecified.
36 testedwith = 'ships-with-hg-core' 36 testedwith = b'ships-with-hg-core'
37 37
38 38
39 @command( 39 @command(
40 'children', 40 b'children',
41 [('r', 'rev', '.', _('show children of the specified revision'), _('REV')),] 41 [
42 (
43 b'r',
44 b'rev',
45 b'.',
46 _(b'show children of the specified revision'),
47 _(b'REV'),
48 ),
49 ]
42 + templateopts, 50 + templateopts,
43 _('hg children [-r REV] [FILE]'), 51 _(b'hg children [-r REV] [FILE]'),
44 helpcategory=command.CATEGORY_CHANGE_NAVIGATION, 52 helpcategory=command.CATEGORY_CHANGE_NAVIGATION,
45 inferrepo=True, 53 inferrepo=True,
46 ) 54 )
47 def children(ui, repo, file_=None, **opts): 55 def children(ui, repo, file_=None, **opts):
48 """show the children of the given or working directory revision 56 """show the children of the given or working directory revision
60 68
61 See :hg:`help log` and :hg:`help revsets.children`. 69 See :hg:`help log` and :hg:`help revsets.children`.
62 70
63 """ 71 """
64 opts = pycompat.byteskwargs(opts) 72 opts = pycompat.byteskwargs(opts)
65 rev = opts.get('rev') 73 rev = opts.get(b'rev')
66 ctx = scmutil.revsingle(repo, rev) 74 ctx = scmutil.revsingle(repo, rev)
67 if file_: 75 if file_:
68 fctx = repo.filectx(file_, changeid=ctx.rev()) 76 fctx = repo.filectx(file_, changeid=ctx.rev())
69 childctxs = [fcctx.changectx() for fcctx in fctx.children()] 77 childctxs = [fcctx.changectx() for fcctx in fctx.children()]
70 else: 78 else: