##// END OF EJS Templates
vcs: Return merge reference in merge response....
Martin Bornhold -
r1051:668a5e47 default
parent child Browse files
Show More
@@ -53,7 +53,7 b' FILEMODE_EXECUTABLE = 0100755'
53 53 Reference = collections.namedtuple('Reference', ('type', 'name', 'commit_id'))
54 54 MergeResponse = collections.namedtuple(
55 55 'MergeResponse',
56 ('possible', 'executed', 'merge_commit_id', 'failure_reason'))
56 ('possible', 'executed', 'merge_ref', 'failure_reason'))
57 57
58 58
59 59 class MergeFailureReason(object):
@@ -36,7 +36,7 b' from rhodecode.lib.utils import safe_uni'
36 36 from rhodecode.lib.vcs import connection, path as vcspath
37 37 from rhodecode.lib.vcs.backends.base import (
38 38 BaseRepository, CollectionGenerator, Config, MergeResponse,
39 MergeFailureReason)
39 MergeFailureReason, Reference)
40 40 from rhodecode.lib.vcs.backends.git.commit import GitCommit
41 41 from rhodecode.lib.vcs.backends.git.diff import GitDiff
42 42 from rhodecode.lib.vcs.backends.git.inmemory import GitInMemoryCommit
@@ -869,7 +869,7 b' class GitRepository(BaseRepository):'
869 869 return MergeResponse(
870 870 False, False, None, MergeFailureReason.MISSING_COMMIT)
871 871
872 merge_commit_id = None
872 merge_ref = None
873 873 merge_failure_reason = MergeFailureReason.NONE
874 874 try:
875 875 shadow_repo._local_merge(merge_message, merger_name, merger_email,
@@ -885,6 +885,7 b' class GitRepository(BaseRepository):'
885 885 # be used to easily identify the last successful merge commit in
886 886 # the shadow repository.
887 887 shadow_repo.set_refs('refs/heads/pr-merge', merge_commit_id)
888 merge_ref = Reference('branch', 'pr-merge', merge_commit_id)
888 889 except RepositoryError:
889 890 log.exception('Failure when doing local merge on git shadow repo')
890 891 merge_possible = False
@@ -905,7 +906,7 b' class GitRepository(BaseRepository):'
905 906 merge_succeeded = False
906 907
907 908 return MergeResponse(
908 merge_possible, merge_succeeded, merge_commit_id,
909 merge_possible, merge_succeeded, merge_ref,
909 910 merge_failure_reason)
910 911
911 912 def _get_shadow_repository_path(self, workspace_id):
@@ -38,7 +38,7 b' from rhodecode.lib.utils import safe_uni'
38 38 from rhodecode.lib.vcs import connection
39 39 from rhodecode.lib.vcs.backends.base import (
40 40 BaseRepository, CollectionGenerator, Config, MergeResponse,
41 MergeFailureReason)
41 MergeFailureReason, Reference)
42 42 from rhodecode.lib.vcs.backends.hg.commit import MercurialCommit
43 43 from rhodecode.lib.vcs.backends.hg.diff import MercurialDiff
44 44 from rhodecode.lib.vcs.backends.hg.inmemory import MercurialInMemoryCommit
@@ -693,7 +693,7 b' class MercurialRepository(BaseRepository'
693 693 return MergeResponse(
694 694 False, False, None, MergeFailureReason.MISSING_COMMIT)
695 695
696 merge_commit_id = None
696 merge_ref = None
697 697 merge_failure_reason = MergeFailureReason.NONE
698 698
699 699 try:
@@ -706,6 +706,7 b' class MercurialRepository(BaseRepository'
706 706 # used to easily identify the last successful merge commit in the
707 707 # shadow repository.
708 708 shadow_repo.bookmark('pr-merge', revision=merge_commit_id)
709 merge_ref = Reference('book', 'pr-merge', merge_commit_id)
709 710 except RepositoryError:
710 711 log.exception('Failure when doing local merge on hg shadow repo')
711 712 merge_possible = False
@@ -743,8 +744,7 b' class MercurialRepository(BaseRepository'
743 744 merge_succeeded = False
744 745
745 746 return MergeResponse(
746 merge_possible, merge_succeeded, merge_commit_id,
747 merge_failure_reason)
747 merge_possible, merge_succeeded, merge_ref, merge_failure_reason)
748 748
749 749 def _get_shadow_instance(
750 750 self, shadow_repository_path, enable_hooks=False):
General Comments 0
You need to be logged in to leave comments. Login now