Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(124)

Side by Side Diff: git_nav_downstream.py

Issue 184253003: Add git-reup and friends (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@freeze_thaw
Patch Set: fix pylint Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « git_mark_merge_base.py ('k') | git_new_branch.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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))
OLDNEW
« no previous file with comments | « git_mark_merge_base.py ('k') | git_new_branch.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698