OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2006-2009 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 """\ | 6 """\ |
7 Wrapper script around Rietveld's upload.py that simplifies working with groups | 7 Wrapper script around Rietveld's upload.py that simplifies working with groups |
8 of files. | 8 of files. |
9 """ | 9 """ |
10 | 10 |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 SVN.RunAndFilterOutput(['cat', svn_path, '--non-interactive'], '.', | 146 SVN.RunAndFilterOutput(['cat', svn_path, '--non-interactive'], '.', |
147 False, False, content_array.append) | 147 False, False, content_array.append) |
148 # Exit the loop if the file was found. Override content. | 148 # Exit the loop if the file was found. Override content. |
149 content = '\n'.join(content_array) | 149 content = '\n'.join(content_array) |
150 break | 150 break |
151 except gclient_utils.Error, e: | 151 except gclient_utils.Error, e: |
152 if content_array[0].startswith( | 152 if content_array[0].startswith( |
153 'svn: Can\'t get username or password'): | 153 'svn: Can\'t get username or password'): |
154 ErrorExit('Your svn credentials expired. Please run svn update ' | 154 ErrorExit('Your svn credentials expired. Please run svn update ' |
155 'to fix the cached credentials') | 155 'to fix the cached credentials') |
| 156 if content_array[0].startswith('svn: Can\'t get password'): |
| 157 ErrorExit('If are using a Mac and svn --version shows 1.4.x, ' |
| 158 'please hack gcl.py to remove --non-interactive usage, it\'s' |
| 159 'a bug on your installed copy') |
156 if not content_array[0].startswith('svn: File not found:'): | 160 if not content_array[0].startswith('svn: File not found:'): |
157 # Try again. | 161 # Try again. |
158 continue | 162 continue |
159 if content: | 163 if content: |
160 break | 164 break |
161 if url_path == repo_root: | 165 if url_path == repo_root: |
162 # Reached the root. Abandoning search. | 166 # Reached the root. Abandoning search. |
163 break | 167 break |
164 # Go up one level to try again. | 168 # Go up one level to try again. |
165 url_path = os.path.dirname(url_path) | 169 url_path = os.path.dirname(url_path) |
(...skipping 1150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1316 if command: | 1320 if command: |
1317 return command(argv[1:]) | 1321 return command(argv[1:]) |
1318 # Unknown command, try to pass that to svn | 1322 # Unknown command, try to pass that to svn |
1319 return CMDpassthru(argv) | 1323 return CMDpassthru(argv) |
1320 except gclient_utils.Error, e: | 1324 except gclient_utils.Error, e: |
1321 print('Got an exception') | 1325 print('Got an exception') |
1322 print(str(e)) | 1326 print(str(e)) |
1323 | 1327 |
1324 if __name__ == "__main__": | 1328 if __name__ == "__main__": |
1325 sys.exit(main(sys.argv[1:])) | 1329 sys.exit(main(sys.argv[1:])) |
OLD | NEW |