##// END OF EJS Templates

Compare Commits r1106:490ebeeb75af...r1108:ebe0247cd154

Target:

Source:

Time Author Commit Description
Martin Bornhold
r1106:490ebeeb75af
subrepo: Add merge failure reason code ad message for subrepo merge conflicts.
Martin Bornhold
r1107:6bc055e1504d
subrepo: Add exception for subrepo merge errors.
Martin Bornhold
r1108:ebe0247cd154
subrepo: Handle subrepo merge errors.
@@ -104,6 +104,10 class MergeFailureReason(object):
104 104 # The source repo reference is missing.
105 105 MISSING_SOURCE_REF = 10
106 106
107 # The merge was not successful, there are conflicts related to sub
108 # repositories.
109 SUBREPO_MERGE_FAILED = 11
110
107 111
108 112 class UpdateFailureReason(object):
109 113 """
@@ -44,7 +44,7 from rhodecode.lib.vcs.backends.hg.diff
44 44 from rhodecode.lib.vcs.backends.hg.inmemory import MercurialInMemoryCommit
45 45 from rhodecode.lib.vcs.exceptions import (
46 46 EmptyRepositoryError, RepositoryError, TagAlreadyExistError,
47 TagDoesNotExistError, CommitDoesNotExistError)
47 TagDoesNotExistError, CommitDoesNotExistError, SubrepoMergeError)
48 48
49 49 hexlify = binascii.hexlify
50 50 nullid = "\0" * 20
@@ -712,6 +712,11 class MercurialRepository(BaseRepository
712 712 # shadow repository.
713 713 shadow_repo.bookmark('pr-merge', revision=merge_commit_id)
714 714 merge_ref = Reference('book', 'pr-merge', merge_commit_id)
715 except SubrepoMergeError:
716 log.exception(
717 'Subrepo merge error during local merge on hg shadow repo.')
718 merge_possible = False
719 merge_failure_reason = MergeFailureReason.SUBREPO_MERGE_FAILED
715 720 except RepositoryError:
716 721 log.exception('Failure when doing local merge on hg shadow repo')
717 722 merge_possible = False
@@ -128,6 +128,14 class NodeAlreadyRemovedError(Committing
128 128 pass
129 129
130 130
131 class SubrepoMergeError(RepositoryError):
132 """
133 This happens if we try to merge a repository which contains subrepos and
134 the subrepos cannot be merged. The subrepos are not merged itself but
135 their references in the root repo are merged.
136 """
137
138
131 139 class ImproperArchiveTypeError(VCSError):
132 140 pass
133 141
@@ -156,6 +164,7 class UnhandledException(VCSError):
156 164 # TODO: johbo: Define our own exception for this and stop abusing
157 165 # urllib's exception class.
158 166 'url_error': urllib2.URLError,
167 'subrepo_merge_error': SubrepoMergeError,
159 168 }
160 169
161 170
@@ -105,6 +105,9 class PullRequestModel(BaseModel):
105 105 MergeFailureReason.MISSING_SOURCE_REF: lazy_ugettext(
106 106 'This pull request cannot be merged because the source '
107 107 'reference is missing.'),
108 MergeFailureReason.SUBREPO_MERGE_FAILED: lazy_ugettext(
109 'This pull request cannot be merged because of conflicts related '
110 'to sub repositories.'),
108 111 }
109 112
110 113 UPDATE_STATUS_MESSAGES = {