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

Unified Diff: gcl.py

Issue 294005: gcl: Make fix the override_description code and add a silent flag.... (Closed) Base URL: svn://chrome-svn.corp.google.com/chrome/trunk/tools/depot_tools/
Patch Set: '' Created 11 years, 2 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 | « drover.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gcl.py
===================================================================
--- gcl.py (revision 29200)
+++ gcl.py (working copy)
@@ -976,8 +976,17 @@
os.chdir(previous_cwd)
-def Change(change_info, override_description):
+def Change(change_info, args):
"""Creates/edits a changelist."""
+ silent = FilterFlag(args, "--silent")
+ if (len(args) == 1):
+ filename = args[0]
+ f = open(filename, 'rU')
+ override_description = f.read()
+ f.close()
+ else:
+ override_description = None
+
if change_info.issue:
try:
description = GetIssueDescription(change_info.issue)
@@ -1022,7 +1031,8 @@
os.write(handle, text)
os.close(handle)
- os.system(GetEditor() + " " + filename)
+ if not silent:
+ os.system(GetEditor() + " " + filename)
result = ReadFile(filename)
os.remove(filename)
@@ -1216,14 +1226,7 @@
fail_on_not_found, True)
if command == "change":
- if (len(argv) == 4):
- filename = argv[3]
- f = open(filename, 'rU')
- override_description = f.read()
- f.close()
- else:
- override_description = None
- Change(change_info, override_description)
+ Change(change_info, argv[3:])
elif command == "lint":
Lint(change_info, argv[3:])
elif command == "upload":
« no previous file with comments | « drover.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698