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

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: 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
« no previous file with comments | « gclient.py ('k') | git_cache.py » ('j') | git_number.py » ('J')
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..924bc34dd149db7fd8bad72728278179da91a61e 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:
+ print 'interrupted'
+ sys.exit(1)
« no previous file with comments | « gclient.py ('k') | git_cache.py » ('j') | git_number.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698