[MERGE] Shelf 3 / 5: Unshelver and metadata

Aaron Bentley aaron at aaronbentley.com
Tue Oct 21 01:44:54 BST 2008


John Arbash Meinel wrote:
> Aaron Bentley wrote:
> +        assert names[0] == ('metadata',)
> 
> You may want to run:
> 
> bzr selftest -s bt.test_source
> 
> As it will catch any 'assert' entries left in the code.

I left it in deliberately.

> Since this is validating something on disk, it feels like we want
> something stronger than "AssertionError". If it is wrong, we have a
> corrupted/unreadable file, not just a programmer error.

I don't think this case is likely enough to handle gracefully.  I would
rather just remove the assert, then, and let it die when the contents of
the record are garbage.

> It seems like we want an error better than a Assert traceback shown to
> the user, as well.
> 
> BB:tweak
> 
> Is your idea that alternate unshelvers would subclass and then override
> make_merger()?

No, I wasn't expecting alternate unshelvers.  But if there were any, I
guess they'd use make_merger to generate a PreviewTree.

> I know that the shelf plugin allowed you to edit the hunks both going to
> the shelf and coming back. Are you thinking to keep that or just going
> one way?

Just one way.  I've never found that functionality useful.  In fact, I
have unshelve aliased to unshelve --all.

Aaron



More information about the bazaar mailing list