OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2011 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 1321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1332 os.rename(src_file, dst_file) | 1332 os.rename(src_file, dst_file) |
1333 print "Change '%s' renamed '%s'." % (src, dst) | 1333 print "Change '%s' renamed '%s'." % (src, dst) |
1334 return 0 | 1334 return 0 |
1335 | 1335 |
1336 | 1336 |
1337 def CMDpassthru(args): | 1337 def CMDpassthru(args): |
1338 """Everything else that is passed into gcl we redirect to svn. | 1338 """Everything else that is passed into gcl we redirect to svn. |
1339 | 1339 |
1340 It assumes a change list name is passed and is converted with the files names. | 1340 It assumes a change list name is passed and is converted with the files names. |
1341 """ | 1341 """ |
| 1342 cl_name = args[1] |
1342 args = ["svn", args[0]] | 1343 args = ["svn", args[0]] |
1343 if len(args) > 1: | 1344 if len(args) > 1: |
1344 root = GetRepositoryRoot() | 1345 root = GetRepositoryRoot() |
1345 change_info = ChangeInfo.Load(args[1], root, True, True) | 1346 change_info = ChangeInfo.Load(cl_name, root, True, True) |
1346 args.extend([os.path.join(root, x) for x in change_info.GetFileNames()]) | 1347 args.extend([os.path.join(root, x) for x in change_info.GetFileNames()]) |
1347 return RunShellWithReturnCode(args, print_output=True)[1] | 1348 return RunShellWithReturnCode(args, print_output=True)[1] |
1348 | 1349 |
1349 | 1350 |
1350 def Command(name): | 1351 def Command(name): |
1351 return getattr(sys.modules[__name__], 'CMD' + name, None) | 1352 return getattr(sys.modules[__name__], 'CMD' + name, None) |
1352 | 1353 |
1353 | 1354 |
1354 def GenUsage(command): | 1355 def GenUsage(command): |
1355 """Modify an OptParse object with the function's documentation.""" | 1356 """Modify an OptParse object with the function's documentation.""" |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1434 raise | 1435 raise |
1435 print >> sys.stderr, ( | 1436 print >> sys.stderr, ( |
1436 'AppEngine is misbehaving and returned HTTP %d, again. Keep faith ' | 1437 'AppEngine is misbehaving and returned HTTP %d, again. Keep faith ' |
1437 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e)) | 1438 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e)) |
1438 return 1 | 1439 return 1 |
1439 | 1440 |
1440 | 1441 |
1441 if __name__ == "__main__": | 1442 if __name__ == "__main__": |
1442 fix_encoding.fix_encoding() | 1443 fix_encoding.fix_encoding() |
1443 sys.exit(main(sys.argv[1:])) | 1444 sys.exit(main(sys.argv[1:])) |
OLD | NEW |