| 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='delete any dependency that have been removed from ' | 1303 help='Deletes from the working copy any dependencies that ' |
| 1304 'last sync as long as there is no local modification. ' | 1304 'have been removed since the last sync, as long as ' |
| 1305 'Coupled with --force, it will remove them even with ' | 1305 'there are no local modifications. When used with ' |
| 1306 'local modifications') | 1306 '--force, such dependencies are removed even if they ' |
| 1307 'have local modifications. When used with --reset, ' |
| 1308 'all untracked directories are removed from the ' |
| 1309 'working copy, exclusing those which are explicitly ' |
| 1310 'ignored in the repository.') |
| 1307 parser.add_option('-R', '--reset', action='store_true', | 1311 parser.add_option('-R', '--reset', action='store_true', |
| 1308 help='resets any local changes before updating (git only)') | 1312 help='resets any local changes before updating (git only)') |
| 1309 parser.add_option('-M', '--merge', action='store_true', | 1313 parser.add_option('-M', '--merge', action='store_true', |
| 1310 help='merge upstream changes instead of trying to ' | 1314 help='merge upstream changes instead of trying to ' |
| 1311 'fast-forward or rebase') | 1315 'fast-forward or rebase') |
| 1312 parser.add_option('--deps', dest='deps_os', metavar='OS_LIST', | 1316 parser.add_option('--deps', dest='deps_os', metavar='OS_LIST', |
| 1313 help='override deps for the specified (comma-separated) ' | 1317 help='override deps for the specified (comma-separated) ' |
| 1314 'platform(s); \'all\' will process all deps_os ' | 1318 'platform(s); \'all\' will process all deps_os ' |
| 1315 'references') | 1319 'references') |
| 1316 parser.add_option('-m', '--manually_grab_svn_rev', action='store_true', | 1320 parser.add_option('-m', '--manually_grab_svn_rev', action='store_true', |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1361 that shows up in svn status.""" | 1365 that shows up in svn status.""" |
| 1362 parser.add_option('--deps', dest='deps_os', metavar='OS_LIST', | 1366 parser.add_option('--deps', dest='deps_os', metavar='OS_LIST', |
| 1363 help='override deps for the specified (comma-separated) ' | 1367 help='override deps for the specified (comma-separated) ' |
| 1364 'platform(s); \'all\' will process all deps_os ' | 1368 'platform(s); \'all\' will process all deps_os ' |
| 1365 'references') | 1369 'references') |
| 1366 parser.add_option('-n', '--nohooks', action='store_true', | 1370 parser.add_option('-n', '--nohooks', action='store_true', |
| 1367 help='don\'t run hooks after the revert is complete') | 1371 help='don\'t run hooks after the revert is complete') |
| 1368 (options, args) = parser.parse_args(args) | 1372 (options, args) = parser.parse_args(args) |
| 1369 # --force is implied. | 1373 # --force is implied. |
| 1370 options.force = True | 1374 options.force = True |
| 1375 options.reset = False |
| 1376 options.delete_unversioned_trees = False |
| 1371 client = GClient.LoadCurrentConfig(options) | 1377 client = GClient.LoadCurrentConfig(options) |
| 1372 if not client: | 1378 if not client: |
| 1373 raise gclient_utils.Error('client not configured; see \'gclient config\'') | 1379 raise gclient_utils.Error('client not configured; see \'gclient config\'') |
| 1374 return client.RunOnDeps('revert', args) | 1380 return client.RunOnDeps('revert', args) |
| 1375 | 1381 |
| 1376 | 1382 |
| 1377 def CMDrunhooks(parser, args): | 1383 def CMDrunhooks(parser, args): |
| 1378 """Runs hooks for files that have been modified in the local working copy.""" | 1384 """Runs hooks for files that have been modified in the local working copy.""" |
| 1379 parser.add_option('--deps', dest='deps_os', metavar='OS_LIST', | 1385 parser.add_option('--deps', dest='deps_os', metavar='OS_LIST', |
| 1380 help='override deps for the specified (comma-separated) ' | 1386 help='override deps for the specified (comma-separated) ' |
| (...skipping 151 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 |