| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 """Meta checkout manager supporting both Subversion and GIT.""" | 6 """Meta checkout manager supporting both Subversion and GIT.""" |
| 7 # Files | 7 # Files |
| 8 # .gclient : Current client configuration, written by 'config' command. | 8 # .gclient : Current client configuration, written by 'config' command. |
| 9 # Format is a Python script defining 'solutions', a list whose | 9 # Format is a Python script defining 'solutions', a list whose |
| 10 # entries each are maps binding the strings "name" and "url" | 10 # entries each are maps binding the strings "name" and "url" |
| (...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 673 def enable_deletion_of_conflicting_checkouts(): | 673 def enable_deletion_of_conflicting_checkouts(): |
| 674 """Determines whether to enable new checkout deletion behavior. | 674 """Determines whether to enable new checkout deletion behavior. |
| 675 | 675 |
| 676 Initially, enables the experimental functionality on a small set of | 676 Initially, enables the experimental functionality on a small set of |
| 677 bots. | 677 bots. |
| 678 """ | 678 """ |
| 679 # TODO(borenet): Remove this hack as soon as we've verified that it | 679 # TODO(borenet): Remove this hack as soon as we've verified that it |
| 680 # doesn't cause the bots to break. | 680 # doesn't cause the bots to break. |
| 681 if not os.environ.get('CHROME_HEADLESS'): | 681 if not os.environ.get('CHROME_HEADLESS'): |
| 682 return False | 682 return False |
| 683 return socket.gethostname() in ('vm859-m1', 'BUILD1-M1', | 683 hostname = socket.gethostname() |
| 684 'vm630-m1.golo.chromium.org') | 684 logging.warning('Hostname of this machine: %s' % hostname) |
| 685 return hostname in ('vm859-m1', 'build1-m1', 'vm630-m1') |
| 685 | 686 |
| 686 # When updating, determine whether the destination directory contains a | 687 # When updating, determine whether the destination directory contains a |
| 687 # checkout of the desired repository. If not, avoid conflicts by | 688 # checkout of the desired repository. If not, avoid conflicts by |
| 688 # deleting the directory before running the update. | 689 # deleting the directory before running the update. |
| 689 if command == 'update' and enable_deletion_of_conflicting_checkouts(): | 690 if command == 'update' and enable_deletion_of_conflicting_checkouts(): |
| 690 logging.warning('Experimental deletion of mismatching checkouts ' | 691 logging.warning('Experimental deletion of mismatching checkouts ' |
| 691 'enabled.') | 692 'enabled.') |
| 692 actual_remote_url = self._used_scm.GetRemoteURL(options) | 693 actual_remote_url = self._used_scm.GetRemoteURL(options) |
| 693 url, _ = gclient_utils.SplitUrlRevision(parsed_url) | 694 url, _ = gclient_utils.SplitUrlRevision(parsed_url) |
| 694 url = url.rstrip('/') | 695 url = url.rstrip('/') |
| (...skipping 1261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1956 raise | 1957 raise |
| 1957 except (gclient_utils.Error, subprocess2.CalledProcessError), e: | 1958 except (gclient_utils.Error, subprocess2.CalledProcessError), e: |
| 1958 print >> sys.stderr, 'Error: %s' % str(e) | 1959 print >> sys.stderr, 'Error: %s' % str(e) |
| 1959 return 1 | 1960 return 1 |
| 1960 | 1961 |
| 1961 | 1962 |
| 1962 if '__main__' == __name__: | 1963 if '__main__' == __name__: |
| 1963 sys.exit(Main(sys.argv[1:])) | 1964 sys.exit(Main(sys.argv[1:])) |
| 1964 | 1965 |
| 1965 # vim: ts=2:sw=2:tw=80:et: | 1966 # vim: ts=2:sw=2:tw=80:et: |
| OLD | NEW |