Changeset 148183 in webkit


Ignore:
Timestamp:
Apr 11, 2013 1:27:06 AM (11 years ago)
Author:
glenn@skynav.com
Message:

[webkitpy] Remove lingering return_exit_code usage in scm_mock and rebaselineserver.
https://bugs.webkit.org/show_bug.cgi?id=114418

Reviewed by Ryosuke Niwa.

  • Scripts/webkitpy/common/checkout/scm/scm_mock.py:

(MockSCM.add): Remove optional remove_exit_code argument.
(MockSCM.add_list): Remove optional remove_exit_code argument and return value.

  • Scripts/webkitpy/tool/servers/rebaselineserver.py:

(_rebaseline_test): Use ScriptError to capture SCM.add() failure and exit code.
(_move_test_baselines): Use ScriptError to capture SCM.add() failure and exit code.

Location:
trunk/Tools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r148181 r148183  
     12013-04-11  Glenn Adams  <glenn@skynav.com>
     2
     3        [webkitpy] Remove lingering return_exit_code usage in scm_mock and rebaselineserver.
     4        https://bugs.webkit.org/show_bug.cgi?id=114418
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        * Scripts/webkitpy/common/checkout/scm/scm_mock.py:
     9        (MockSCM.add): Remove optional remove_exit_code argument.
     10        (MockSCM.add_list): Remove optional remove_exit_code argument and return value.
     11        * Scripts/webkitpy/tool/servers/rebaselineserver.py:
     12        (_rebaseline_test): Use ScriptError to capture SCM.add() failure and exit code.
     13        (_move_test_baselines): Use ScriptError to capture SCM.add() failure and exit code.
     14
    1152013-04-11  Ryosuke Niwa  <rniwa@webkit.org>
    216
  • trunk/Tools/Scripts/webkitpy/common/checkout/scm/scm_mock.py

    r145141 r148183  
    3939        self._executive = executive or MockExecutive()
    4040
    41     def add(self, destination_path, return_exit_code=False):
    42         self.add_list([destination_path], return_exit_code)
     41    def add(self, destination_path):
     42        self.add_list([destination_path])
    4343
    44     def add_list(self, destination_paths, return_exit_code=False):
     44    def add_list(self, destination_paths):
    4545        self.added_paths.update(set(destination_paths))
    46         if return_exit_code:
    47             return 0
    4846
    4947    def has_working_directory_changes(self):
  • trunk/Tools/Scripts/webkitpy/tool/servers/rebaselineserver.py

    r130356 r148183  
    3333
    3434from webkitpy.common.host import Host  # FIXME: This should not be needed!
     35from webkitpy.common.system.executive import ScriptError
    3536from webkitpy.layout_tests.port.base import Port
    3637from webkitpy.tool.servers.reflectionhandler import ReflectionHandler
     
    115116            target_expectations_directory, destination_file)
    116117        filesystem.copyfile(source_path, destination_path)
    117         exit_code = scm.add(destination_path, return_exit_code=True)
    118         if exit_code:
     118        try:
     119            scm.add(destination_path)
     120            log('    Updated %s' % destination_file)
     121        except ScriptError, error:
    119122            log('    Could not update %s in SCM, exit code %d' %
    120                 (destination_file, exit_code))
     123                (destination_file, error.exit_code))
    121124            return False
    122         else:
    123             log('    Updated %s' % destination_file)
    124125
    125126    return True
     
    151152        destination_path = filesystem.join(destination_directory, file_name)
    152153        filesystem.copyfile(source_path, destination_path)
    153         exit_code = test_config.scm.add(destination_path, return_exit_code=True)
    154         if exit_code:
     154        try:
     155            test_config.scm.add(destination_path)
     156            log('    Moved %s' % file_name)
     157        except ScriptError, error:
    155158            log('    Could not update %s in SCM, exit code %d' %
    156                 (file_name, exit_code))
     159                (file_name, error.exit_code))
    157160            return False
    158         else:
    159             log('    Moved %s' % file_name)
    160161
    161162    return True
Note: See TracChangeset for help on using the changeset viewer.