~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/merge_directive.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-11-17 03:20:35 UTC
  • mfrom: (4792.4.3 456036)
  • Revision ID: pqm@pqm.ubuntu.com-20091117032035-s3sgtlixj1lrminn
(Gordon Tyler) Fix IndexError during 'bzr ignore /' (#456036)

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 = ""
375
374
        for line in line_iter:
376
375
            if line.startswith('# Bazaar merge directive format '):
377
 
                return _format_registry.get(line[2:].rstrip())._from_lines(
378
 
                    line_iter)
379
 
            firstline = firstline or line.strip()
380
 
        raise errors.NotAMergeDirective(firstline)
 
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)
381
383
 
382
384
    @classmethod
383
385
    def _from_lines(klass, line_iter):