Details
Details
- Reviewers
yuja - Group Reviewers
hg-reviewers - Commits
- rHG11a372d80496: py3: handle keyword arguments in hgext/children.py
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
yuja |
hg-reviewers |
Lint Skipped |
Unit Tests Skipped |
"children(REV)"` instead. | "children(REV)"` instead. | ||||
''' | ''' | ||||
from __future__ import absolute_import | from __future__ import absolute_import | ||||
from mercurial.i18n import _ | from mercurial.i18n import _ | ||||
from mercurial import ( | from mercurial import ( | ||||
cmdutil, | cmdutil, | ||||
pycompat, | |||||
registrar, | registrar, | ||||
) | ) | ||||
templateopts = cmdutil.templateopts | templateopts = cmdutil.templateopts | ||||
cmdtable = {} | cmdtable = {} | ||||
command = registrar.command(cmdtable) | command = registrar.command(cmdtable) | ||||
# Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for | # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for | ||||
Please use :hg:`log` instead:: | Please use :hg:`log` instead:: | ||||
hg children => hg log -r "children(.)" | hg children => hg log -r "children(.)" | ||||
hg children -r REV => hg log -r "children(REV)" | hg children -r REV => hg log -r "children(REV)" | ||||
See :hg:`help log` and :hg:`help revsets.children`. | See :hg:`help log` and :hg:`help revsets.children`. | ||||
""" | """ | ||||
opts = pycompat.byteskwargs(opts) | |||||
rev = opts.get('rev') | rev = opts.get('rev') | ||||
if file_: | if file_: | ||||
fctx = repo.filectx(file_, changeid=rev) | fctx = repo.filectx(file_, changeid=rev) | ||||
childctxs = [fcctx.changectx() for fcctx in fctx.children()] | childctxs = [fcctx.changectx() for fcctx in fctx.children()] | ||||
else: | else: | ||||
ctx = repo[rev] | ctx = repo[rev] | ||||
childctxs = ctx.children() | childctxs = ctx.children() | ||||
displayer = cmdutil.show_changeset(ui, repo, opts) | displayer = cmdutil.show_changeset(ui, repo, opts) | ||||
for cctx in childctxs: | for cctx in childctxs: | ||||
displayer.show(cctx) | displayer.show(cctx) | ||||
displayer.close() | displayer.close() |