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 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 # Post process the url to remove trailing slashes. | 190 # Post process the url to remove trailing slashes. |
191 if isinstance(self._url, basestring): | 191 if isinstance(self._url, basestring): |
192 # urls are sometime incorrectly written as proto://host/path/@rev. Replace | 192 # urls are sometime incorrectly written as proto://host/path/@rev. Replace |
193 # it to proto://host/path@rev. | 193 # it to proto://host/path@rev. |
194 self._url = self._url.replace('/@', '@') | 194 self._url = self._url.replace('/@', '@') |
195 elif not isinstance(self._url, | 195 elif not isinstance(self._url, |
196 (self.FromImpl, self.FileImpl, None.__class__)): | 196 (self.FromImpl, self.FileImpl, None.__class__)): |
197 raise gclient_utils.Error( | 197 raise gclient_utils.Error( |
198 ('dependency url must be either a string, None, ' | 198 ('dependency url must be either a string, None, ' |
199 'File() or From() instead of %s') % self._url.__class__.__name__) | 199 'File() or From() instead of %s') % self._url.__class__.__name__) |
200 if '/' in self._deps_file or '\\' in self._deps_file: | 200 # Make any deps_file path platform-appropriate. |
201 raise gclient_utils.Error('deps_file name must not be a path, just a ' | 201 for sep in ['/', '\\']: |
202 'filename. %s' % self._deps_file) | 202 self._deps_file = self._deps_file.replace(sep, os.sep) |
203 | 203 |
204 @property | 204 @property |
205 def deps_file(self): | 205 def deps_file(self): |
206 return self._deps_file | 206 return self._deps_file |
207 | 207 |
208 @property | 208 @property |
209 def managed(self): | 209 def managed(self): |
210 return self._managed | 210 return self._managed |
211 | 211 |
212 @property | 212 @property |
(...skipping 1537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1750 except (gclient_utils.Error, subprocess2.CalledProcessError), e: | 1750 except (gclient_utils.Error, subprocess2.CalledProcessError), e: |
1751 print >> sys.stderr, 'Error: %s' % str(e) | 1751 print >> sys.stderr, 'Error: %s' % str(e) |
1752 return 1 | 1752 return 1 |
1753 | 1753 |
1754 | 1754 |
1755 if '__main__' == __name__: | 1755 if '__main__' == __name__: |
1756 fix_encoding.fix_encoding() | 1756 fix_encoding.fix_encoding() |
1757 sys.exit(Main(sys.argv[1:])) | 1757 sys.exit(Main(sys.argv[1:])) |
1758 | 1758 |
1759 # vim: ts=2:sw=2:tw=80:et: | 1759 # vim: ts=2:sw=2:tw=80:et: |
OLD | NEW |