[PATCH 2 of 2] localrepo: comment that revs() is internal only

Matt Mackall mpm at selenic.com
Sun Dec 20 16:56:00 CST 2015


On Sun, 2015-12-20 at 10:32 -0800, Gregory Szorc wrote:
> # HG changeset patch
> # User Gregory Szorc <gregory.szorc at gmail.com>
> # Date 1450636340 28800
> #      Sun Dec 20 10:32:20 2015 -0800
> # Node ID 85666a6ed6c8403a50f1c851701aa2d2a3c79c6f
> # Parent  fd6eb3903a016edc748053a5aa42c74cefa6a7fb
> localrepo: comment that revs() is internal only
> 
> I didn't realize repo.revs() was only appropriate for internal use.
> Add a comment to help prevent others from falling into this pit.

> +        Note: this should only be used on internal-facing revsets. If
> +        operating on revsets provided by users, use ``revset.match()``
> +        directly to avoid revset expression formatting and so revset
> +        aliases work.

Generally, the layer of stuff that's prepared to deal with user
nonsense is cmdutil or scmutil. The usual pattern here is
scmutil.revrange/pair/single.

Tweaked in flight.

-- 
Mathematics is the supreme nostalgia of our time.



More information about the Mercurial-devel mailing list