Commit 2c96af7d authored by maruel@chromium.org's avatar maruel@chromium.org

Trim message posted to rietveld to 10000.

Rietveld doesn't post the message when it is too large.

R=petermayo@chromium.org
BUG=
TEST=Now the CQ should stop having weird case where it doesn't post a message on
CQ failure. It was because the message was simply too long!


Review URL: http://codereview.chromium.org/10383004

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@135326 0039d316-1c4b-4281-b951-d872f2087c98
parent 306080c4
# coding: utf-8
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
......@@ -217,6 +218,10 @@ class Rietveld(object):
('xsrf_token', self.xsrf_token())])
def add_comment(self, issue, message):
max_message = 10000
tail = '…\n(message too large)'
if len(message) > max_message:
message = message[:max_message-len(tail)] + tail
logging.info('issue %s; comment: %s' % (issue, message))
return self.post('/%s/publish' % issue, [
('xsrf_token', self.xsrf_token()),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment