198
198
source_branch = _mod_branch.Branch.open(self.source_branch)
199
199
target_repo.fetch(source_branch.repository, self.revision_id)
200
if self.patch is not None:
201
self._verify_patch(target_repo)
202
200
return self.revision_id
487
482
# Strip trailing whitespace
488
483
calculated_patch = re.sub(' *\n', '\n', calculated_patch)
489
484
stored_patch = re.sub(' *\n', '\n', stored_patch)
490
if calculated_patch != stored_patch:
485
return (calculated_patch == stored_patch)
487
def install_revisions_base(self, repository):
488
self.install_revisions(repository)
489
return self.base_revision_id, self.revision_id, 'verified'
491
def install_revisions(self, repository):
492
_BaseMergeDirective.install_revisions(self, repository)
493
verified = self._maybe_verify(repository)
494
if verified == 'failed':
491
495
raise errors.PatchVerificationFailed()
497
def _maybe_verify(self, repository):
498
if self.patch is not None:
499
if self._verify_patch(repository):
504
return 'inapplicable'
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
494
512
class MergeDirectiveFormatRegistry(registry.Registry):