~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/merge_directive.py

  • Committer: Sidnei da Silva
  • Date: 2009-05-29 14:19:29 UTC
  • mto: (4531.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 4532.
  • Revision ID: sidnei.da.silva@canonical.com-20090529141929-3heywbvj36po72a5
- Add initial config

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):
580
582
                    revision_id):
581
583
                    raise errors.PublicBranchOutOfDate(public_branch,
582
584
                                                       revision_id)
583
 
            testament_sha1 = t.as_sha1()
584
585
        finally:
585
586
            for entry in reversed(locked):
586
587
                entry.unlock()
587
 
        return klass(revision_id, testament_sha1, time, timezone,
588
 
            target_branch, patch, public_branch, message, bundle,
589
 
            base_revision_id)
 
588
        return klass(revision_id, t.as_sha1(), time, timezone, target_branch,
 
589
            patch, public_branch, message, bundle, base_revision_id)
590
590
 
591
591
    def _verify_patch(self, repository):
592
592
        calculated_patch = self._generate_diff(repository, self.revision_id,