diff hgext/children.py @ 37357:7c8524efd847

children: support specifying revision by revset Same reason as the previous patch. Differential Revision: https://phab.mercurial-scm.org/D3085
author Martin von Zweigbergk <martinvonz@google.com>
date Thu, 05 Apr 2018 14:21:37 +0530
parents 923362010525
children c303d65d2e34
line wrap: on
line diff
--- a/hgext/children.py	Wed Apr 04 15:08:26 2018 -0700
+++ b/hgext/children.py	Thu Apr 05 14:21:37 2018 +0530
@@ -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)