~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to read_changeset.py

  • Committer: John Arbash Meinel
  • Date: 2005-10-20 06:43:11 UTC
  • mto: (1185.82.1 bzr-w-changeset)
  • mto: This revision was merged to the branch mainline in revision 1738.
  • Revision ID: john@arbash-meinel.com-20051020064311-b7c3c4cebe4bb0cb
Fixed a bug based on the new InventoryEntry separation.

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
from bzrlib.xml5 import serializer_v5
14
14
from bzrlib.osutils import sha_file, sha_string
15
15
from bzrlib.revision import Revision
16
 
from bzrlib.inventory import Inventory, InventoryEntry
 
16
from bzrlib.inventory import (Inventory, InventoryEntry,
 
17
                              InventoryDirectory, InventoryFile,
 
18
                              InventoryLink)
17
19
 
18
20
from common import decode, get_header, header_str
19
21
 
852
854
            if path is None:
853
855
                return
854
856
            parent_path = dirname(path)
855
 
            if parent_path == '':
 
857
            if parent_path == u'':
856
858
                parent_id = root_id
857
859
            else:
858
860
                parent_id = self.path2id(parent_path)
861
863
            revision_id = self.get_last_changed(file_id)
862
864
 
863
865
            name = basename(path)
864
 
            ie = InventoryEntry(file_id, name, kind, parent_id)
 
866
            if kind == 'directory':
 
867
                ie = InventoryDirectory(file_id, name, parent_id)
 
868
            elif kind == 'file':
 
869
                ie = InventoryFile(file_id, name, parent_id)
 
870
            elif kind == 'symlink':
 
871
                ie = InventoryLink(file_id, name, parent_id)
865
872
            ie.revision = revision_id
866
873
 
867
874
            if kind == 'directory':