[PATCH 7 of 8 phases] phases: mechanism to allow extension to alter initial computation of phase

Matt Mackall mpm at selenic.com
Tue Jan 17 22:47:37 CST 2012


On Wed, 2012-01-18 at 01:04 +0100, Pierre-Yves David wrote:
> >> +        for wnd in repo._whennophasedata:
> >> +            roots = wnd(repo, roots)
> >> +            assert roots is not None, '%r forgot to return a value' % wnd
> > 
> > asserts are discouraged. With or without, we get a traceback in the
> > field, so why bother?
> 
> We get a traceback sooner with a better message

It's still a traceback. As far as users in the field are concerned, all
tracebacks are equal (even if they're not entirely error-blind). If we
stuck asserts in wherever someone could abuse the API, the code would
be about 50% larger. This API is not special: no assert.

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list