| OLD | NEW |
| 1 # Copyright (c) 2009, Google Inc. All rights reserved. | 1 # Copyright (c) 2009, Google Inc. All rights reserved. |
| 2 # Copyright (c) 2009 Apple Inc. All rights reserved. | 2 # Copyright (c) 2009 Apple Inc. All rights reserved. |
| 3 # | 3 # |
| 4 # Redistribution and use in source and binary forms, with or without | 4 # Redistribution and use in source and binary forms, with or without |
| 5 # modification, are permitted provided that the following conditions are | 5 # modification, are permitted provided that the following conditions are |
| 6 # met: | 6 # met: |
| 7 # | 7 # |
| 8 # * Redistributions of source code must retain the above copyright | 8 # * Redistributions of source code must retain the above copyright |
| 9 # notice, this list of conditions and the following disclaimer. | 9 # notice, this list of conditions and the following disclaimer. |
| 10 # * Redistributions in binary form must reproduce the above | 10 # * Redistributions in binary form must reproduce the above |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 def __init__(self, cwd, executive=None, filesystem=None): | 48 def __init__(self, cwd, executive=None, filesystem=None): |
| 49 self.cwd = cwd | 49 self.cwd = cwd |
| 50 self._executive = executive or Executive() | 50 self._executive = executive or Executive() |
| 51 self._filesystem = filesystem or FileSystem() | 51 self._filesystem = filesystem or FileSystem() |
| 52 self.checkout_root = self.find_checkout_root(self.cwd) | 52 self.checkout_root = self.find_checkout_root(self.cwd) |
| 53 | 53 |
| 54 # A wrapper used by subclasses to create processes. | 54 # A wrapper used by subclasses to create processes. |
| 55 def _run(self, | 55 def _run(self, |
| 56 args, | 56 args, |
| 57 cwd=None, | 57 cwd=None, |
| 58 # pylint: disable=W0622 | 58 # pylint: disable=redefined-builtin |
| 59 # redefining built-in | |
| 60 input=None, | 59 input=None, |
| 61 timeout_seconds=None, | 60 timeout_seconds=None, |
| 62 error_handler=None, | 61 error_handler=None, |
| 63 return_exit_code=False, | 62 return_exit_code=False, |
| 64 return_stderr=True, | 63 return_stderr=True, |
| 65 decode_output=True): | 64 decode_output=True): |
| 66 # FIXME: We should set cwd appropriately. | 65 # FIXME: We should set cwd appropriately. |
| 67 return self._executive.run_command(args, | 66 return self._executive.run_command(args, |
| 68 cwd=cwd, | 67 cwd=cwd, |
| 69 input=input, | 68 input=input, |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 #-------------------------------------------------------------------------- | 149 #-------------------------------------------------------------------------- |
| 151 # Subclasses must indicate if they support local commits, | 150 # Subclasses must indicate if they support local commits, |
| 152 # but the SCM baseclass will only call local_commits methods when this is tr
ue. | 151 # but the SCM baseclass will only call local_commits methods when this is tr
ue. |
| 153 @staticmethod | 152 @staticmethod |
| 154 def supports_local_commits(): | 153 def supports_local_commits(): |
| 155 SCM._subclass_must_implement() | 154 SCM._subclass_must_implement() |
| 156 | 155 |
| 157 def commit_locally_with_message(self, message): | 156 def commit_locally_with_message(self, message): |
| 158 _log.error("Your source control manager does not support local commits."
) | 157 _log.error("Your source control manager does not support local commits."
) |
| 159 sys.exit(1) | 158 sys.exit(1) |
| OLD | NEW |