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

Unified Diff: gcl.py

Issue 1619005: Allow the existence of ~/.gcl_upload_no_try override the default of try on up... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools/
Patch Set: '' Created 10 years, 8 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 | tests/gcl_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gcl.py
===================================================================
--- gcl.py (revision 43825)
+++ gcl.py (working copy)
@@ -58,6 +58,20 @@
# Global cache of files cached in GetCacheDir().
FILES_CACHE = {}
+def CheckHomeForFile(filename):
+ """Checks the users home dir for the existence of the given file. Returns
+ the path to the file if it's there, or None if it is not.
+ """
+ home_vars = ['HOME']
+ if sys.platform in ('cygwin', 'win32'):
+ home_vars.append('USERPROFILE')
+ for home_var in home_vars:
+ home = os.getenv(home_var)
+ if home != None:
+ full_path = os.path.join(home, filename)
+ if os.path.exists(full_path):
+ return full_path
+ return None
def UnknownFiles(extra_args):
"""Runs svn status and returns unknown files.
@@ -624,6 +638,8 @@
[--send_mail] [--no_try] [--no_presubmit]
[--no_watchlists]
Uploads the changelist to the server for review.
+ (You can create the file '.gcl_upload_no_try' in your home dir to
+ skip the automatic tries.)
gcl commit change_name [--no_presubmit]
Commits the changelist to the repository.
@@ -706,7 +722,9 @@
return
if not OptionallyDoPresubmitChecks(change_info, False, args):
return
- no_try = FilterFlag(args, "--no_try") or FilterFlag(args, "--no-try")
+ no_try = FilterFlag(args, "--no_try") or \
+ FilterFlag(args, "--no-try") or \
+ not (CheckHomeForFile(".gcl_upload_no_try") is None)
no_watchlists = FilterFlag(args, "--no_watchlists") or \
FilterFlag(args, "--no-watchlists")
« no previous file with comments | « no previous file | tests/gcl_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698