~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/inventory.py

  • Committer: Robert Collins
  • Date: 2005-11-08 00:55:48 UTC
  • mfrom: (1185.16.154)
  • Revision ID: robertc@robertcollins.net-20051108005548-417f470e4b50a467
MergeĀ fromĀ Martin.

Show diffs side-by-side

added added

removed removed

Lines of Context:
79
79
    InventoryDirectory('123', 'src', parent_id='TREE_ROOT')
80
80
    >>> i.add(InventoryFile('2323', 'hello.c', parent_id='123'))
81
81
    InventoryFile('2323', 'hello.c', parent_id='123')
82
 
    >>> for j in i.iter_entries():
83
 
    ...   print j
 
82
    >>> shouldbe = {0: 'src', 1: os.path.join('src','hello.c')}
 
83
    >>> for ix, j in enumerate(i.iter_entries()):
 
84
    ...   print (j[0] == shouldbe[ix], j[1])
84
85
    ... 
85
 
    ('src', InventoryDirectory('123', 'src', parent_id='TREE_ROOT'))
86
 
    ('src/hello.c', InventoryFile('2323', 'hello.c', parent_id='123'))
 
86
    (True, InventoryDirectory('123', 'src', parent_id='TREE_ROOT'))
 
87
    (True, InventoryFile('2323', 'hello.c', parent_id='123'))
87
88
    >>> i.add(InventoryFile('2323', 'bye.c', '123'))
88
89
    Traceback (most recent call last):
89
90
    ...