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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 while True: | 136 while True: |
137 # Look in the repository at the current level for the file. | 137 # Look in the repository at the current level for the file. |
138 for _ in range(5): | 138 for _ in range(5): |
139 content = "" | 139 content = "" |
140 try: | 140 try: |
141 # Take advantage of the fact that svn won't output to stderr in case | 141 # Take advantage of the fact that svn won't output to stderr in case |
142 # of success but will do in case of failure so don't mind putting | 142 # of success but will do in case of failure so don't mind putting |
143 # stderr into content_array. | 143 # stderr into content_array. |
144 content_array = [] | 144 content_array = [] |
145 svn_path = url_path + "/" + filename | 145 svn_path = url_path + "/" + filename |
146 SVN.RunAndFilterOutput(['cat', svn_path, '--non-interactive'], | 146 args = ['cat', svn_path] |
147 cwd='.', filter_fn=content_array.append) | 147 if sys.platform != 'darwin': |
| 148 # MacOSX 10.5.2 has a bug with svn 1.4.4 that will trigger the |
| 149 # 'Can\'t get username or password' and can be fixed easily. |
| 150 # The fix doesn't work if the user upgraded to svn 1.6.x. Bleh. |
| 151 # I don't have time to fix their broken stuff. |
| 152 args.append('--non-interactive') |
| 153 SVN.RunAndFilterOutput(args, cwd='.', |
| 154 filter_fn=content_array.append) |
148 # Exit the loop if the file was found. Override content. | 155 # Exit the loop if the file was found. Override content. |
149 content = '\n'.join(content_array) | 156 content = '\n'.join(content_array) |
150 break | 157 break |
151 except gclient_utils.Error: | 158 except gclient_utils.Error: |
152 if content_array[0].startswith( | 159 if content_array[0].startswith( |
153 'svn: Can\'t get username or password'): | 160 'svn: Can\'t get username or password'): |
154 ErrorExit('Your svn credentials expired. Please run svn update ' | 161 ErrorExit('Your svn credentials expired. Please run svn update ' |
155 'to fix the cached credentials') | 162 'to fix the cached credentials') |
156 if content_array[0].startswith('svn: Can\'t get password'): | 163 if content_array[0].startswith('svn: Can\'t get password'): |
157 ErrorExit('If are using a Mac and svn --version shows 1.4.x, ' | 164 ErrorExit('If are using a Mac and svn --version shows 1.4.x, ' |
(...skipping 1155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1313 if command: | 1320 if command: |
1314 return command(argv[1:]) | 1321 return command(argv[1:]) |
1315 # Unknown command, try to pass that to svn | 1322 # Unknown command, try to pass that to svn |
1316 return CMDpassthru(argv) | 1323 return CMDpassthru(argv) |
1317 except gclient_utils.Error, e: | 1324 except gclient_utils.Error, e: |
1318 print('Got an exception') | 1325 print('Got an exception') |
1319 print(str(e)) | 1326 print(str(e)) |
1320 | 1327 |
1321 if __name__ == "__main__": | 1328 if __name__ == "__main__": |
1322 sys.exit(main(sys.argv[1:])) | 1329 sys.exit(main(sys.argv[1:])) |
OLD | NEW |