Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # coding=utf-8 | 1 # coding=utf-8 |
| 2 # (The line above is necessary so that I can use 世界 in the | 2 # (The line above is necessary so that I can use 世界 in the |
| 3 # *comment* below without Python getting all bent out of shape.) | 3 # *comment* below without Python getting all bent out of shape.) |
| 4 | 4 |
| 5 # Copyright 2007-2009 Google Inc. | 5 # Copyright 2007-2009 Google Inc. |
| 6 # | 6 # |
| 7 # Licensed under the Apache License, Version 2.0 (the "License"); | 7 # Licensed under the Apache License, Version 2.0 (the "License"); |
| 8 # you may not use this file except in compliance with the License. | 8 # you may not use this file except in compliance with the License. |
| 9 # You may obtain a copy of the License at | 9 # You may obtain a copy of the License at |
| 10 # | 10 # |
| (...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 704 | 704 |
| 705 math: add IsInf, IsNaN | 705 math: add IsInf, IsNaN |
| 706 | 706 |
| 707 net: fix cname in LookupHost | 707 net: fix cname in LookupHost |
| 708 | 708 |
| 709 unicode: update to Unicode 5.0.2 | 709 unicode: update to Unicode 5.0.2 |
| 710 | 710 |
| 711 ''' | 711 ''' |
| 712 | 712 |
| 713 def promptyesno(ui, msg): | 713 def promptyesno(ui, msg): |
| 714 » return ui.promptchoice(msg, ["&yes", "&no"], 0) == 0 | 714 » if hgversion >= "2.7": |
| 715 » » return ui.promptchoice(msg + " $$ &yes $$ &no", 0) == 0 | |
| 716 » else: | |
| 717 » » return ui.promptchoice(msg, ["&yes", "&no"], 0) == 0 | |
|
hans
2014/09/07 03:09:19
Was merging this intentional?
Nico
2014/09/07 03:11:25
Yup, it's part of that upstream revision: https://
| |
| 715 | 718 |
| 716 def promptremove(ui, repo, f): | 719 def promptremove(ui, repo, f): |
| 717 if promptyesno(ui, "hg remove %s (y/n)?" % (f,)): | 720 if promptyesno(ui, "hg remove %s (y/n)?" % (f,)): |
| 718 if hg_commands.remove(ui, repo, 'path:'+f) != 0: | 721 if hg_commands.remove(ui, repo, 'path:'+f) != 0: |
| 719 ui.warn("error removing %s" % (f,)) | 722 ui.warn("error removing %s" % (f,)) |
| 720 | 723 |
| 721 def promptadd(ui, repo, f): | 724 def promptadd(ui, repo, f): |
| 722 if promptyesno(ui, "hg add %s (y/n)?" % (f,)): | 725 if promptyesno(ui, "hg add %s (y/n)?" % (f,)): |
| 723 if hg_commands.add(ui, repo, 'path:'+f) != 0: | 726 if hg_commands.add(ui, repo, 'path:'+f) != 0: |
| 724 ui.warn("error adding %s" % (f,)) | 727 ui.warn("error adding %s" % (f,)) |
| (...skipping 1877 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2602 upload_options.server = server | 2605 upload_options.server = server |
| 2603 upload_options.save_cookies = True | 2606 upload_options.save_cookies = True |
| 2604 | 2607 |
| 2605 if testing: | 2608 if testing: |
| 2606 upload_options.save_cookies = False | 2609 upload_options.save_cookies = False |
| 2607 upload_options.email = "test@example.com" | 2610 upload_options.email = "test@example.com" |
| 2608 | 2611 |
| 2609 rpc = None | 2612 rpc = None |
| 2610 | 2613 |
| 2611 global releaseBranch | 2614 global releaseBranch |
| 2612 » tags = repo.branchtags().keys() | 2615 » tags = repo.branchmap().keys() |
| 2613 if 'release-branch.go10' in tags: | 2616 if 'release-branch.go10' in tags: |
| 2614 # NOTE(rsc): This tags.sort is going to get the wrong | 2617 # NOTE(rsc): This tags.sort is going to get the wrong |
| 2615 # answer when comparing release-branch.go9 with | 2618 # answer when comparing release-branch.go9 with |
| 2616 # release-branch.go10. It will be a while before we care. | 2619 # release-branch.go10. It will be a while before we care. |
| 2617 raise hg_util.Abort('tags.sort needs to be fixed for release-bra nch.go10') | 2620 raise hg_util.Abort('tags.sort needs to be fixed for release-bra nch.go10') |
| 2618 tags.sort() | 2621 tags.sort() |
| 2619 for t in tags: | 2622 for t in tags: |
| 2620 if t.startswith('release-branch.go'): | 2623 if t.startswith('release-branch.go'): |
| 2621 releaseBranch = t | 2624 releaseBranch = t |
| 2622 | 2625 |
| (...skipping 930 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3553 ctype, body = EncodeMultipartFormData(form_fields, files) | 3556 ctype, body = EncodeMultipartFormData(form_fields, files) |
| 3554 url = "/%d/upload_patch/%d" % (int(issue), int(patchset)) | 3557 url = "/%d/upload_patch/%d" % (int(issue), int(patchset)) |
| 3555 print "Uploading patch for " + patch[0] | 3558 print "Uploading patch for " + patch[0] |
| 3556 response_body = rpc_server.Send(url, body, content_type=ctype) | 3559 response_body = rpc_server.Send(url, body, content_type=ctype) |
| 3557 lines = response_body.splitlines() | 3560 lines = response_body.splitlines() |
| 3558 if not lines or lines[0] != "OK": | 3561 if not lines or lines[0] != "OK": |
| 3559 StatusUpdate(" --> %s" % response_body) | 3562 StatusUpdate(" --> %s" % response_body) |
| 3560 sys.exit(1) | 3563 sys.exit(1) |
| 3561 rv.append([lines[1], patch[0]]) | 3564 rv.append([lines[1], patch[0]]) |
| 3562 return rv | 3565 return rv |
| OLD | NEW |