diff --git a/hgext/children.py b/hgext/children.py --- a/hgext/children.py +++ b/hgext/children.py @@ -22,6 +22,7 @@ logcmdutil, pycompat, registrar, + scmutil, ) templateopts = cmdutil.templateopts @@ -59,11 +60,11 @@ """ opts = pycompat.byteskwargs(opts) rev = opts.get('rev') + ctx = scmutil.revsingle(repo, rev) if file_: - fctx = repo.filectx(file_, changeid=rev) + fctx = repo.filectx(file_, changeid=ctx.rev()) childctxs = [fcctx.changectx() for fcctx in fctx.children()] else: - ctx = repo[rev] childctxs = ctx.children() displayer = logcmdutil.changesetdisplayer(ui, repo, opts)