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

Unified Diff: git_nav_downstream.py

Issue 955993006: Handle KeyboardInterrupt consistently in python scripts (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: tweek test expectations Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: git_nav_downstream.py
diff --git a/git_nav_downstream.py b/git_nav_downstream.py
index ed3110bfb4496e39d7954aca7f785dc794a61dab..6ea085b431eaf69f179c38df4c598db8e55d8381 100755
--- a/git_nav_downstream.py
+++ b/git_nav_downstream.py
@@ -34,7 +34,8 @@ def main(args):
cur = hash_one(cur)
downstreams = [b for b in branches() if upfn(b) == cur]
if not downstreams:
- return "No downstream branches"
+ print "No downstream branches"
+ return 1
elif len(downstreams) == 1:
run('checkout', downstreams[0], stdout=sys.stdout, stderr=sys.stderr)
else:
@@ -55,10 +56,12 @@ def main(args):
run('checkout', downstreams[int(r)], stdout=sys.stdout,
stderr=sys.stderr)
break
+ return 0
if __name__ == '__main__':
try:
sys.exit(main(sys.argv[1:]))
except KeyboardInterrupt:
- pass
+ sys.stderr.write('interrupted\n')
+ sys.exit(1)
« clang_format.py ('K') | « 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