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

Side by Side Diff: gclient.py

Issue 18006002: Add --upstream option to gclient to scrape git checkouts back to upstream state. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: upstream not nuclear Created 7 years, 5 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') | 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/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 1523 matching lines...) Expand 10 before | Expand all | Expand 10 after
1534 parser.add_option('-M', '--merge', action='store_true', 1534 parser.add_option('-M', '--merge', action='store_true',
1535 help='merge upstream changes instead of trying to ' 1535 help='merge upstream changes instead of trying to '
1536 'fast-forward or rebase') 1536 'fast-forward or rebase')
1537 parser.add_option('--deps', dest='deps_os', metavar='OS_LIST', 1537 parser.add_option('--deps', dest='deps_os', metavar='OS_LIST',
1538 help='override deps for the specified (comma-separated) ' 1538 help='override deps for the specified (comma-separated) '
1539 'platform(s); \'all\' will process all deps_os ' 1539 'platform(s); \'all\' will process all deps_os '
1540 'references') 1540 'references')
1541 parser.add_option('-m', '--manually_grab_svn_rev', action='store_true', 1541 parser.add_option('-m', '--manually_grab_svn_rev', action='store_true',
1542 help='Skip svn up whenever possible by requesting ' 1542 help='Skip svn up whenever possible by requesting '
1543 'actual HEAD revision from the repository') 1543 'actual HEAD revision from the repository')
1544 parser.add_option('--upstream', action='store_true',
1545 help='Make repo state match upstream branch.')
1544 (options, args) = parser.parse_args(args) 1546 (options, args) = parser.parse_args(args)
1545 client = GClient.LoadCurrentConfig(options) 1547 client = GClient.LoadCurrentConfig(options)
1546 1548
1547 if not client: 1549 if not client:
1548 raise gclient_utils.Error('client not configured; see \'gclient config\'') 1550 raise gclient_utils.Error('client not configured; see \'gclient config\'')
1549 1551
1550 if options.revisions and options.head: 1552 if options.revisions and options.head:
1551 # TODO(maruel): Make it a parser.error if it doesn't break any builder. 1553 # TODO(maruel): Make it a parser.error if it doesn't break any builder.
1552 print('Warning: you cannot use both --head and --revision') 1554 print('Warning: you cannot use both --head and --revision')
1553 1555
(...skipping 29 matching lines...) Expand all
1583 """Revert all modifications in every dependencies. 1585 """Revert all modifications in every dependencies.
1584 1586
1585 That's the nuclear option to get back to a 'clean' state. It removes anything 1587 That's the nuclear option to get back to a 'clean' state. It removes anything
1586 that shows up in svn status.""" 1588 that shows up in svn status."""
1587 parser.add_option('--deps', dest='deps_os', metavar='OS_LIST', 1589 parser.add_option('--deps', dest='deps_os', metavar='OS_LIST',
1588 help='override deps for the specified (comma-separated) ' 1590 help='override deps for the specified (comma-separated) '
1589 'platform(s); \'all\' will process all deps_os ' 1591 'platform(s); \'all\' will process all deps_os '
1590 'references') 1592 'references')
1591 parser.add_option('-n', '--nohooks', action='store_true', 1593 parser.add_option('-n', '--nohooks', action='store_true',
1592 help='don\'t run hooks after the revert is complete') 1594 help='don\'t run hooks after the revert is complete')
1595 parser.add_option('--upstream', action='store_true',
1596 help='Make repo state match upstream branch.')
1593 (options, args) = parser.parse_args(args) 1597 (options, args) = parser.parse_args(args)
1594 # --force is implied. 1598 # --force is implied.
1595 options.force = True 1599 options.force = True
1596 options.reset = False 1600 options.reset = False
1597 options.delete_unversioned_trees = False 1601 options.delete_unversioned_trees = False
1598 client = GClient.LoadCurrentConfig(options) 1602 client = GClient.LoadCurrentConfig(options)
1599 if not client: 1603 if not client:
1600 raise gclient_utils.Error('client not configured; see \'gclient config\'') 1604 raise gclient_utils.Error('client not configured; see \'gclient config\'')
1601 return client.RunOnDeps('revert', args) 1605 return client.RunOnDeps('revert', args)
1602 1606
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
1803 except (gclient_utils.Error, subprocess2.CalledProcessError), e: 1807 except (gclient_utils.Error, subprocess2.CalledProcessError), e:
1804 print >> sys.stderr, 'Error: %s' % str(e) 1808 print >> sys.stderr, 'Error: %s' % str(e)
1805 return 1 1809 return 1
1806 1810
1807 1811
1808 if '__main__' == __name__: 1812 if '__main__' == __name__:
1809 fix_encoding.fix_encoding() 1813 fix_encoding.fix_encoding()
1810 sys.exit(Main(sys.argv[1:])) 1814 sys.exit(Main(sys.argv[1:]))
1811 1815
1812 # vim: ts=2:sw=2:tw=80:et: 1816 # vim: ts=2:sw=2:tw=80:et:
OLDNEW
« no previous file with comments | « no previous file | gclient_scm.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698