D2002: remotenames: add three new revsets related to remotenames

yuja (Yuya Nishihara) phabricator at mercurial-scm.org
Fri Feb 2 08:03:43 EST 2018


yuja requested changes to this revision.
yuja added a comment.
This revision now requires changes to proceed.


  These functions look quite similar. Perhaps we can extract a helper function
  `f(repo, subset, x, rtypes)`.

INLINE COMMENTS

> remotenames.py:35
>      registrar,
> +    revset,
> +    smartset,

Minor nit: use `revsetlang` instead.

> remotenames.py:263
> +
> + at revsetpredicate('remotenames')
> +def remotenamesrevset(repo, subset, x):

Perhaps this should be:

  @revsetpredicate('remotenames()')
  def remotenamesrevset...
      """All changesets ...

> remotenames.py:268
> +    """
> +    revset.getargs(x, 0, 0, "remotenames takes no arguments")
> +    remoterevs = set()

Nit: `_("remotenames takes no arguments")`.

> remotenames.py:277
> +
> +    results = (cl.rev(n) for n in remoterevs if n in repo)
> +    return subset & smartset.baseset(sorted(results))

`cl.hasnode(n)` instead of `n in repo`, which creates a changectx
object?

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D2002

To: pulkit, #hg-reviewers, yuja
Cc: yuja, mercurial-devel


More information about the Mercurial-devel mailing list