| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2014 The Chromium Authors. All rights reserved. | 2 # Copyright 2014 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 Checks out a downstream branch from the currently checked out branch. If there | 7 Checks out a downstream branch from the currently checked out branch. If there |
| 8 is more than one downstream branch, then this script will prompt you to select | 8 is more than one downstream branch, then this script will prompt you to select |
| 9 which branch. | 9 which branch. |
| 10 """ | 10 """ |
| 11 |
| 11 import sys | 12 import sys |
| 12 | 13 |
| 13 from git_common import current_branch, branches, upstream, run, hash_one | 14 from git_common import current_branch, branches, upstream, run, hash_one |
| 14 | 15 |
| 15 | 16 |
| 16 def main(argv): | 17 def main(argv): |
| 17 assert len(argv) == 1, "No arguments expected" | 18 assert len(argv) == 1, "No arguments expected" |
| 18 upfn = upstream | 19 upfn = upstream |
| 19 cur = current_branch() | 20 cur = current_branch() |
| 20 if cur == 'HEAD': | 21 if cur == 'HEAD': |
| (...skipping 18 matching lines...) Expand all Loading... |
| 39 r = raw_input("Selection (0-%d)[0]: " % high).strip() or '0' | 40 r = raw_input("Selection (0-%d)[0]: " % high).strip() or '0' |
| 40 if not r.isdigit() or (0 > int(r) > high): | 41 if not r.isdigit() or (0 > int(r) > high): |
| 41 print "Invalid choice." | 42 print "Invalid choice." |
| 42 else: | 43 else: |
| 43 run('checkout', downstreams[int(r)]) | 44 run('checkout', downstreams[int(r)]) |
| 44 break | 45 break |
| 45 | 46 |
| 46 | 47 |
| 47 if __name__ == '__main__': | 48 if __name__ == '__main__': |
| 48 sys.exit(main(sys.argv)) | 49 sys.exit(main(sys.argv)) |
| OLD | NEW |