Patchwork [1,of,2] logcmdutil: let getlinerangerevs() return "revs" as a smartset

login
register
mail settings
Submitter Denis Laxalde
Date Nov. 14, 2019, 10:42 a.m.
Message ID <3386a6737e04d6a8cf47.1573728160@steppe.local>
Download mbox | patch
Permalink /patch/43185/
State Accepted
Headers show

Comments

Denis Laxalde - Nov. 14, 2019, 10:42 a.m.
# HG changeset patch
# User Denis Laxalde <denis.laxalde@logilab.fr>
# Date 1573726298 -3600
#      Thu Nov 14 11:11:38 2019 +0100
# Node ID 3386a6737e04d6a8cf4787f8a76765dcea5857de
# Parent  ec53ea01c9e6c64ff1e4ffc5ce5b8623c5dae9da
logcmdutil: let getlinerangerevs() return "revs" as a smartset

This makes it consistent in "hg log" command where 'revs' can come from
logcmdutil.getrevs() as a smartset or from getlinerangerevs(),
previously as a list. This will help type hinting as noticed in
https://phab.mercurial-scm.org/D7377.
Yuya Nishihara - Nov. 14, 2019, 12:48 p.m.
On Thu, 14 Nov 2019 11:42:40 +0100, Denis Laxalde wrote:
> # HG changeset patch
> # User Denis Laxalde <denis.laxalde@logilab.fr>
> # Date 1573726298 -3600
> #      Thu Nov 14 11:11:38 2019 +0100
> # Node ID 3386a6737e04d6a8cf4787f8a76765dcea5857de
> # Parent  ec53ea01c9e6c64ff1e4ffc5ce5b8623c5dae9da
> logcmdutil: let getlinerangerevs() return "revs" as a smartset

Queued, thanks.

Patch

diff --git a/mercurial/logcmdutil.py b/mercurial/logcmdutil.py
--- a/mercurial/logcmdutil.py
+++ b/mercurial/logcmdutil.py
@@ -968,7 +968,7 @@  def getlinerangerevs(repo, userrevs, opt
     differ = changesetdiffer()
     differ._makefilematcher = filematcher
     differ._makehunksfilter = hunksfilter
-    return revs, differ
+    return smartset.baseset(revs), differ
 
 
 def _graphnodeformatter(ui, displayer):