~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/inventory.py

  • Committer: Aaron Bentley
  • Date: 2006-08-06 21:21:32 UTC
  • mto: (1731.1.35 nested-trees)
  • mto: This revision was merged to the branch mainline in revision 1910.
  • Revision ID: aaron.bentley@utoronto.ca-20060806212132-56b40ec5caf87658
Restore RootEntry, but mark it deprecated, restore EmptyTree.kind

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
import sys
35
35
import tarfile
36
36
import types
 
37
from warnings import warn
37
38
 
38
39
import bzrlib
39
40
from bzrlib import errors, osutils
497
498
        pass
498
499
 
499
500
 
 
501
class RootEntry(InventoryEntry):
 
502
 
 
503
    __slots__ = ['text_sha1', 'text_size', 'file_id', 'name', 'kind',
 
504
                 'text_id', 'parent_id', 'children', 'executable', 
 
505
                 'revision', 'symlink_target']
 
506
 
 
507
    def _check(self, checker, rev_id, tree):
 
508
        """See InventoryEntry._check"""
 
509
 
 
510
    def __init__(self, file_id):
 
511
        self.file_id = file_id
 
512
        self.children = {}
 
513
        self.kind = 'directory'
 
514
        self.parent_id = None
 
515
        self.name = u''
 
516
        self.revision = None
 
517
        warn('EmptyTree is deprecated as of bzr 0.9 please use '
 
518
            'repository.revision_tree instead.',
 
519
            DeprecationWarning, stacklevel=2)
 
520
 
 
521
    def __eq__(self, other):
 
522
        if not isinstance(other, RootEntry):
 
523
            return NotImplemented
 
524
        
 
525
        return (self.file_id == other.file_id) \
 
526
               and (self.children == other.children)
 
527
 
 
528
 
500
529
class InventoryDirectory(InventoryEntry):
501
530
    """A directory in an inventory."""
502
531