Patchwork phabricator: remove *-argument from _getdrevs()

login
register
mail settings
Submitter Yuya Nishihara
Date March 21, 2020, 5:26 a.m.
Message ID <c1c2f6e0cd9f819389c1.1584768397@mimosa>
Download mbox | patch
Permalink /patch/45857/
State Accepted
Headers show

Comments

Yuya Nishihara - March 21, 2020, 5:26 a.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1584766870 -32400
#      Sat Mar 21 14:01:10 2020 +0900
# Node ID c1c2f6e0cd9f819389c18245d791c906023d9545
# Parent  a7f8c657a3f08d1e71ee112f797df011eea7a078
phabricator: remove *-argument from _getdrevs()

It can't take more than one specs arguments per len(*specs).
Augie Fackler - March 23, 2020, 3:50 p.m.
queued, thanks

> On Mar 21, 2020, at 01:26, Yuya Nishihara <yuya@tcha.org> wrote:
> 
> # HG changeset patch
> # User Yuya Nishihara <yuya@tcha.org>
> # Date 1584766870 -32400
> #      Sat Mar 21 14:01:10 2020 +0900
> # Node ID c1c2f6e0cd9f819389c18245d791c906023d9545
> # Parent  a7f8c657a3f08d1e71ee112f797df011eea7a078
> phabricator: remove *-argument from _getdrevs()
> 
> It can't take more than one specs arguments per len(*specs).
> 
> diff --git a/hgext/phabricator.py b/hgext/phabricator.py
> --- a/hgext/phabricator.py
> +++ b/hgext/phabricator.py
> @@ -1632,19 +1632,19 @@ def getdiffmeta(diff):
>     return meta
> 
> 
> -def _getdrevs(ui, stack, *specs):
> +def _getdrevs(ui, stack, specs):
>     """convert user supplied DREVSPECs into "Differential Revision" dicts
> 
>     See ``hg help phabread`` for how to specify each DREVSPEC.
>     """
> -    if len(*specs) > 0:
> +    if len(specs) > 0:
> 
>         def _formatspec(s):
>             if stack:
>                 s = b':(%s)' % s
>             return b'(%s)' % s
> 
> -        spec = b'+'.join(pycompat.maplist(_formatspec, *specs))
> +        spec = b'+'.join(pycompat.maplist(_formatspec, specs))
> 
>         drevs = querydrev(ui, spec)
>         if drevs:
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Patch

diff --git a/hgext/phabricator.py b/hgext/phabricator.py
--- a/hgext/phabricator.py
+++ b/hgext/phabricator.py
@@ -1632,19 +1632,19 @@  def getdiffmeta(diff):
     return meta
 
 
-def _getdrevs(ui, stack, *specs):
+def _getdrevs(ui, stack, specs):
     """convert user supplied DREVSPECs into "Differential Revision" dicts
 
     See ``hg help phabread`` for how to specify each DREVSPEC.
     """
-    if len(*specs) > 0:
+    if len(specs) > 0:
 
         def _formatspec(s):
             if stack:
                 s = b':(%s)' % s
             return b'(%s)' % s
 
-        spec = b'+'.join(pycompat.maplist(_formatspec, *specs))
+        spec = b'+'.join(pycompat.maplist(_formatspec, specs))
 
         drevs = querydrev(ui, spec)
         if drevs: