| Index: pending_manager.py
|
| diff --git a/pending_manager.py b/pending_manager.py
|
| index 22df74bbb9c1f3a788d58d221d43b8b729f8eef6..c1babacf94699cb43add70288028249968204ae6 100644
|
| --- a/pending_manager.py
|
| +++ b/pending_manager.py
|
| @@ -44,14 +44,14 @@ class PendingCommit(base.Verified):
|
| persistent = base.Verified.persistent + [
|
| # Important since they tell if we need to revalidate and send try jobs
|
| # again or not if any of these value changes.
|
| - 'issue', 'patchset', 'rietveld_server', 'processed',
|
| + 'issue', 'patchset', 'rietveld_server', 'processed', 'description',
|
| # Only a cache, these values can be regenerated.
|
| 'owner', 'reviewers', 'base_url',
|
| # Only used after a patch was committed. Keeping here for completeness.
|
| - 'description', 'revision',
|
| + 'revision',
|
| ]
|
|
|
| - def __init__(self, issue, owner, reviewers, patchset, base_url,
|
| + def __init__(self, issue, owner, reviewers, patchset, base_url, description,
|
| rietveld_server):
|
| super(PendingCommit, self).__init__()
|
| self.issue = issue
|
| @@ -60,7 +60,7 @@ class PendingCommit(base.Verified):
|
| self.patchset = patchset
|
| self.base_url = base_url
|
| self.rietveld_server = rietveld_server
|
| - self.description = None
|
| + self.description = description
|
| self.revision = None
|
| self.processed = False
|
|
|
| @@ -118,6 +118,7 @@ class PendingManager(object):
|
| issue_data['reviewers'],
|
| issue_data['patchsets'][-1],
|
| issue_data['base_url'],
|
| + issue_data['description'].replace('\r', ''),
|
| self.rietveld.url))
|
| except Exception, e:
|
| # Swallow every exception in that code and move on. Make sure to send a
|
| @@ -152,7 +153,7 @@ class PendingManager(object):
|
| try:
|
| os.chdir(self.checkout.project_path)
|
| for verifier in self.verifiers:
|
| - verifier.verify(pending, 'HEAD')
|
| + verifier.verify(pending, revision)
|
| finally:
|
| os.chdir(previous_cwd)
|
| except base.DiscardPending, e:
|
| @@ -190,7 +191,7 @@ class PendingManager(object):
|
| pending.description,
|
| pending.rietveld_server,
|
| pending.issue)
|
| - pending.revision = self.checkout.commit(commit_message, pending.user)
|
| + pending.revision = self.checkout.commit(commit_message, pending.owner)
|
| self._close_issue(pending)
|
| except base.DiscardPending, e:
|
| self._discard_pending(e.pending, e.message)
|
| @@ -205,7 +206,7 @@ class PendingManager(object):
|
| logging.info('%s not in whitelist' % pending.base_url)
|
| return False
|
|
|
| - if any(re.match(r, pending.owner) for r in self.author_white_list):
|
| + if not any(re.match(r, pending.owner) for r in self.author_white_list):
|
| # Can't commit because the owner is not on the whitelist.
|
| logging.info('%s not in whitelist' % pending.owner)
|
| return False
|
| @@ -232,7 +233,9 @@ class PendingManager(object):
|
| self._apply_patch(pending, revision)
|
| # Do a last minute verifications just before committing.
|
| pending_data = self.rietveld.get_issue_properties(pending.issue)
|
| - pending.description = pending_data['description'].replace('\r', '')
|
| + if pending.description != pending_data['description'].replace('\r', ''):
|
| + raise base.DiscardPending(pending,
|
| + 'Commit queue failed due to updated description.')
|
| pending.reviewers = pending_data['reviewers']
|
| if pending.patchset != pending_data['patchsets'][-1]:
|
| raise base.DiscardPending(pending,
|
| @@ -247,7 +250,7 @@ class PendingManager(object):
|
|
|
| def _close_issue(self, pending):
|
| """Closes a issue on Rietveld after a commit succeeded."""
|
| - viewvc_url = self.checkout.get_setting('VIEW_VC')
|
| + viewvc_url = self.checkout.get_settings('VIEW_VC')
|
| description = pending.description
|
| if viewvc_url:
|
| description += '\nCommitted: %s%s' % (viewvc_url, pending.revision)
|
|
|