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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 = ['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 SVN.RunAndFilterOutput(args, cwd='.', | 153 gclient_utils.CheckCallAndFilter( |
154 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) |
157 break | 157 break |
158 except gclient_utils.Error: | 158 except gclient_utils.Error: |
159 if content_array[0].startswith( | 159 if content_array[0].startswith( |
160 'svn: Can\'t get username or password'): | 160 'svn: Can\'t get username or password'): |
161 ErrorExit('Your svn credentials expired. Please run svn update ' | 161 ErrorExit('Your svn credentials expired. Please run svn update ' |
162 'to fix the cached credentials') | 162 'to fix the cached credentials') |
163 if content_array[0].startswith('svn: Can\'t get password'): | 163 if content_array[0].startswith('svn: Can\'t get password'): |
164 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... |
1320 if command: | 1320 if command: |
1321 return command(argv[1:]) | 1321 return command(argv[1:]) |
1322 # Unknown command, try to pass that to svn | 1322 # Unknown command, try to pass that to svn |
1323 return CMDpassthru(argv) | 1323 return CMDpassthru(argv) |
1324 except gclient_utils.Error, e: | 1324 except gclient_utils.Error, e: |
1325 print('Got an exception') | 1325 print('Got an exception') |
1326 print(str(e)) | 1326 print(str(e)) |
1327 | 1327 |
1328 if __name__ == "__main__": | 1328 if __name__ == "__main__": |
1329 sys.exit(main(sys.argv[1:])) | 1329 sys.exit(main(sys.argv[1:])) |
OLD | NEW |