diff --git a/rhodecode/lib/vcs/backends/base.py b/rhodecode/lib/vcs/backends/base.py --- a/rhodecode/lib/vcs/backends/base.py +++ b/rhodecode/lib/vcs/backends/base.py @@ -53,7 +53,7 @@ FILEMODE_EXECUTABLE = 0100755 Reference = collections.namedtuple('Reference', ('type', 'name', 'commit_id')) MergeResponse = collections.namedtuple( 'MergeResponse', - ('possible', 'executed', 'merge_commit_id', 'failure_reason')) + ('possible', 'executed', 'merge_ref', 'failure_reason')) class MergeFailureReason(object): diff --git a/rhodecode/lib/vcs/backends/git/repository.py b/rhodecode/lib/vcs/backends/git/repository.py --- a/rhodecode/lib/vcs/backends/git/repository.py +++ b/rhodecode/lib/vcs/backends/git/repository.py @@ -36,7 +36,7 @@ from rhodecode.lib.utils import safe_uni from rhodecode.lib.vcs import connection, path as vcspath from rhodecode.lib.vcs.backends.base import ( BaseRepository, CollectionGenerator, Config, MergeResponse, - MergeFailureReason) + MergeFailureReason, Reference) from rhodecode.lib.vcs.backends.git.commit import GitCommit from rhodecode.lib.vcs.backends.git.diff import GitDiff from rhodecode.lib.vcs.backends.git.inmemory import GitInMemoryCommit @@ -869,7 +869,7 @@ class GitRepository(BaseRepository): return MergeResponse( False, False, None, MergeFailureReason.MISSING_COMMIT) - merge_commit_id = None + merge_ref = None merge_failure_reason = MergeFailureReason.NONE try: shadow_repo._local_merge(merge_message, merger_name, merger_email, @@ -885,6 +885,7 @@ class GitRepository(BaseRepository): # be used to easily identify the last successful merge commit in # the shadow repository. shadow_repo.set_refs('refs/heads/pr-merge', merge_commit_id) + merge_ref = Reference('branch', 'pr-merge', merge_commit_id) except RepositoryError: log.exception('Failure when doing local merge on git shadow repo') merge_possible = False @@ -905,7 +906,7 @@ class GitRepository(BaseRepository): merge_succeeded = False return MergeResponse( - merge_possible, merge_succeeded, merge_commit_id, + merge_possible, merge_succeeded, merge_ref, merge_failure_reason) def _get_shadow_repository_path(self, workspace_id): diff --git a/rhodecode/lib/vcs/backends/hg/repository.py b/rhodecode/lib/vcs/backends/hg/repository.py --- a/rhodecode/lib/vcs/backends/hg/repository.py +++ b/rhodecode/lib/vcs/backends/hg/repository.py @@ -38,7 +38,7 @@ from rhodecode.lib.utils import safe_uni from rhodecode.lib.vcs import connection from rhodecode.lib.vcs.backends.base import ( BaseRepository, CollectionGenerator, Config, MergeResponse, - MergeFailureReason) + MergeFailureReason, Reference) from rhodecode.lib.vcs.backends.hg.commit import MercurialCommit from rhodecode.lib.vcs.backends.hg.diff import MercurialDiff from rhodecode.lib.vcs.backends.hg.inmemory import MercurialInMemoryCommit @@ -693,7 +693,7 @@ class MercurialRepository(BaseRepository return MergeResponse( False, False, None, MergeFailureReason.MISSING_COMMIT) - merge_commit_id = None + merge_ref = None merge_failure_reason = MergeFailureReason.NONE try: @@ -706,6 +706,7 @@ class MercurialRepository(BaseRepository # used to easily identify the last successful merge commit in the # shadow repository. shadow_repo.bookmark('pr-merge', revision=merge_commit_id) + merge_ref = Reference('book', 'pr-merge', merge_commit_id) except RepositoryError: log.exception('Failure when doing local merge on hg shadow repo') merge_possible = False @@ -743,8 +744,7 @@ class MercurialRepository(BaseRepository merge_succeeded = False return MergeResponse( - merge_possible, merge_succeeded, merge_commit_id, - merge_failure_reason) + merge_possible, merge_succeeded, merge_ref, merge_failure_reason) def _get_shadow_instance( self, shadow_repository_path, enable_hooks=False):