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

Unified Diff: apply_issue.py

Issue 7054057: Add support for empty files, __init__.py is a common example. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 9 years, 7 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 | « no previous file | checkout.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: apply_issue.py
diff --git a/apply_issue.py b/apply_issue.py
index 72b5298c18a9fbe4a4833f1d4969d0607ba56bce..69faf8dc2513774903f8ce9774e1a11eb1d1b6e7 100755
--- a/apply_issue.py
+++ b/apply_issue.py
@@ -22,7 +22,8 @@ import scm
def main():
parser = optparse.OptionParser(description=sys.modules[__name__].__doc__)
parser.add_option(
- '-v', '--verbose', action='count', help='Prints debugging infos')
+ '-v', '--verbose', action='count', default=0,
+ help='Prints debugging infos')
parser.add_option(
'-i', '--issue', type='int', help='Rietveld issue number')
parser.add_option(
@@ -38,13 +39,10 @@ def main():
default='http://codereview.chromium.org',
help='Rietveld server')
options, args = parser.parse_args()
- LOG_FORMAT = '%(levelname)s %(filename)s(%(lineno)d): %(message)s'
- if not options.verbose:
- logging.basicConfig(level=logging.WARNING, format=LOG_FORMAT)
- elif options.verbose == 1:
- logging.basicConfig(level=logging.INFO, format=LOG_FORMAT)
- elif options.verbose > 1:
- logging.basicConfig(level=logging.DEBUG, format=LOG_FORMAT)
+ logging.basicConfig(
+ format='%(levelname)s %(filename)s(%(lineno)d): %(message)s',
+ level=[logging.WARNING, logging.INFO, logging.DEBUG][
+ min(2, options.verbose)])
if args:
parser.error('Extra argument(s) "%s" not understood' % ' '.join(args))
if not options.issue:
« no previous file with comments | « no previous file | checkout.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698