Tools/ChangeLog

 12011-01-10 Eric Seidel <eric@webkit.org>
 2
 3 Reviewed by Ojan Vafai.
 4
 5 style-queue messages are way too long for big patches
 6 https://bugs.webkit.org/show_bug.cgi?id=52161
 7
 8 We definitely could build much fancier list-to-string-with-limit functions
 9 but this should be sufficient for our needs at the moment.
 10
 11 * Scripts/webkitpy/common/system/executive.py:
 12 * Scripts/webkitpy/common/system/executive_unittest.py:
 13
1142011-01-10 Adam Roben <aroben@apple.com>
215
316 Roll out r75392

Tools/Scripts/webkitpy/common/system/executive.py

@@_log = logging.getLogger("webkitpy.common.system")
5353
5454class ScriptError(Exception):
5555
 56 # This is a custom List.__str__ implementation to allow size limiting.
 57 def _string_from_args(self, args, limit=100):
 58 args_string = unicode(args)
 59 # We could make this much fancier, but for now this is OK.
 60 if len(args_string) > limit:
 61 return args_string[:limit - 3] + "..."
 62 return args_string
 63
5664 def __init__(self,
5765 message=None,
5866 script_args=None,

@@class ScriptError(Exception):
6068 output=None,
6169 cwd=None):
6270 if not message:
63  message = 'Failed to run "%s"' % script_args
 71 message = 'Failed to run "%s"' % self._string_from_args(script_args)
6472 if exit_code:
6573 message += " exit_code: %d" % exit_code
6674 if cwd:

Tools/Scripts/webkitpy/common/system/executive_unittest.py

@@from webkitpy.common.system.executive import Executive, run_command, ScriptError
3737from webkitpy.test import cat, echo
3838
3939
 40class ScriptErrorTest(unittest.TestCase):
 41 def test_string_from_args(self):
 42 error = ScriptError()
 43 self.assertEquals(error._string_from_args(None), 'None')
 44 self.assertEquals(error._string_from_args([]), '[]')
 45 self.assertEquals(error._string_from_args(map(str, range(30))), "['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17'...")
 46
 47
4048def never_ending_command():
4149 """Arguments for a command that will never end (useful for testing process
4250 killing). It should be a process that is unlikely to already be running