~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/inventory.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-04-06 10:41:03 UTC
  • mfrom: (1638.1.2 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20060406104103-849a925941c89106
Change the basis-inventory file to not have the revision-id in the file name.

Show diffs side-by-side

added added

removed removed

Lines of Context:
779
779
    >>> inv.add(InventoryFile('123-123', 'hello.c', ROOT_ID))
780
780
    InventoryFile('123-123', 'hello.c', parent_id='TREE_ROOT-12345678-12345678')
781
781
    """
782
 
    def __init__(self, root_id=ROOT_ID):
 
782
    def __init__(self, root_id=ROOT_ID, revision_id=None):
783
783
        """Create or read an inventory.
784
784
 
785
785
        If a working directory is specified, the inventory is read
794
794
        #if root_id is None:
795
795
        #    root_id = bzrlib.branch.gen_file_id('TREE_ROOT')
796
796
        self.root = RootEntry(root_id)
 
797
        self.revision_id = revision_id
797
798
        self._byid = {self.root.file_id: self.root}
798
799
 
799
800
 
800
801
    def copy(self):
 
802
        # TODO: jam 20051218 Should copy also copy the revision_id?
801
803
        other = Inventory(self.root.file_id)
802
804
        # copy recursively so we know directories will be added before
803
805
        # their children.  There are more efficient ways than this...