~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/inventory.py

  • Committer: Martin Pool
  • Date: 2005-09-22 12:12:53 UTC
  • Revision ID: mbp@sourcefrog.net-20050922121253-eae2a3240ea5e493
- upgrade can no longer be done in current version branches
  so don't test it

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
ROOT_ID = "TREE_ROOT"
29
29
 
30
30
 
31
 
import os.path
32
 
import re
33
 
import sys
34
 
import types
 
31
import sys, os.path, types, re
35
32
 
36
33
import bzrlib
37
34
from bzrlib.errors import BzrError, BzrCheckError
38
35
 
39
 
from bzrlib.osutils import quotefn, splitpath, joinpath, appendpath
 
36
from bzrlib.osutils import uuid, quotefn, splitpath, joinpath, appendpath
40
37
from bzrlib.trace import mutter
41
38
from bzrlib.errors import NotVersionedError
42
 
 
 
39
        
43
40
 
44
41
class InventoryEntry(object):
45
42
    """Description of a versioned file.
101
98
    InventoryEntry('2326', 'wibble.c', kind='file', parent_id='2325')
102
99
    >>> i['2326']
103
100
    InventoryEntry('2326', 'wibble.c', kind='file', parent_id='2325')
104
 
    >>> for path, entry in i.iter_entries():
105
 
    ...     print path.replace('\\\\', '/')     # for win32 os.sep
106
 
    ...     assert i.path2id(path)
 
101
    >>> for j in i.iter_entries():
 
102
    ...     print j[0]
 
103
    ...     assert i.path2id(j[0])
107
104
    ... 
108
105
    src
109
106
    src/bye.c
110
107
    src/hello.c
111
108
    src/wibble
112
109
    src/wibble/wibble.c
113
 
    >>> i.id2path('2326').replace('\\\\', '/')
 
110
    >>> i.id2path('2326')
114
111
    'src/wibble/wibble.c'
115
112
    """
116
113
    
272
269
        The inventory is created with a default root directory, with
273
270
        an id of None.
274
271
        """
275
 
        # We are letting Branch.initialize() create a unique inventory
 
272
        # We are letting Branch(init=True) create a unique inventory
276
273
        # root id. Rather than generating a random one here.
277
274
        #if root_id is None:
278
275
        #    root_id = bzrlib.branch.gen_file_id('TREE_ROOT')