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

Side by Side Diff: gclient_scm.py

Issue 1983963002: Revert "Gclient: Don't check if repository is clean if --force is passed in" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 4 years, 7 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Gclient-specific SCM-specific operations.""" 5 """Gclient-specific SCM-specific operations."""
6 6
7 from __future__ import print_function 7 from __future__ import print_function
8 8
9 import errno 9 import errno
10 import logging 10 import logging
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after
546 546
547 # This is a big hammer, debatable if it should even be here... 547 # This is a big hammer, debatable if it should even be here...
548 if options.force or options.reset: 548 if options.force or options.reset:
549 target = 'HEAD' 549 target = 'HEAD'
550 if options.upstream and upstream_branch: 550 if options.upstream and upstream_branch:
551 target = upstream_branch 551 target = upstream_branch
552 self._Run(['reset', '--hard', target], options) 552 self._Run(['reset', '--hard', target], options)
553 553
554 if current_type == 'detached': 554 if current_type == 'detached':
555 # case 0 555 # case 0
556 if not options.force: 556 self._CheckClean(rev_str)
557 # Don't do this check if nuclear option is on.
558 self._CheckClean(rev_str)
559 self._CheckDetachedHead(rev_str, options) 557 self._CheckDetachedHead(rev_str, options)
560 if self._Capture(['rev-list', '-n', '1', 'HEAD']) == revision: 558 if self._Capture(['rev-list', '-n', '1', 'HEAD']) == revision:
561 self.Print('Up-to-date; skipping checkout.') 559 self.Print('Up-to-date; skipping checkout.')
562 else: 560 else:
563 # 'git checkout' may need to overwrite existing untracked files. Allow 561 # 'git checkout' may need to overwrite existing untracked files. Allow
564 # it only when nuclear options are enabled. 562 # it only when nuclear options are enabled.
565 self._Checkout( 563 self._Checkout(
566 options, 564 options,
567 revision, 565 revision,
568 force=(options.force or options.delete_unversioned_trees), 566 force=(options.force and options.delete_unversioned_trees),
569 quiet=True, 567 quiet=True,
570 ) 568 )
571 if not printed_path: 569 if not printed_path:
572 self.Print('_____ %s%s' % (self.relpath, rev_str), timestamp=False) 570 self.Print('_____ %s%s' % (self.relpath, rev_str), timestamp=False)
573 elif current_type == 'hash': 571 elif current_type == 'hash':
574 # case 1 572 # case 1
575 if scm.GIT.IsGitSvn(self.checkout_path) and upstream_branch is not None: 573 if scm.GIT.IsGitSvn(self.checkout_path) and upstream_branch is not None:
576 # Our git-svn branch (upstream_branch) is our upstream 574 # Our git-svn branch (upstream_branch) is our upstream
577 self._AttemptRebase(upstream_branch, files, options, 575 self._AttemptRebase(upstream_branch, files, options,
578 newbase=revision, printed_path=printed_path, 576 newbase=revision, printed_path=printed_path,
(...skipping 1136 matching lines...) Expand 10 before | Expand all | Expand 10 after
1715 new_command.append('--force') 1713 new_command.append('--force')
1716 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: 1714 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]:
1717 new_command.extend(('--accept', 'theirs-conflict')) 1715 new_command.extend(('--accept', 'theirs-conflict'))
1718 elif options.manually_grab_svn_rev: 1716 elif options.manually_grab_svn_rev:
1719 new_command.append('--force') 1717 new_command.append('--force')
1720 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: 1718 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]:
1721 new_command.extend(('--accept', 'postpone')) 1719 new_command.extend(('--accept', 'postpone'))
1722 elif command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: 1720 elif command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]:
1723 new_command.extend(('--accept', 'postpone')) 1721 new_command.extend(('--accept', 'postpone'))
1724 return new_command 1722 return new_command
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698