[PATCH] context.status: restrict reversed deleted/unknown/ignored fields even more

Matt Mackall mpm at selenic.com
Mon Nov 17 16:22:19 CST 2014


On Fri, 2014-11-14 at 15:00 -0800, Martin von Zweigbergk wrote:
> # HG changeset patch
> # User Martin von Zweigbergk <martinvonz at google.com>
> # Date 1416005592 28800
> #      Fri Nov 14 14:53:12 2014 -0800
> # Node ID c43495015e452cba1223fadf2958b4d1f00898fa
> # Parent  dd3f857598a0625305b106323544df425efeaf84
> context.status: restrict reversed deleted/unknown/ignored fields even more
> 
> In c10dc5568069 (context.status: wipe deleted/unknown/ignored fields
> when reversed, 2014-11-12), we set these fields to []. Let's take it
> one step further and set them to None so we prevent iteration over
> them and make any confused callers fail fast.

After reflection, I'm actually not keen on this.

If Mercurial were written in a strongly-typed language, this API would
probably not have "nullable" lists. To date, everything has worked under
the expectation that it could harmlessly iterate through these fields
and get no result if there were nothing deleted/ignored/unknown,
regardless of whether they made sense for a given context.

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list