~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/inventory.py

- more error conversion

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
import types
32
32
 
33
33
import bzrlib
34
 
from bzrlib.errors import BzrError, BzrCheckError
35
 
 
36
34
from bzrlib.osutils import (pumpfile, quotefn, splitpath, joinpath,
37
35
                            appendpath, sha_strings)
38
36
from bzrlib.trace import mutter
39
 
from bzrlib.errors import NotVersionedError
 
37
from bzrlib.errors import (NotVersionedError, InvalidEntryName,
 
38
                           BzrError, BzrCheckError)
40
39
 
41
40
 
42
41
class InventoryEntry(object):
229
228
        '123'
230
229
        >>> e = InventoryFile('123', 'src/hello.c', ROOT_ID)
231
230
        Traceback (most recent call last):
232
 
        BzrCheckError: InventoryEntry name 'src/hello.c' is invalid
 
231
        InvalidEntryName: Invalid entry name: src/hello.c
233
232
        """
234
233
        assert isinstance(name, basestring), name
235
234
        if '/' in name or '\\' in name:
236
 
            raise BzrCheckError('InventoryEntry name %r is invalid' % name)
237
 
        
 
235
            raise InvalidEntryName(name=name)
238
236
        self.executable = False
239
237
        self.revision = None
240
238
        self.text_sha1 = None