OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 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 """Meta checkout manager supporting both Subversion and GIT. | 6 """Meta checkout manager supporting both Subversion and GIT. |
7 | 7 |
8 Files | 8 Files |
9 .gclient : Current client configuration, written by 'config' command. | 9 .gclient : Current client configuration, written by 'config' command. |
10 Format is a Python script defining 'solutions', a list whose | 10 Format is a Python script defining 'solutions', a list whose |
(...skipping 1262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1273 *for modules which have changed since last update or sync* | 1273 *for modules which have changed since last update or sync* |
1274 gclient sync --force | 1274 gclient sync --force |
1275 update files from SCM according to current configuration, for | 1275 update files from SCM according to current configuration, for |
1276 all modules (useful for recovering files deleted from local copy) | 1276 all modules (useful for recovering files deleted from local copy) |
1277 gclient sync --revision src@31000 | 1277 gclient sync --revision src@31000 |
1278 update src directory to r31000 | 1278 update src directory to r31000 |
1279 """) | 1279 """) |
1280 def CMDsync(parser, args): | 1280 def CMDsync(parser, args): |
1281 """Checkout/update all modules.""" | 1281 """Checkout/update all modules.""" |
1282 parser.add_option('-f', '--force', action='store_true', | 1282 parser.add_option('-f', '--force', action='store_true', |
1283 help='force update even for unchanged modules') | 1283 help='Forces update even for unchanged modules. Also ' |
| 1284 'removes from the working copy directories which have ' |
| 1285 'been removed from the repository in this update and ' |
| 1286 'hence are untracked. Directories are removed even if ' |
| 1287 'explicitly ignored, to allow dependencies to be ' |
| 1288 'installed in their place.') |
1284 parser.add_option('-n', '--nohooks', action='store_true', | 1289 parser.add_option('-n', '--nohooks', action='store_true', |
1285 help='don\'t run hooks after the update is complete') | 1290 help='don\'t run hooks after the update is complete') |
1286 parser.add_option('-r', '--revision', action='append', | 1291 parser.add_option('-r', '--revision', action='append', |
1287 dest='revisions', metavar='REV', default=[], | 1292 dest='revisions', metavar='REV', default=[], |
1288 help='Enforces revision/hash for the solutions with the ' | 1293 help='Enforces revision/hash for the solutions with the ' |
1289 'format src@rev. The src@ part is optional and can be ' | 1294 'format src@rev. The src@ part is optional and can be ' |
1290 'skipped. -r can be used multiple times when .gclient ' | 1295 'skipped. -r can be used multiple times when .gclient ' |
1291 'has multiple solutions configured and will work even ' | 1296 'has multiple solutions configured and will work even ' |
1292 'if the src@ part is skipped. Note that specifying ' | 1297 'if the src@ part is skipped. Note that specifying ' |
1293 '--revision means your safesync_url gets ignored.') | 1298 '--revision means your safesync_url gets ignored.') |
1294 parser.add_option('-t', '--transitive', action='store_true', | 1299 parser.add_option('-t', '--transitive', action='store_true', |
1295 help='When a revision is specified (in the DEPS file or ' | 1300 help='When a revision is specified (in the DEPS file or ' |
1296 'with the command-line flag), transitively update ' | 1301 'with the command-line flag), transitively update ' |
1297 'the dependencies to the date of the given revision. ' | 1302 'the dependencies to the date of the given revision. ' |
1298 'Only supported for SVN repositories.') | 1303 'Only supported for SVN repositories.') |
1299 parser.add_option('-H', '--head', action='store_true', | 1304 parser.add_option('-H', '--head', action='store_true', |
1300 help='skips any safesync_urls specified in ' | 1305 help='skips any safesync_urls specified in ' |
1301 'configured solutions and sync to head instead') | 1306 'configured solutions and sync to head instead') |
1302 parser.add_option('-D', '--delete_unversioned_trees', action='store_true', | 1307 parser.add_option('-D', '--delete_unversioned_trees', action='store_true', |
1303 help='delete any dependency that have been removed from ' | 1308 help='Deletes from the working copy any dependencies that ' |
1304 'last sync as long as there is no local modification. ' | 1309 'have been removed since the last sync, as long as ' |
1305 'Coupled with --force, it will remove them even with ' | 1310 'there are no local modifications. When used with ' |
1306 'local modifications') | 1311 '--force, such dependencies are removed even if they ' |
| 1312 'have local modifications.') |
1307 parser.add_option('-R', '--reset', action='store_true', | 1313 parser.add_option('-R', '--reset', action='store_true', |
1308 help='resets any local changes before updating (git only)') | 1314 help='resets any local changes before updating (git only)') |
1309 parser.add_option('-M', '--merge', action='store_true', | 1315 parser.add_option('-M', '--merge', action='store_true', |
1310 help='merge upstream changes instead of trying to ' | 1316 help='merge upstream changes instead of trying to ' |
1311 'fast-forward or rebase') | 1317 'fast-forward or rebase') |
1312 parser.add_option('--deps', dest='deps_os', metavar='OS_LIST', | 1318 parser.add_option('--deps', dest='deps_os', metavar='OS_LIST', |
1313 help='override deps for the specified (comma-separated) ' | 1319 help='override deps for the specified (comma-separated) ' |
1314 'platform(s); \'all\' will process all deps_os ' | 1320 'platform(s); \'all\' will process all deps_os ' |
1315 'references') | 1321 'references') |
1316 parser.add_option('-m', '--manually_grab_svn_rev', action='store_true', | 1322 parser.add_option('-m', '--manually_grab_svn_rev', action='store_true', |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1532 except (gclient_utils.Error, subprocess2.CalledProcessError), e: | 1538 except (gclient_utils.Error, subprocess2.CalledProcessError), e: |
1533 print >> sys.stderr, 'Error: %s' % str(e) | 1539 print >> sys.stderr, 'Error: %s' % str(e) |
1534 return 1 | 1540 return 1 |
1535 | 1541 |
1536 | 1542 |
1537 if '__main__' == __name__: | 1543 if '__main__' == __name__: |
1538 fix_encoding.fix_encoding() | 1544 fix_encoding.fix_encoding() |
1539 sys.exit(Main(sys.argv[1:])) | 1545 sys.exit(Main(sys.argv[1:])) |
1540 | 1546 |
1541 # vim: ts=2:sw=2:tw=80:et: | 1547 # vim: ts=2:sw=2:tw=80:et: |
OLD | NEW |