~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/merge_directive.py

(Martin <gz>) Use get_bytes() to ensure that read bundles get closed
        properly.

Show diffs side-by-side

added added

removed removed

Lines of Context:
371
371
        :return: a MergeRequest
372
372
        """
373
373
        line_iter = iter(lines)
 
374
        firstline = ""
374
375
        for line in line_iter:
375
376
            if line.startswith('# Bazaar merge directive format '):
376
 
                break
377
 
        else:
378
 
            if len(lines) > 0:
379
 
                raise errors.NotAMergeDirective(lines[0])
380
 
            else:
381
 
                raise errors.NotAMergeDirective('')
382
 
        return _format_registry.get(line[2:].rstrip())._from_lines(line_iter)
 
377
                return _format_registry.get(line[2:].rstrip())._from_lines(
 
378
                    line_iter)
 
379
            firstline = firstline or line.strip()
 
380
        raise errors.NotAMergeDirective(firstline)
383
381
 
384
382
    @classmethod
385
383
    def _from_lines(klass, line_iter):