Show More
@@ -492,7 +492,7 b' class PullrequestsController(BaseRepoCon' | |||||
492 | msg = PullRequestModel.UPDATE_STATUS_MESSAGES[resp.reason] |
|
492 | msg = PullRequestModel.UPDATE_STATUS_MESSAGES[resp.reason] | |
493 | warning_reasons = [ |
|
493 | warning_reasons = [ | |
494 | UpdateFailureReason.NO_CHANGE, |
|
494 | UpdateFailureReason.NO_CHANGE, | |
495 |
UpdateFailureReason.WRONG_REF_T |
|
495 | UpdateFailureReason.WRONG_REF_TYPE, | |
496 | ] |
|
496 | ] | |
497 | category = 'warning' if resp.reason in warning_reasons else 'error' |
|
497 | category = 'warning' if resp.reason in warning_reasons else 'error' | |
498 | h.flash(msg, category=category) |
|
498 | h.flash(msg, category=category) |
@@ -130,7 +130,7 b' class UpdateFailureReason(object):' | |||||
130 | NO_CHANGE = 2 |
|
130 | NO_CHANGE = 2 | |
131 |
|
131 | |||
132 | # The pull request has a reference type that is not supported for update. |
|
132 | # The pull request has a reference type that is not supported for update. | |
133 |
WRONG_REF_T |
|
133 | WRONG_REF_TYPE = 3 | |
134 |
|
134 | |||
135 | # Update failed because the target reference is missing. |
|
135 | # Update failed because the target reference is missing. | |
136 | MISSING_TARGET_REF = 4 |
|
136 | MISSING_TARGET_REF = 4 |
@@ -118,9 +118,9 b' class PullRequestModel(BaseModel):' | |||||
118 | 'Pull request update failed because of an unknown error.'), |
|
118 | 'Pull request update failed because of an unknown error.'), | |
119 | UpdateFailureReason.NO_CHANGE: lazy_ugettext( |
|
119 | UpdateFailureReason.NO_CHANGE: lazy_ugettext( | |
120 | 'No update needed because the source and target have not changed.'), |
|
120 | 'No update needed because the source and target have not changed.'), | |
121 |
UpdateFailureReason.WRONG_REF_T |
|
121 | UpdateFailureReason.WRONG_REF_TYPE: lazy_ugettext( | |
122 | 'Pull request cannot be updated because the reference type is ' |
|
122 | 'Pull request cannot be updated because the reference type is ' | |
123 | 'not supported for an update.'), |
|
123 | 'not supported for an update. Only Branch, Tag or Bookmark is allowed.'), | |
124 | UpdateFailureReason.MISSING_TARGET_REF: lazy_ugettext( |
|
124 | UpdateFailureReason.MISSING_TARGET_REF: lazy_ugettext( | |
125 | 'This pull request cannot be updated because the target ' |
|
125 | 'This pull request cannot be updated because the target ' | |
126 | 'reference is missing.'), |
|
126 | 'reference is missing.'), | |
@@ -594,7 +594,7 b' class PullRequestModel(BaseModel):' | |||||
594 | pull_request, source_ref_type) |
|
594 | pull_request, source_ref_type) | |
595 | return UpdateResponse( |
|
595 | return UpdateResponse( | |
596 | executed=False, |
|
596 | executed=False, | |
597 |
reason=UpdateFailureReason.WRONG_REF_T |
|
597 | reason=UpdateFailureReason.WRONG_REF_TYPE, | |
598 | old=pull_request, new=None, changes=None, |
|
598 | old=pull_request, new=None, changes=None, | |
599 | source_changed=False, target_changed=False) |
|
599 | source_changed=False, target_changed=False) | |
600 |
|
600 |
General Comments 0
You need to be logged in to leave comments.
Login now