##// END OF EJS Templates
pr: Rename update response flag `success` -> `executed`...
Martin Bornhold -
r1083:1492beda default
parent child Browse files
Show More
@@ -520,7 +520,7 b' class PullrequestsController(BaseRepoCon'
520 def _update_commits(self, pull_request):
520 def _update_commits(self, pull_request):
521 resp = PullRequestModel().update_commits(pull_request)
521 resp = PullRequestModel().update_commits(pull_request)
522
522
523 if resp.success:
523 if resp.executed:
524 msg = _(
524 msg = _(
525 u'Pull request updated to "{source_commit_id}" with '
525 u'Pull request updated to "{source_commit_id}" with '
526 u'{count_added} added, {count_removed} removed commits.')
526 u'{count_added} added, {count_removed} removed commits.')
@@ -63,7 +63,7 b' log = logging.getLogger(__name__)'
63 # Data structure to hold the response data when updating commits during a pull
63 # Data structure to hold the response data when updating commits during a pull
64 # request update.
64 # request update.
65 UpdateResponse = namedtuple(
65 UpdateResponse = namedtuple(
66 'UpdateResponse', 'success, reason, new, old, changes')
66 'UpdateResponse', 'executed, reason, new, old, changes')
67
67
68
68
69 class PullRequestModel(BaseModel):
69 class PullRequestModel(BaseModel):
@@ -521,7 +521,7 b' class PullRequestModel(BaseModel):'
521 "Skipping update of pull request %s due to ref type: %s",
521 "Skipping update of pull request %s due to ref type: %s",
522 pull_request, source_ref_type)
522 pull_request, source_ref_type)
523 return UpdateResponse(
523 return UpdateResponse(
524 success=False,
524 executed=False,
525 reason=UpdateFailureReason.WRONG_REF_TPYE,
525 reason=UpdateFailureReason.WRONG_REF_TPYE,
526 old=pull_request, new=None, changes=None)
526 old=pull_request, new=None, changes=None)
527
527
@@ -530,14 +530,14 b' class PullRequestModel(BaseModel):'
530 source_commit = source_repo.get_commit(commit_id=source_ref_name)
530 source_commit = source_repo.get_commit(commit_id=source_ref_name)
531 except CommitDoesNotExistError:
531 except CommitDoesNotExistError:
532 return UpdateResponse(
532 return UpdateResponse(
533 success=False,
533 executed=False,
534 reason=UpdateFailureReason.MISSING_SOURCE_REF,
534 reason=UpdateFailureReason.MISSING_SOURCE_REF,
535 old=pull_request, new=None, changes=None)
535 old=pull_request, new=None, changes=None)
536
536
537 if source_ref_id == source_commit.raw_id:
537 if source_ref_id == source_commit.raw_id:
538 log.debug("Nothing changed in pull request %s", pull_request)
538 log.debug("Nothing changed in pull request %s", pull_request)
539 return UpdateResponse(
539 return UpdateResponse(
540 success=False,
540 executed=False,
541 reason=UpdateFailureReason.NO_CHANGE,
541 reason=UpdateFailureReason.NO_CHANGE,
542 old=pull_request, new=None, changes=None)
542 old=pull_request, new=None, changes=None)
543
543
@@ -557,7 +557,7 b' class PullRequestModel(BaseModel):'
557 target_commit = target_repo.get_commit(target_ref_id)
557 target_commit = target_repo.get_commit(target_ref_id)
558 except CommitDoesNotExistError:
558 except CommitDoesNotExistError:
559 return UpdateResponse(
559 return UpdateResponse(
560 success=False,
560 executed=False,
561 reason=UpdateFailureReason.MISSING_TARGET_REF,
561 reason=UpdateFailureReason.MISSING_TARGET_REF,
562 old=pull_request, new=None, changes=None)
562 old=pull_request, new=None, changes=None)
563
563
@@ -630,7 +630,7 b' class PullRequestModel(BaseModel):'
630 'update')
630 'update')
631
631
632 return UpdateResponse(
632 return UpdateResponse(
633 success=True, reason=UpdateFailureReason.NONE,
633 executed=True, reason=UpdateFailureReason.NONE,
634 old=pull_request, new=pull_request_version, changes=changes)
634 old=pull_request, new=pull_request_version, changes=changes)
635
635
636 def _create_version_from_snapshot(self, pull_request):
636 def _create_version_from_snapshot(self, pull_request):
General Comments 0
You need to be logged in to leave comments. Login now