On Fri, Jul 20, 2012 at 11:12:46AM +0100, Richard Maw wrote:
On Thu, Jul 19, 2012 at 01:54:38PM +0100, Lars Wirzenius wrote:
> @@ -106,3 +98,42 @@ class MorphologyFactory(object):
> + def _check_and_tweak_chunk(self, morphology, reponame, sha1, filename):
> + '''Check and tweak a chunk morphology.'''
> +
> + if 'chunks' in morphology and len(morphology['chunks'])
> 1:
What if someone listed a chunk with a different name to the morphology?
It would be a weird thing to do, but as it is that would silently be
ignored and the artifact would be called the name of the chunk.
Good catch. Fixed.
I would prefer an exception if I had somehow made a chunk morphology
that had no chunk artifacts listed, to it silently defaulting to putting
everything in one artifact.
That would be a change to what we're currently doing, so I'm not going
to do that right now. I'm not sure I want to force everyone to write a
boilerplate chunks listing for the simple cases (where everything is in
the same chunk artifact, which is named the as the source chunk). But we
can discuss that separately some day.
Since I've made minimal changes, and Richard isn't available right now
for further review, and I need this for other work to happen, I'll go
ahead and push.
--
http://www.codethink.co.uk/