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