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

Side by Side Diff: gcl.py

Issue 3332017: Add a check when people specify wrong change list name to give a meaningful message. (Closed)
Patch Set: oops Created 10 years, 3 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 unified diff | Download patch
« 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 """\ 6 """\
7 Wrapper script around Rietveld's upload.py that simplifies working with groups 7 Wrapper script around Rietveld's upload.py that simplifies working with groups
8 of files. 8 of files.
9 """ 9 """
10 10
(...skipping 941 matching lines...) Expand 10 before | Expand all | Expand 10 after
952 change_info = ChangeInfo.Load(changename, GetRepositoryRoot(), False, True) 952 change_info = ChangeInfo.Load(changename, GetRepositoryRoot(), False, True)
953 silent = FilterFlag(args, "--silent") 953 silent = FilterFlag(args, "--silent")
954 954
955 # Verify the user is running the change command from a read-write checkout. 955 # Verify the user is running the change command from a read-write checkout.
956 svn_info = SVN.CaptureInfo('.') 956 svn_info = SVN.CaptureInfo('.')
957 if not svn_info: 957 if not svn_info:
958 ErrorExit("Current checkout is unversioned. Please retry with a versioned " 958 ErrorExit("Current checkout is unversioned. Please retry with a versioned "
959 "directory.") 959 "directory.")
960 960
961 if len(args) == 2: 961 if len(args) == 2:
962 if not os.path.isfile(args[1]):
963 ErrorExit('The change "%s" doesn\'t exist.' % args[1])
962 f = open(args[1], 'rU') 964 f = open(args[1], 'rU')
963 override_description = f.read() 965 override_description = f.read()
964 f.close() 966 f.close()
965 else: 967 else:
966 override_description = None 968 override_description = None
967 969
968 if change_info.issue and not change_info.NeedsUpload(): 970 if change_info.issue and not change_info.NeedsUpload():
969 try: 971 try:
970 description = GetIssueDescription(change_info.issue) 972 description = GetIssueDescription(change_info.issue)
971 except urllib2.HTTPError, err: 973 except urllib2.HTTPError, err:
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
1322 if command: 1324 if command:
1323 return command(argv[1:]) 1325 return command(argv[1:])
1324 # Unknown command, try to pass that to svn 1326 # Unknown command, try to pass that to svn
1325 return CMDpassthru(argv) 1327 return CMDpassthru(argv)
1326 except gclient_utils.Error, e: 1328 except gclient_utils.Error, e:
1327 print('Got an exception') 1329 print('Got an exception')
1328 print(str(e)) 1330 print(str(e))
1329 1331
1330 if __name__ == "__main__": 1332 if __name__ == "__main__":
1331 sys.exit(main(sys.argv[1:])) 1333 sys.exit(main(sys.argv[1:]))
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