~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/merge_directive.py

  • Committer: Aaron Bentley
  • Date: 2007-06-28 14:14:16 UTC
  • mto: (2520.5.2 bzr.mpbundle)
  • mto: This revision was merged to the branch mainline in revision 2631.
  • Revision ID: abentley@panoramicfeedback.com-20070628141416-lf6u1noi6gk5lf1g
start work on directive cherry-picking

Show diffs side-by-side

added added

removed removed

Lines of Context:
318
318
                                       ancestor_id, s, '0.9')
319
319
        return s.getvalue()
320
320
 
 
321
    def get_merge_request(self, repository):
 
322
        """Provide data for performing a merge
 
323
 
 
324
        Returns suggested base, suggested target, and patch verification status
 
325
        """
 
326
        return None, self.revision_id, 'inapplicable'
 
327
 
321
328
 
322
329
class MergeDirective2(_BaseMergeDirective):
323
330
 
484
491
        stored_patch = re.sub(' *\n', '\n', stored_patch)
485
492
        return (calculated_patch == stored_patch)
486
493
 
487
 
    def install_revisions_base(self, repository):
488
 
        self.install_revisions(repository)
489
 
        return self.base_revision_id, self.revision_id, 'verified'
 
494
    def get_merge_request(self, repository):
 
495
        """Provide data for performing a merge
490
496
 
491
 
    def install_revisions(self, repository):
492
 
        _BaseMergeDirective.install_revisions(self, repository)
 
497
        Returns suggested base, suggested target, and patch verification status
 
498
        """
493
499
        verified = self._maybe_verify(repository)
494
 
        if verified == 'failed':
495
 
            raise errors.PatchVerificationFailed()
 
500
        return self.base_revision_id, self.revision_id, verified
496
501
 
497
502
    def _maybe_verify(self, repository):
498
503
        if self.patch is not None:
503
508
        else:
504
509
            return 'inapplicable'
505
510
 
506
 
    def install_revisions_base(self, repository):
507
 
        _BaseMergeDirective.install_revisions(self, repository)
508
 
        verified = self._maybe_verify(repository)
509
 
        return None, self.revision_id, verified
510
 
 
511
511
 
512
512
class MergeDirectiveFormatRegistry(registry.Registry):
513
513