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

Side by Side Diff: gcl.py

Issue 378027: Error when creating a CL in a read-only checkout.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools/
Patch Set: '' Created 11 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 # Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 # 5 #
6 # Wrapper script around Rietveld's upload.py that groups files into 6 # Wrapper script around Rietveld's upload.py that groups files into
7 # changelists. 7 # changelists.
8 8
9 import getpass 9 import getpass
10 import os 10 import os
(...skipping 976 matching lines...) Expand 10 before | Expand all | Expand 10 after
987 change_info.description = change_info.description + '\n' 987 change_info.description = change_info.description + '\n'
988 if viewvc_url: 988 if viewvc_url:
989 change_info.description += "\nCommitted: " + viewvc_url + revision 989 change_info.description += "\nCommitted: " + viewvc_url + revision
990 change_info.CloseIssue() 990 change_info.CloseIssue()
991 os.chdir(previous_cwd) 991 os.chdir(previous_cwd)
992 992
993 993
994 def Change(change_info, args): 994 def Change(change_info, args):
995 """Creates/edits a changelist.""" 995 """Creates/edits a changelist."""
996 silent = FilterFlag(args, "--silent") 996 silent = FilterFlag(args, "--silent")
997
998 # Verify the user is running the change command from a read-write checkout.
999 svn_info = gclient_scm.CaptureSVNInfo('.')
1000 if not svn_info:
1001 ErrorExit("Current checkout is unversioned. Please retry with a versioned "
1002 "directory.")
1003 if (svn_info.get('URL', '').startswith('http:') and
1004 not FilterFlag(args, "--force")):
M-A Ruel 2009/11/09 18:51:41 alignment
1005 ErrorExit("This is a read-only checkout. Retry in a read-write checkout "
1006 "or use --force to override.")
1007
997 if (len(args) == 1): 1008 if (len(args) == 1):
998 filename = args[0] 1009 filename = args[0]
999 f = open(filename, 'rU') 1010 f = open(filename, 'rU')
1000 override_description = f.read() 1011 override_description = f.read()
1001 f.close() 1012 f.close()
1002 else: 1013 else:
1003 override_description = None 1014 override_description = None
1004 1015
1005 if change_info.issue: 1016 if change_info.issue:
1006 try: 1017 try:
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
1274 # the files. This allows commands such as 'gcl diff xxx' to work. 1285 # the files. This allows commands such as 'gcl diff xxx' to work.
1275 args =["svn", command] 1286 args =["svn", command]
1276 root = GetRepositoryRoot() 1287 root = GetRepositoryRoot()
1277 args.extend([os.path.join(root, x) for x in change_info.GetFileNames()]) 1288 args.extend([os.path.join(root, x) for x in change_info.GetFileNames()])
1278 RunShell(args, True) 1289 RunShell(args, True)
1279 return 0 1290 return 0
1280 1291
1281 1292
1282 if __name__ == "__main__": 1293 if __name__ == "__main__":
1283 sys.exit(main()) 1294 sys.exit(main())
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698