# HG changeset patch # User Marcin Kuzminski # Date 2017-04-24 14:36:28 # Node ID d43a5d8f926ef3d2dda251736ee160d6e5cdb80c # Parent f0d2d5116dd22694ba6f389046d8ce4b9361afc8 pull-request: fixed typo in wrong ref type error, and added which refs are actually allowed. diff --git a/rhodecode/controllers/pullrequests.py b/rhodecode/controllers/pullrequests.py --- a/rhodecode/controllers/pullrequests.py +++ b/rhodecode/controllers/pullrequests.py @@ -492,7 +492,7 @@ class PullrequestsController(BaseRepoCon msg = PullRequestModel.UPDATE_STATUS_MESSAGES[resp.reason] warning_reasons = [ UpdateFailureReason.NO_CHANGE, - UpdateFailureReason.WRONG_REF_TPYE, + UpdateFailureReason.WRONG_REF_TYPE, ] category = 'warning' if resp.reason in warning_reasons else 'error' h.flash(msg, category=category) 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 @@ -130,7 +130,7 @@ class UpdateFailureReason(object): NO_CHANGE = 2 # The pull request has a reference type that is not supported for update. - WRONG_REF_TPYE = 3 + WRONG_REF_TYPE = 3 # Update failed because the target reference is missing. MISSING_TARGET_REF = 4 diff --git a/rhodecode/model/pull_request.py b/rhodecode/model/pull_request.py --- a/rhodecode/model/pull_request.py +++ b/rhodecode/model/pull_request.py @@ -118,9 +118,9 @@ class PullRequestModel(BaseModel): 'Pull request update failed because of an unknown error.'), UpdateFailureReason.NO_CHANGE: lazy_ugettext( 'No update needed because the source and target have not changed.'), - UpdateFailureReason.WRONG_REF_TPYE: lazy_ugettext( + UpdateFailureReason.WRONG_REF_TYPE: lazy_ugettext( 'Pull request cannot be updated because the reference type is ' - 'not supported for an update.'), + 'not supported for an update. Only Branch, Tag or Bookmark is allowed.'), UpdateFailureReason.MISSING_TARGET_REF: lazy_ugettext( 'This pull request cannot be updated because the target ' 'reference is missing.'), @@ -594,7 +594,7 @@ class PullRequestModel(BaseModel): pull_request, source_ref_type) return UpdateResponse( executed=False, - reason=UpdateFailureReason.WRONG_REF_TPYE, + reason=UpdateFailureReason.WRONG_REF_TYPE, old=pull_request, new=None, changes=None, source_changed=False, target_changed=False)