[MERGE] Knit Index should ignore empty files

John Arbash Meinel john at arbash-meinel.com
Thu Dec 21 16:03:21 GMT 2006


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

Martin Pool wrote:
> On 11 Dec 2006, Dmitry Vasiliev <lists at hlabs.spb.ru> wrote:
>> John Arbash Meinel wrote:
>>> The attached patch just changes the knit index code, so that if it sees
>>> an empty .kndx file, it just treats it as though it doesn't exist. Which
>>> lets bzr continue, rather than failing and making people feel like their
>>> data has been corrupted.
>>>
>>> If we decide not to accept the whole patch, I would at least like to ask
>>> that we accept the changes to the error class, so that when this error
>>> occurs, it is possible to investigate, and figure out what file needs to
>>> be changed rather than giving a semi-useless error.
>> +1 for the whole patch
>>
>>> Also, should KnitError be considered an 'InternalError' so it gives a
>>> traceback? It is sort of an environmental error, so I'm okay leaving it
>>> as a short-error. But it is serious enough that a traceback might be
>>> warranted.
>> I think KnitError should results to a traceback.
> 
> Seconded
> 

We seem to have good support for this, so I just submitted this patch:


=== modified file 'bzrlib/errors.py'
- --- bzrlib/errors.py    2006-12-07 23:18:34 +0000
+++ bzrlib/errors.py    2006-12-21 16:01:38 +0000
@@ -929,6 +929,8 @@

     _fmt = "Knit error"

+    internal_error = True
+

 class KnitHeaderError(KnitError):


I just submitted it as a trivial fix.

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

iD8DBQFFirBJJdeBCYSNAAMRAtIrAJ42bf9YeruG8uRfKhUctA4ptnmzTACgqE0R
mqffg3TU4MzTYjnDLCosMN8=
=lCS+
-----END PGP SIGNATURE-----




More information about the bazaar mailing list