##// END OF EJS Templates
pr: Add update status messages dict.
Martin Bornhold -
r1072:5b96938c default
parent child Browse files
Show More
@@ -40,7 +40,7 b' from rhodecode.lib.markup_renderer impor'
40 from rhodecode.lib.utils import action_logger
40 from rhodecode.lib.utils import action_logger
41 from rhodecode.lib.utils2 import safe_unicode, safe_str, md5_safe
41 from rhodecode.lib.utils2 import safe_unicode, safe_str, md5_safe
42 from rhodecode.lib.vcs.backends.base import (
42 from rhodecode.lib.vcs.backends.base import (
43 Reference, MergeResponse, MergeFailureReason)
43 Reference, MergeResponse, MergeFailureReason, UpdateFailureReason)
44 from rhodecode.lib.vcs.conf import settings as vcs_settings
44 from rhodecode.lib.vcs.conf import settings as vcs_settings
45 from rhodecode.lib.vcs.exceptions import (
45 from rhodecode.lib.vcs.exceptions import (
46 CommitDoesNotExistError, EmptyRepositoryError)
46 CommitDoesNotExistError, EmptyRepositoryError)
@@ -100,6 +100,25 b' class PullRequestModel(BaseModel):'
100 'reference is missing.'),
100 'reference is missing.'),
101 }
101 }
102
102
103 UPDATE_STATUS_MESSAGES = {
104 UpdateFailureReason.NONE: lazy_ugettext(
105 'Pull request update successful.'),
106 UpdateFailureReason.UNKNOWN: lazy_ugettext(
107 'Pull request update failed because of an unknown error.'),
108 UpdateFailureReason.NO_CHANGE: lazy_ugettext(
109 'No update needed because the source reference is already '
110 'up to date.'),
111 UpdateFailureReason.WRONG_REF_TPYE: lazy_ugettext(
112 'Pull request cannot be updated because the reference type is '
113 'not supported for an update.'),
114 UpdateFailureReason.MISSING_TARGET_REF: lazy_ugettext(
115 'This pull request cannot be updated because the target '
116 'reference is missing.'),
117 UpdateFailureReason.MISSING_SOURCE_REF: lazy_ugettext(
118 'This pull request cannot be updated because the source '
119 'reference is missing.'),
120 }
121
103 def __get_pull_request(self, pull_request):
122 def __get_pull_request(self, pull_request):
104 return self._get_instance(PullRequest, pull_request)
123 return self._get_instance(PullRequest, pull_request)
105
124
General Comments 0
You need to be logged in to leave comments. Login now