[PATCH] revset: get rid of redundant error checking from match()

Gregory Szorc gregory.szorc at gmail.com
Sun Jun 26 10:42:05 EDT 2016


On Sun, Jun 26, 2016 at 1:37 AM, Yuya Nishihara <yuya at tcha.org> wrote:

> # HG changeset patch
> # User Yuya Nishihara <yuya at tcha.org>
> # Date 1466929017 -32400
> #      Sun Jun 26 17:16:57 2016 +0900
> # Node ID 540243aaab2dcc4e1e78de0936454462945c27e7
> # Parent  25737d5695e2da9631e37ae304beabeb010ccf8f
> revset: get rid of redundant error checking from match()
>
> Actually there was no additional error checking. It should be caught by
> "not all(specs)".
>
>
This looks good. I had mixed the wires for the "if not specs" branch which
is a special case for returning an empty set.


> diff --git a/mercurial/revset.py b/mercurial/revset.py
> --- a/mercurial/revset.py
> +++ b/mercurial/revset.py
> @@ -2529,8 +2529,6 @@ def posttreebuilthook(tree, repo):
>
>  def match(ui, spec, repo=None):
>      """Create a matcher for a single revision spec."""
> -    if not spec:
> -        raise error.ParseError(_("empty query"))
>      return matchany(ui, [spec], repo=repo)
>
>  def matchany(ui, specs, repo=None):
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mercurial-scm.org/pipermail/mercurial-devel/attachments/20160626/b95f1119/attachment.html>


More information about the Mercurial-devel mailing list