Add gcl-reset option.

Review URL: http://codereview.chromium.org/647063

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@39457 0039d316-1c4b-4281-b951-d872f2087c98
experimental/szager/collated-output
davemoore@chromium.org 16 years ago
parent e08f491731
commit 793796dcc6

@ -125,6 +125,7 @@ Valid options:
--deps PLATFORM(S) : sync deps for the given platform(s), or 'all'
--verbose : output additional diagnostics
--head : update to latest revision, instead of last good revision
--reset : resets any local changes before updating (git only)
Examples:
gclient %(cmd)s
@ -1129,6 +1130,9 @@ def Main(argv):
help=("(update/sync only) sync deps for the "
"specified (comma-separated) platform(s); "
"'all' will sync all platforms"))
option_parser.add_option("", "--reset", action="store_true", default=False,
help=("(update/sync only) resets any local changes "
"before updating (git only)"))
option_parser.add_option("", "--spec", default=None,
help=("(config only) create a gclient file "
"containing the provided string"))

@ -231,7 +231,7 @@ class GitWrapper(SCMWrapper, scm.GIT):
self._Run(['remote', 'update'], redirect_stdout=False)
files = self._Run(['diff', new_base, '--name-only']).split()
file_list.extend([os.path.join(self.checkout_path, f) for f in files])
if options.force:
if options.force or options.reset:
self._Run(['reset', '--hard', merge_base], redirect_stdout=False)
try:
self._Run(['rebase', '-v', '--onto', new_base, merge_base, cur_branch],

Loading…
Cancel
Save