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

Side by Side Diff: gclient.py

Issue 118160: Fix gclient config with a trailing backslash. (Closed)
Patch Set: Created 11 years, 6 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 # 2 #
3 # Copyright 2008 Google Inc. All Rights Reserved. 3 # Copyright 2008 Google Inc. All Rights Reserved.
4 # 4 #
5 # Licensed under the Apache License, Version 2.0 (the "License"); 5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License. 6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at 7 # You may obtain a copy of the License at
8 # 8 #
9 # http://www.apache.org/licenses/LICENSE-2.0 9 # http://www.apache.org/licenses/LICENSE-2.0
10 # 10 #
(...skipping 1496 matching lines...) Expand 10 before | Expand all | Expand 10 after
1507 raise Error("required argument missing; see 'gclient help config'") 1507 raise Error("required argument missing; see 'gclient help config'")
1508 if os.path.exists(options.config_filename): 1508 if os.path.exists(options.config_filename):
1509 raise Error("%s file already exists in the current directory" % 1509 raise Error("%s file already exists in the current directory" %
1510 options.config_filename) 1510 options.config_filename)
1511 client = GClient('.', options) 1511 client = GClient('.', options)
1512 if options.spec: 1512 if options.spec:
1513 client.SetConfig(options.spec) 1513 client.SetConfig(options.spec)
1514 else: 1514 else:
1515 # TODO(darin): it would be nice to be able to specify an alternate relpath 1515 # TODO(darin): it would be nice to be able to specify an alternate relpath
1516 # for the given URL. 1516 # for the given URL.
1517 base_url = args[0] 1517 base_url = args[0].rstrip('/')
1518 name = args[0].split("/")[-1] 1518 name = base_url.split("/")[-1]
1519 safesync_url = "" 1519 safesync_url = ""
1520 if len(args) > 1: 1520 if len(args) > 1:
1521 safesync_url = args[1] 1521 safesync_url = args[1]
1522 client.SetDefaultConfig(name, base_url, safesync_url) 1522 client.SetDefaultConfig(name, base_url, safesync_url)
1523 client.SaveConfig() 1523 client.SaveConfig()
1524 1524
1525 1525
1526 def DoHelp(options, args): 1526 def DoHelp(options, args):
1527 """Handle the help subcommand giving help for another subcommand. 1527 """Handle the help subcommand giving help for another subcommand.
1528 1528
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
1736 1736
1737 if "__main__" == __name__: 1737 if "__main__" == __name__:
1738 try: 1738 try:
1739 result = Main(sys.argv) 1739 result = Main(sys.argv)
1740 except Error, e: 1740 except Error, e:
1741 print >> sys.stderr, "Error: %s" % str(e) 1741 print >> sys.stderr, "Error: %s" % str(e)
1742 result = 1 1742 result = 1
1743 sys.exit(result) 1743 sys.exit(result)
1744 1744
1745 # vim: ts=2:sw=2:tw=80:et: 1745 # vim: ts=2:sw=2:tw=80:et:
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