diff options
Diffstat (limited to 'subcmds/download.py')
| -rw-r--r-- | subcmds/download.py | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/subcmds/download.py b/subcmds/download.py index 0abe90d0..471e88b5 100644 --- a/subcmds/download.py +++ b/subcmds/download.py | |||
| @@ -13,6 +13,7 @@ | |||
| 13 | # See the License for the specific language governing permissions and | 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. | 14 | # limitations under the License. |
| 15 | 15 | ||
| 16 | from __future__ import print_function | ||
| 16 | import re | 17 | import re |
| 17 | import sys | 18 | import sys |
| 18 | 19 | ||
| @@ -32,13 +33,13 @@ makes it available in your project's local working directory. | |||
| 32 | """ | 33 | """ |
| 33 | 34 | ||
| 34 | def _Options(self, p): | 35 | def _Options(self, p): |
| 35 | p.add_option('-c','--cherry-pick', | 36 | p.add_option('-c', '--cherry-pick', |
| 36 | dest='cherrypick', action='store_true', | 37 | dest='cherrypick', action='store_true', |
| 37 | help="cherry-pick instead of checkout") | 38 | help="cherry-pick instead of checkout") |
| 38 | p.add_option('-r','--revert', | 39 | p.add_option('-r', '--revert', |
| 39 | dest='revert', action='store_true', | 40 | dest='revert', action='store_true', |
| 40 | help="revert instead of checkout") | 41 | help="revert instead of checkout") |
| 41 | p.add_option('-f','--ff-only', | 42 | p.add_option('-f', '--ff-only', |
| 42 | dest='ffonly', action='store_true', | 43 | dest='ffonly', action='store_true', |
| 43 | help="force fast-forward merge") | 44 | help="force fast-forward merge") |
| 44 | 45 | ||
| @@ -68,23 +69,23 @@ makes it available in your project's local working directory. | |||
| 68 | for project, change_id, ps_id in self._ParseChangeIds(args): | 69 | for project, change_id, ps_id in self._ParseChangeIds(args): |
| 69 | dl = project.DownloadPatchSet(change_id, ps_id) | 70 | dl = project.DownloadPatchSet(change_id, ps_id) |
| 70 | if not dl: | 71 | if not dl: |
| 71 | print >>sys.stderr, \ | 72 | print('[%s] change %d/%d not found' |
| 72 | '[%s] change %d/%d not found' \ | 73 | % (project.name, change_id, ps_id), |
| 73 | % (project.name, change_id, ps_id) | 74 | file=sys.stderr) |
| 74 | sys.exit(1) | 75 | sys.exit(1) |
| 75 | 76 | ||
| 76 | if not opt.revert and not dl.commits: | 77 | if not opt.revert and not dl.commits: |
| 77 | print >>sys.stderr, \ | 78 | print('[%s] change %d/%d has already been merged' |
| 78 | '[%s] change %d/%d has already been merged' \ | 79 | % (project.name, change_id, ps_id), |
| 79 | % (project.name, change_id, ps_id) | 80 | file=sys.stderr) |
| 80 | continue | 81 | continue |
| 81 | 82 | ||
| 82 | if len(dl.commits) > 1: | 83 | if len(dl.commits) > 1: |
| 83 | print >>sys.stderr, \ | 84 | print('[%s] %d/%d depends on %d unmerged changes:' \ |
| 84 | '[%s] %d/%d depends on %d unmerged changes:' \ | 85 | % (project.name, change_id, ps_id, len(dl.commits)), |
| 85 | % (project.name, change_id, ps_id, len(dl.commits)) | 86 | file=sys.stderr) |
| 86 | for c in dl.commits: | 87 | for c in dl.commits: |
| 87 | print >>sys.stderr, ' %s' % (c) | 88 | print(' %s' % (c), file=sys.stderr) |
| 88 | if opt.cherrypick: | 89 | if opt.cherrypick: |
| 89 | project._CherryPick(dl.commit) | 90 | project._CherryPick(dl.commit) |
| 90 | elif opt.revert: | 91 | elif opt.revert: |
