Commit d36b3ed7 authored by chase@chromium.org's avatar chase@chromium.org

Error when creating a CL in a read-only checkout.

BUG=25824
TEST=running 'gcl change foo' in a read-only checkout
shows an error, --force creates a CL anyway, and gcl
change in read-write checkouts continues to work.
Review URL: http://codereview.chromium.org/378027

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@31452 0039d316-1c4b-4281-b951-d872f2087c98
parent 7780c28b
......@@ -994,6 +994,17 @@ def Commit(change_info, args):
def Change(change_info, args):
"""Creates/edits a changelist."""
silent = FilterFlag(args, "--silent")
# Verify the user is running the change command from a read-write checkout.
svn_info = gclient_scm.CaptureSVNInfo('.')
if not svn_info:
ErrorExit("Current checkout is unversioned. Please retry with a versioned "
"directory.")
if (svn_info.get('URL', '').startswith('http:') and
not FilterFlag(args, "--force")):
ErrorExit("This is a read-only checkout. Retry in a read-write checkout "
"or use --force to override.")
if (len(args) == 1):
filename = args[0]
f = open(filename, 'rU')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment