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 1282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1293 '--revision means your safesync_url gets ignored.') | 1293 '--revision means your safesync_url gets ignored.') |
1294 parser.add_option('-t', '--transitive', action='store_true', | 1294 parser.add_option('-t', '--transitive', action='store_true', |
1295 help='When a revision is specified (in the DEPS file or ' | 1295 help='When a revision is specified (in the DEPS file or ' |
1296 'with the command-line flag), transitively update ' | 1296 'with the command-line flag), transitively update ' |
1297 'the dependencies to the date of the given revision. ' | 1297 'the dependencies to the date of the given revision. ' |
1298 'Only supported for SVN repositories.') | 1298 'Only supported for SVN repositories.') |
1299 parser.add_option('-H', '--head', action='store_true', | 1299 parser.add_option('-H', '--head', action='store_true', |
1300 help='skips any safesync_urls specified in ' | 1300 help='skips any safesync_urls specified in ' |
1301 'configured solutions and sync to head instead') | 1301 'configured solutions and sync to head instead') |
1302 parser.add_option('-D', '--delete_unversioned_trees', action='store_true', | 1302 parser.add_option('-D', '--delete_unversioned_trees', action='store_true', |
1303 help='Deletes from the working copy any dependencies that ' | 1303 help='delete any dependency that have been removed from ' |
1304 'have been removed since the last sync, as long as ' | 1304 'last sync as long as there is no local modification. ' |
1305 'there are no local modifications. When used with ' | 1305 'Coupled with --force, it will remove them even with ' |
1306 '--force, such dependencies are removed even if they ' | 1306 'local modifications') |
1307 'have local modifications. In addition, when used ' | |
1308 'with --force, all untracked directories are removed ' | |
1309 'from the working copy, exclusing those which are ' | |
1310 'explicitly ignored in the repository.') | |
1311 parser.add_option('-R', '--reset', action='store_true', | 1307 parser.add_option('-R', '--reset', action='store_true', |
1312 help='resets any local changes before updating (git only)') | 1308 help='resets any local changes before updating (git only)') |
1313 parser.add_option('-M', '--merge', action='store_true', | 1309 parser.add_option('-M', '--merge', action='store_true', |
1314 help='merge upstream changes instead of trying to ' | 1310 help='merge upstream changes instead of trying to ' |
1315 'fast-forward or rebase') | 1311 'fast-forward or rebase') |
1316 parser.add_option('--deps', dest='deps_os', metavar='OS_LIST', | 1312 parser.add_option('--deps', dest='deps_os', metavar='OS_LIST', |
1317 help='override deps for the specified (comma-separated) ' | 1313 help='override deps for the specified (comma-separated) ' |
1318 'platform(s); \'all\' will process all deps_os ' | 1314 'platform(s); \'all\' will process all deps_os ' |
1319 'references') | 1315 'references') |
1320 parser.add_option('-m', '--manually_grab_svn_rev', action='store_true', | 1316 parser.add_option('-m', '--manually_grab_svn_rev', action='store_true', |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1365 that shows up in svn status.""" | 1361 that shows up in svn status.""" |
1366 parser.add_option('--deps', dest='deps_os', metavar='OS_LIST', | 1362 parser.add_option('--deps', dest='deps_os', metavar='OS_LIST', |
1367 help='override deps for the specified (comma-separated) ' | 1363 help='override deps for the specified (comma-separated) ' |
1368 'platform(s); \'all\' will process all deps_os ' | 1364 'platform(s); \'all\' will process all deps_os ' |
1369 'references') | 1365 'references') |
1370 parser.add_option('-n', '--nohooks', action='store_true', | 1366 parser.add_option('-n', '--nohooks', action='store_true', |
1371 help='don\'t run hooks after the revert is complete') | 1367 help='don\'t run hooks after the revert is complete') |
1372 (options, args) = parser.parse_args(args) | 1368 (options, args) = parser.parse_args(args) |
1373 # --force is implied. | 1369 # --force is implied. |
1374 options.force = True | 1370 options.force = True |
1375 options.delete_unversioned_trees = False | |
1376 client = GClient.LoadCurrentConfig(options) | 1371 client = GClient.LoadCurrentConfig(options) |
1377 if not client: | 1372 if not client: |
1378 raise gclient_utils.Error('client not configured; see \'gclient config\'') | 1373 raise gclient_utils.Error('client not configured; see \'gclient config\'') |
1379 return client.RunOnDeps('revert', args) | 1374 return client.RunOnDeps('revert', args) |
1380 | 1375 |
1381 | 1376 |
1382 def CMDrunhooks(parser, args): | 1377 def CMDrunhooks(parser, args): |
1383 """Runs hooks for files that have been modified in the local working copy.""" | 1378 """Runs hooks for files that have been modified in the local working copy.""" |
1384 parser.add_option('--deps', dest='deps_os', metavar='OS_LIST', | 1379 parser.add_option('--deps', dest='deps_os', metavar='OS_LIST', |
1385 help='override deps for the specified (comma-separated) ' | 1380 help='override deps for the specified (comma-separated) ' |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1537 except (gclient_utils.Error, subprocess2.CalledProcessError), e: | 1532 except (gclient_utils.Error, subprocess2.CalledProcessError), e: |
1538 print >> sys.stderr, 'Error: %s' % str(e) | 1533 print >> sys.stderr, 'Error: %s' % str(e) |
1539 return 1 | 1534 return 1 |
1540 | 1535 |
1541 | 1536 |
1542 if '__main__' == __name__: | 1537 if '__main__' == __name__: |
1543 fix_encoding.fix_encoding() | 1538 fix_encoding.fix_encoding() |
1544 sys.exit(Main(sys.argv[1:])) | 1539 sys.exit(Main(sys.argv[1:])) |
1545 | 1540 |
1546 # vim: ts=2:sw=2:tw=80:et: | 1541 # vim: ts=2:sw=2:tw=80:et: |
OLD | NEW |