| 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 """Wrapper script around Rietveld's upload.py that groups files into | 6 """Wrapper script around Rietveld's upload.py that groups files into |
| 7 changelists.""" | 7 changelists.""" |
| 8 | 8 |
| 9 import getpass | 9 import getpass |
| 10 import os | 10 import os |
| (...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 565 content_type="application/octet-stream", timeout=None): | 565 content_type="application/octet-stream", timeout=None): |
| 566 """Send a POST/GET to Rietveld. Returns the response body.""" | 566 """Send a POST/GET to Rietveld. Returns the response body.""" |
| 567 server = GetCodeReviewSetting("CODE_REVIEW_SERVER") | 567 server = GetCodeReviewSetting("CODE_REVIEW_SERVER") |
| 568 def GetUserCredentials(): | 568 def GetUserCredentials(): |
| 569 """Prompts the user for a username and password.""" | 569 """Prompts the user for a username and password.""" |
| 570 email = upload.GetEmail("Email (login for uploading to %s)" % server) | 570 email = upload.GetEmail("Email (login for uploading to %s)" % server) |
| 571 password = getpass.getpass("Password for %s: " % email) | 571 password = getpass.getpass("Password for %s: " % email) |
| 572 return email, password | 572 return email, password |
| 573 rpc_server = upload.HttpRpcServer(server, | 573 rpc_server = upload.HttpRpcServer(server, |
| 574 GetUserCredentials, | 574 GetUserCredentials, |
| 575 host_override=server, | |
| 576 save_cookies=True) | 575 save_cookies=True) |
| 577 try: | 576 try: |
| 578 return rpc_server.Send(request_path, payload, content_type, timeout) | 577 return rpc_server.Send(request_path, payload, content_type, timeout) |
| 579 except urllib2.URLError: | 578 except urllib2.URLError: |
| 580 if timeout is None: | 579 if timeout is None: |
| 581 ErrorExit("Error accessing url %s" % request_path) | 580 ErrorExit("Error accessing url %s" % request_path) |
| 582 else: | 581 else: |
| 583 return None | 582 return None |
| 584 | 583 |
| 585 | 584 |
| (...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1229 return 0 | 1228 return 0 |
| 1230 args =["svn", command] | 1229 args =["svn", command] |
| 1231 root = GetRepositoryRoot() | 1230 root = GetRepositoryRoot() |
| 1232 args.extend([os.path.join(root, x) for x in change_info.GetFileNames()]) | 1231 args.extend([os.path.join(root, x) for x in change_info.GetFileNames()]) |
| 1233 RunShell(args, True) | 1232 RunShell(args, True) |
| 1234 return 0 | 1233 return 0 |
| 1235 | 1234 |
| 1236 | 1235 |
| 1237 if __name__ == "__main__": | 1236 if __name__ == "__main__": |
| 1238 sys.exit(main()) | 1237 sys.exit(main()) |
| OLD | NEW |