~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/compiled/dirstate_helpers.pyx

  • Committer: John Arbash Meinel
  • Date: 2007-05-04 22:06:21 UTC
  • mto: This revision was merged to the branch mainline in revision 2643.
  • Revision ID: john@arbash-meinel.com-20070504220621-iwla6gmrtx7iy37s
Skip past the first entry while reading,
rather than while processing.

Show diffs side-by-side

added added

removed removed

Lines of Context:
249
249
 
250
250
 
251
251
cdef void _parse_dirblocks_0_parents(object state, object fields,
252
 
                                     int entry_size, int pos):
 
252
                                     int entry_size):
253
253
    cdef object current_block
254
254
    cdef object entry
255
255
    cdef void * current_dirname
256
256
    cdef int new_block
257
257
    cdef int field_count
 
258
    cdef int pos
258
259
 
259
260
    if not PyList_CheckExact(fields):
260
261
        raise TypeError('fields must be a list')
261
262
 
 
263
    pos = 0
262
264
    field_count = len(fields)
263
265
 
264
266
    state._dirblocks = [('', []), ('', [])]
315
317
 
316
318
    def get_all_fields(self):
317
319
        """Get a list of all fields"""
 
320
        cdef char *first
 
321
        # The first field should be an empty string left over from the Header
 
322
        first = self.get_next()
 
323
        if first[0] != c'\0':
 
324
            raise AssertionError('First character should be null not: %s'
 
325
                                 % (first,))
318
326
        fields = []
319
327
        while not self.done():
320
328
            PyList_Append(fields, self.get_next_str())
352
360
    fields = reader.get_all_fields()
353
361
 
354
362
    # skip the first field which is the trailing null from the header.
355
 
    cur = 1
 
363
    cur = 0
356
364
 
357
365
    # Each line now has an extra '\n' field which is not used
358
366
    # so we just skip over it
374
382
    if num_present_parents == 0:
375
383
        # Move the iterator to the current position
376
384
        #fields = reader.get_all_fields()
377
 
        _parse_dirblocks_0_parents(state, fields, entry_size, 1)
 
385
        _parse_dirblocks_0_parents(state, fields, entry_size)
378
386
        state._dirblock_state = DirState.IN_MEMORY_UNMODIFIED
379
387
        return
380
388
    if num_present_parents == 1: