| 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 = None | 139 content = None |
| 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 args = ['cat', svn_path] | 146 args = ['svn', 'cat', svn_path] |
| 147 if sys.platform != 'darwin': | 147 if sys.platform != 'darwin': |
| 148 # MacOSX 10.5.2 has a bug with svn 1.4.4 that will trigger the | 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. | 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. | 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. | 151 # I don't have time to fix their broken stuff. |
| 152 args.append('--non-interactive') | 152 args.append('--non-interactive') |
| 153 gclient_utils.CheckCallAndFilter( | 153 gclient_utils.CheckCallAndFilter( |
| 154 args, cwd='.', filter_fn=content_array.append) | 154 args, cwd='.', filter_fn=content_array.append) |
| 155 # Exit the loop if the file was found. Override content. | 155 # Exit the loop if the file was found. Override content. |
| 156 content = '\n'.join(content_array) | 156 content = '\n'.join(content_array) |
| (...skipping 1165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1322 if command: | 1322 if command: |
| 1323 return command(argv[1:]) | 1323 return command(argv[1:]) |
| 1324 # Unknown command, try to pass that to svn | 1324 # Unknown command, try to pass that to svn |
| 1325 return CMDpassthru(argv) | 1325 return CMDpassthru(argv) |
| 1326 except gclient_utils.Error, e: | 1326 except gclient_utils.Error, e: |
| 1327 print('Got an exception') | 1327 print('Got an exception') |
| 1328 print(str(e)) | 1328 print(str(e)) |
| 1329 | 1329 |
| 1330 if __name__ == "__main__": | 1330 if __name__ == "__main__": |
| 1331 sys.exit(main(sys.argv[1:])) | 1331 sys.exit(main(sys.argv[1:])) |
| OLD | NEW |