[MERGE] Shelf 3 / 5: Unshelver and metadata

John Arbash Meinel john at arbash-meinel.com
Tue Oct 21 17:13:07 BST 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Aaron Bentley wrote:
> 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.
> 

For what purpose? So that this patch couldn't be merged as is?


>> 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.

I feel like giving the user a UI of:

$ bzr unshelve
ERROR: file .bzr/checkout/shelf/01 is corrupted

is better than a 10-page traceback with something that *might* mention
the file is corrupted.

It doesn't have to happen in this round, but IMO assert/AssertionError
should only be used to help developers who get an API wrong, not to
validate any data that comes from the 'real world'.


>> 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
> 

I don't believe I have made specific use of it, except for when I've
changed the WT and 'bzr unshelve' no longer works. Since you are using
3-way merging now, that doesn't quite apply.

That said, Robert says he *does* use it, so we might want to consider
having a way to handle it.

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkj9/5MACgkQJdeBCYSNAAO6uACgvSnzRrcVC4HwAgqSrbExPmgj
ZrIAnA3qiyycYMOyVUt6yucrW09YJLzX
=Cze4
-----END PGP SIGNATURE-----



More information about the bazaar mailing list