##// END OF EJS Templates
settings: Add argument to select rebase as merge strategy.
Martin Bornhold -
r360:978630ac default
parent child Browse files
Show More
@@ -365,7 +365,8 b' class BaseRepository(object):'
365 raise NotImplementedError
365 raise NotImplementedError
366
366
367 def merge(self, target_ref, source_repo, source_ref, workspace_id,
367 def merge(self, target_ref, source_repo, source_ref, workspace_id,
368 user_name='', user_email='', message='', dry_run=False):
368 user_name='', user_email='', message='', dry_run=False,
369 use_rebase=False):
369 """
370 """
370 Merge the revisions specified in `source_ref` from `source_repo`
371 Merge the revisions specified in `source_ref` from `source_repo`
371 onto the `target_ref` of this repository.
372 onto the `target_ref` of this repository.
@@ -388,6 +389,8 b' class BaseRepository(object):'
388 :param user_email: Merge commit `user_email`.
389 :param user_email: Merge commit `user_email`.
389 :param message: Merge commit `message`.
390 :param message: Merge commit `message`.
390 :param dry_run: If `True` the merge will not take place.
391 :param dry_run: If `True` the merge will not take place.
392 :param use_rebase: If `True` commits from the source will be rebased
393 on top of the target instead of being merged.
391 """
394 """
392 if dry_run:
395 if dry_run:
393 message = message or 'sample_message'
396 message = message or 'sample_message'
@@ -407,7 +410,8 b' class BaseRepository(object):'
407 try:
410 try:
408 return self._merge_repo(
411 return self._merge_repo(
409 shadow_repository_path, target_ref, source_repo,
412 shadow_repository_path, target_ref, source_repo,
410 source_ref, message, user_name, user_email, dry_run=dry_run)
413 source_ref, message, user_name, user_email, dry_run=dry_run,
414 use_rebase=use_rebase)
411 except RepositoryError:
415 except RepositoryError:
412 log.exception(
416 log.exception(
413 'Unexpected failure when running merge, dry-run=%s',
417 'Unexpected failure when running merge, dry-run=%s',
@@ -833,7 +833,8 b' class GitRepository(BaseRepository):'
833
833
834 def _merge_repo(self, shadow_repository_path, target_ref,
834 def _merge_repo(self, shadow_repository_path, target_ref,
835 source_repo, source_ref, merge_message,
835 source_repo, source_ref, merge_message,
836 merger_name, merger_email, dry_run=False):
836 merger_name, merger_email, dry_run=False,
837 use_rebase=False):
837 if target_ref.commit_id != self.branches[target_ref.name]:
838 if target_ref.commit_id != self.branches[target_ref.name]:
838 return MergeResponse(
839 return MergeResponse(
839 False, False, None, MergeFailureReason.TARGET_IS_NOT_HEAD)
840 False, False, None, MergeFailureReason.TARGET_IS_NOT_HEAD)
@@ -659,7 +659,8 b' class MercurialRepository(BaseRepository'
659
659
660 def _merge_repo(self, shadow_repository_path, target_ref,
660 def _merge_repo(self, shadow_repository_path, target_ref,
661 source_repo, source_ref, merge_message,
661 source_repo, source_ref, merge_message,
662 merger_name, merger_email, dry_run=False):
662 merger_name, merger_email, dry_run=False,
663 use_rebase=False):
663 if target_ref.commit_id not in self._heads():
664 if target_ref.commit_id not in self._heads():
664 return MergeResponse(
665 return MergeResponse(
665 False, False, None, MergeFailureReason.TARGET_IS_NOT_HEAD)
666 False, False, None, MergeFailureReason.TARGET_IS_NOT_HEAD)
General Comments 0
You need to be logged in to leave comments. Login now