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

Side by Side Diff: gclient.py

Issue 9348054: If --force is specified when updating, remove unversioned directories (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools/
Patch Set: '' Created 8 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | gclient_scm.py » ('j') | gclient_scm.py » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 are '
1285 'not tracked, excluding those which are explicitly '
1286 'ignored in the repository.')
1284 parser.add_option('-n', '--nohooks', action='store_true', 1287 parser.add_option('-n', '--nohooks', action='store_true',
1285 help='don\'t run hooks after the update is complete') 1288 help='don\'t run hooks after the update is complete')
1286 parser.add_option('-r', '--revision', action='append', 1289 parser.add_option('-r', '--revision', action='append',
1287 dest='revisions', metavar='REV', default=[], 1290 dest='revisions', metavar='REV', default=[],
1288 help='Enforces revision/hash for the solutions with the ' 1291 help='Enforces revision/hash for the solutions with the '
1289 'format src@rev. The src@ part is optional and can be ' 1292 'format src@rev. The src@ part is optional and can be '
1290 'skipped. -r can be used multiple times when .gclient ' 1293 'skipped. -r can be used multiple times when .gclient '
1291 'has multiple solutions configured and will work even ' 1294 'has multiple solutions configured and will work even '
1292 'if the src@ part is skipped. Note that specifying ' 1295 'if the src@ part is skipped. Note that specifying '
1293 '--revision means your safesync_url gets ignored.') 1296 '--revision means your safesync_url gets ignored.')
1294 parser.add_option('-t', '--transitive', action='store_true', 1297 parser.add_option('-t', '--transitive', action='store_true',
1295 help='When a revision is specified (in the DEPS file or ' 1298 help='When a revision is specified (in the DEPS file or '
1296 'with the command-line flag), transitively update ' 1299 'with the command-line flag), transitively update '
1297 'the dependencies to the date of the given revision. ' 1300 'the dependencies to the date of the given revision. '
1298 'Only supported for SVN repositories.') 1301 'Only supported for SVN repositories.')
1299 parser.add_option('-H', '--head', action='store_true', 1302 parser.add_option('-H', '--head', action='store_true',
1300 help='skips any safesync_urls specified in ' 1303 help='skips any safesync_urls specified in '
1301 'configured solutions and sync to head instead') 1304 'configured solutions and sync to head instead')
1302 parser.add_option('-D', '--delete_unversioned_trees', action='store_true', 1305 parser.add_option('-D', '--delete_unversioned_trees', action='store_true',
1303 help='delete any dependency that have been removed from ' 1306 help='Deletes from the working copy any dependencies that '
1304 'last sync as long as there is no local modification. ' 1307 'have been removed since the last sync, as long as '
1305 'Coupled with --force, it will remove them even with ' 1308 'there are no local modifications. When used with '
1306 'local modifications') 1309 '--force, such dependencies are removed even if they '
1310 'have local modifications.')
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 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
1532 except (gclient_utils.Error, subprocess2.CalledProcessError), e: 1536 except (gclient_utils.Error, subprocess2.CalledProcessError), e:
1533 print >> sys.stderr, 'Error: %s' % str(e) 1537 print >> sys.stderr, 'Error: %s' % str(e)
1534 return 1 1538 return 1
1535 1539
1536 1540
1537 if '__main__' == __name__: 1541 if '__main__' == __name__:
1538 fix_encoding.fix_encoding() 1542 fix_encoding.fix_encoding()
1539 sys.exit(Main(sys.argv[1:])) 1543 sys.exit(Main(sys.argv[1:]))
1540 1544
1541 # vim: ts=2:sw=2:tw=80:et: 1545 # vim: ts=2:sw=2:tw=80:et:
OLDNEW
« no previous file with comments | « no previous file | gclient_scm.py » ('j') | gclient_scm.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698