/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/statcache.py

  • Committer: Martin Pool
  • Date: 2005-05-19 06:37:21 UTC
  • Revision ID: mbp@sourcefrog.net-20050519063721-555aeba2dc1f659d
- use builtin set object in python2.4 
  (suggested by Mario Pernici)
- clean up some uses of set() that can simply be lists or dicts
- remove some imports from the bzrlib namespace 

Show diffs side-by-side

added added

removed removed

Lines of Context:
136
136
        
137
137
        
138
138
def load_cache(basedir):
139
 
    from sets import Set
140
139
    import re
141
140
    cache = {}
142
 
    seen_paths = Set()
 
141
    seen_paths = {}
143
142
 
144
143
    sha_re = re.compile(r'[a-f0-9]{40}')
145
144
 
168
167
        path = a2b_qp(f[2]).decode('utf-8')
169
168
        if path in seen_paths:
170
169
            raise BzrCheckError("duplicated path in cache: %r" % path)
171
 
        seen_paths.add(path)
 
170
        seen_paths[path] = True
172
171
        
173
172
        entry = (file_id, text_sha, path) + tuple([long(x) for x in f[3:]])
174
173
        if len(entry) != 8:
218
217
 
219
218
    to_update -- Sequence of (file_id, path) pairs to check.
220
219
    """
221
 
 
222
 
    from sets import Set
223
 
 
224
220
    stat_cnt = missing_cnt = hardcheck = change_cnt = 0
225
221
 
226
 
    # files that have been recently touched and can't be
 
222
    # dangerfiles have been recently touched and can't be
227
223
    # committed to a persistent cache yet.
 
224
    dangerfiles = {}
228
225
    
229
 
    dangerfiles = Set()
230
226
    now = int(time.time())
231
227
 
232
228
    ## mutter('update statcache under %r' % basedir)
245
241
            continue
246
242
 
247
243
        if (fp[FP_MTIME] >= now) or (fp[FP_CTIME] >= now):
248
 
            dangerfiles.add(file_id)
 
244
            dangerfiles[file_id] = True
249
245
 
250
246
        if cacheentry and (cacheentry[3:] == fp):
251
247
            continue                    # all stat fields unchanged