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 | 7 |
8 Files | 8 Files |
9 .gclient : Current client configuration, written by 'config' command. | 9 .gclient : Current client configuration, written by 'config' command. |
10 Format is a Python script defining 'solutions', a list whose | 10 Format is a Python script defining 'solutions', a list whose |
(...skipping 1079 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1090 assert len(dep.safesync_url) > 0 | 1090 assert len(dep.safesync_url) > 0 |
1091 handle = urllib.urlopen(dep.safesync_url) | 1091 handle = urllib.urlopen(dep.safesync_url) |
1092 rev = handle.read().strip() | 1092 rev = handle.read().strip() |
1093 handle.close() | 1093 handle.close() |
1094 if not rev: | 1094 if not rev: |
1095 raise gclient_utils.Error( | 1095 raise gclient_utils.Error( |
1096 'It appears your safesync_url (%s) is not working properly\n' | 1096 'It appears your safesync_url (%s) is not working properly\n' |
1097 '(as it returned an empty response). Check your config.' % | 1097 '(as it returned an empty response). Check your config.' % |
1098 dep.safesync_url) | 1098 dep.safesync_url) |
1099 scm = gclient_scm.CreateSCM(dep.url, dep.root.root_dir, dep.name) | 1099 scm = gclient_scm.CreateSCM(dep.url, dep.root.root_dir, dep.name) |
1100 safe_rev = scm.GetUsableRev(rev=rev, options=self._options) | 1100 safe_rev = scm.GetUsableRev(rev, self._options) |
1101 if self._options.verbose: | 1101 if self._options.verbose: |
1102 print('Using safesync_url revision: %s.\n' % safe_rev) | 1102 print('Using safesync_url revision: %s.\n' % safe_rev) |
1103 self._options.revisions.append('%s@%s' % (dep.name, safe_rev)) | 1103 self._options.revisions.append('%s@%s' % (dep.name, safe_rev)) |
1104 | 1104 |
1105 def RunOnDeps(self, command, args, ignore_requirements=False, progress=True): | 1105 def RunOnDeps(self, command, args, ignore_requirements=False, progress=True): |
1106 """Runs a command on each dependency in a client and its dependencies. | 1106 """Runs a command on each dependency in a client and its dependencies. |
1107 | 1107 |
1108 Args: | 1108 Args: |
1109 command: The command to use (e.g., 'status' or 'diff') | 1109 command: The command to use (e.g., 'status' or 'diff') |
1110 args: list of str - extra arguments to add to the command line. | 1110 args: list of str - extra arguments to add to the command line. |
(...skipping 706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1817 except (gclient_utils.Error, subprocess2.CalledProcessError), e: | 1817 except (gclient_utils.Error, subprocess2.CalledProcessError), e: |
1818 print >> sys.stderr, 'Error: %s' % str(e) | 1818 print >> sys.stderr, 'Error: %s' % str(e) |
1819 return 1 | 1819 return 1 |
1820 | 1820 |
1821 | 1821 |
1822 if '__main__' == __name__: | 1822 if '__main__' == __name__: |
1823 fix_encoding.fix_encoding() | 1823 fix_encoding.fix_encoding() |
1824 sys.exit(Main(sys.argv[1:])) | 1824 sys.exit(Main(sys.argv[1:])) |
1825 | 1825 |
1826 # vim: ts=2:sw=2:tw=80:et: | 1826 # vim: ts=2:sw=2:tw=80:et: |
OLD | NEW |