/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/inventory.py

  • Committer: John Arbash Meinel
  • Date: 2006-12-01 19:41:16 UTC
  • mfrom: (2158 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2159.
  • Revision ID: john@arbash-meinel.com-20061201194116-nvn5qhfxux5284jc
[merge] bzr.dev 2158

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
import bzrlib
40
40
from bzrlib import (
41
41
    errors,
 
42
    generate_ids,
42
43
    osutils,
43
44
    symbol_versioning,
44
45
    workingtree,
1037
1038
        try:
1038
1039
            return self._byid[file_id]
1039
1040
        except KeyError:
1040
 
            if file_id is None:
1041
 
                raise BzrError("can't look up file_id None")
1042
 
            else:
1043
 
                raise BzrError("file_id {%s} not in inventory" % file_id)
 
1041
            # really we're passing an inventory, not a tree...
 
1042
            raise errors.NoSuchId(self, file_id)
1044
1043
 
1045
1044
    def get_file_kind(self, file_id):
1046
1045
        return self._byid[file_id].kind
1087
1086
 
1088
1087
        if len(parts) == 0:
1089
1088
            if file_id is None:
1090
 
                file_id = workingtree.gen_root_id()
 
1089
                file_id = generate_ids.gen_root_id()
1091
1090
            self.root = InventoryDirectory(file_id, '', None)
1092
1091
            self._byid = {self.root.file_id: self.root}
1093
1092
            return
1205
1204
            return None
1206
1205
        for f in name:
1207
1206
            try:
1208
 
                cie = parent.children[f]
 
1207
                children = getattr(parent, 'children', None)
 
1208
                if children is None:
 
1209
                    return None
 
1210
                cie = children[f]
1209
1211
                assert cie.name == f
1210
1212
                assert cie.parent_id == parent.file_id
1211
1213
                parent = cie
1281
1283
    :param file_id: the file_id to use. if None, one will be created.
1282
1284
    """
1283
1285
    if file_id is None:
1284
 
        file_id = workingtree.gen_file_id(name)
 
1286
        file_id = generate_ids.gen_file_id(name)
1285
1287
 
1286
1288
    norm_name, can_access = osutils.normalized_filename(name)
1287
1289
    if norm_name != name: