[PATCH 3 of 8] namespaces: add convenience method called multify
Martin von Zweigbergk
martinvonz at google.com
Sun Dec 14 23:52:48 CST 2014
I find a patch that just adds dead code quite puzzling. The first thing I
do when I see a patch like this is to open the next patch in the series and
search for the name there. In this case it seems like it gets used in 6/8.
I would definitely prefer it squashed into that patch so I could evaluate
its usefulness more easily. If other reviewers do the same thing (look
ahead for the call site), it seems clearly better to squash it, but I'm
also curious what other reviewers think.
On Sun Dec 14 2014 at 4:38:40 PM Sean Farley <sean.michael.farley at gmail.com>
wrote:
> # HG changeset patch
> # User Sean Farley <sean.michael.farley at gmail.com>
> # Date 1418598280 28800
> # Sun Dec 14 15:04:40 2014 -0800
> # Node ID 519aa5b4f74d5604b2d3d34c4e75b99d698b01b5
> # Parent 98bc28635ee1999c778e5c98f55423147d316a9e
> namespaces: add convenience method called multify
>
> diff --git a/mercurial/namespaces.py b/mercurial/namespaces.py
> --- a/mercurial/namespaces.py
> +++ b/mercurial/namespaces.py
> @@ -1,7 +1,16 @@
> from mercurial import util
>
> +def multify(val):
> + """
> + a convenience method to return an empty list instead of None
> + """
> + if val is None:
> + return []
> + else:
> + return [val]
> +
> class namespaces(object):
> """
> provides an interface to register a generic many-to-many mapping
> between
> some (namespaced) names and nodes. The goal here is to control the
> pollution of jamming things into tags or bookmarks (in
> extension-land) and
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20141215/b7849c89/attachment.html>
More information about the Mercurial-devel
mailing list