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

Unified Diff: git_auto_svn.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
« clang_format.py ('K') | « gclient.py ('k') | git_cache.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: git_auto_svn.py
diff --git a/git_auto_svn.py b/git_auto_svn.py
index 8aed18f6d6eb876b616ba6e235f5efdbfc6f58f8..0e8f341c7ca616c50cd7e3a75a1f0b3af0981640 100755
--- a/git_auto_svn.py
+++ b/git_auto_svn.py
@@ -55,7 +55,7 @@ def main(argv):
# to pass flags that don't do anything, and to provide 'usage'.
parser = argparse.ArgumentParser(
description='Automatically set up git-svn for a repo mirrored from svn.')
- parser.parse_args(argv[1:])
+ parser.parse_args(argv)
upstream = root()
message = run_git('log', '-1', '--format=%B', upstream)
@@ -95,7 +95,12 @@ def main(argv):
print 'Configured metadata, running "git svn fetch". This may take some time.'
for line in run_git_stream('svn', 'fetch').xreadlines():
print line.strip()
+ return 0
if __name__ == '__main__':
- sys.exit(main(sys.argv))
+ try:
+ sys.exit(main(sys.argv[1:]))
+ except KeyboardInterrupt:
+ sys.stderr.write('interrupted\n')
+ sys.exit(1)
« clang_format.py ('K') | « gclient.py ('k') | git_cache.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698