##// END OF EJS Templates
mercurial: updated logging and function calls.
marcink -
r2058:7385e055 default
parent child Browse files
Show More
@@ -556,7 +556,7 b' class MercurialRepository(BaseRepository'
556 556
557 557 def _update(self, revision, clean=False):
558 558 """
559 Update the working copty to the specified revision.
559 Update the working copy to the specified revision.
560 560 """
561 561 log.debug('Doing checkout to commit: `%s` for %s', revision, self)
562 562 self._remote.update(revision, clean=clean)
@@ -592,7 +592,7 b' class MercurialRepository(BaseRepository'
592 592 push_branches=push_branches)
593 593
594 594 def _local_merge(self, target_ref, merge_message, user_name, user_email,
595 source_ref, use_rebase=False):
595 source_ref, use_rebase=False, dry_run=False):
596 596 """
597 597 Merge the given source_revision into the checked out revision.
598 598
@@ -703,6 +703,9 b' class MercurialRepository(BaseRepository'
703 703 source_repo, source_ref, merge_message,
704 704 merger_name, merger_email, dry_run=False,
705 705 use_rebase=False, close_branch=False):
706
707 log.debug('Executing merge_repo with %s strategy, dry_run mode:%s',
708 'rebase' if use_rebase else 'merge', dry_run)
706 709 if target_ref.commit_id not in self._heads():
707 710 return MergeResponse(
708 711 False, False, None, MergeFailureReason.TARGET_IS_NOT_HEAD)
@@ -713,7 +716,7 b' class MercurialRepository(BaseRepository'
713 716 return MergeResponse(
714 717 False, False, None,
715 718 MergeFailureReason.HG_TARGET_HAS_MULTIPLE_HEADS)
716 except CommitDoesNotExistError as e:
719 except CommitDoesNotExistError:
717 720 log.exception('Failure when looking up branch heads on hg target')
718 721 return MergeResponse(
719 722 False, False, None, MergeFailureReason.MISSING_TARGET_REF)
@@ -762,7 +765,7 b' class MercurialRepository(BaseRepository'
762 765 try:
763 766 merge_commit_id, needs_push = shadow_repo._local_merge(
764 767 target_ref, merge_message, merger_name, merger_email,
765 source_ref, use_rebase=use_rebase)
768 source_ref, use_rebase=use_rebase, dry_run=dry_run)
766 769 merge_possible = True
767 770
768 771 # read the state of the close action, if it
@@ -779,10 +782,12 b' class MercurialRepository(BaseRepository'
779 782 'Subrepo merge error during local merge on hg shadow repo.')
780 783 merge_possible = False
781 784 merge_failure_reason = MergeFailureReason.SUBREPO_MERGE_FAILED
785 needs_push = False
782 786 except RepositoryError:
783 787 log.exception('Failure when doing local merge on hg shadow repo')
784 788 merge_possible = False
785 789 merge_failure_reason = MergeFailureReason.MERGE_FAILED
790 needs_push = False
786 791
787 792 if merge_possible and not dry_run:
788 793 if needs_push:
@@ -795,6 +800,8 b' class MercurialRepository(BaseRepository'
795 800 shadow_repo_with_hooks = self._get_shadow_instance(
796 801 shadow_repository_path,
797 802 enable_hooks=True)
803 # This is the actual merge action, we push from shadow
804 # into origin.
798 805 # Note: the push_branches option will push any new branch
799 806 # defined in the source repository to the target. This may
800 807 # be dangerous as branches are permanent in Mercurial.
General Comments 0
You need to be logged in to leave comments. Login now