Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(567)

Unified Diff: rietveld.py

Issue 10383004: Trim message posted to rietveld to 10000. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Now works great! Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: rietveld.py
diff --git a/rietveld.py b/rietveld.py
index 70c64441fc31a01820c6a59466a6bdb4286c0be6..835f24c2a8a35d11257c8b0282848b83f2e86f88 100644
--- a/rietveld.py
+++ b/rietveld.py
@@ -1,3 +1,4 @@
+# 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
Peter Mayo (wrong one) 2012/05/04 03:05:36 Thanks for catching the "max_message - " Why doesn
logging.info('issue %s; comment: %s' % (issue, message))
return self.post('/%s/publish' % issue, [
('xsrf_token', self.xsrf_token()),
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698