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

Side by Side Diff: gclient_scm.py

Issue 165443004: Make gclient reset use GetUsableRev. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Move test to its own suite Created 6 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 | tests/gclient_smoketest.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 # 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 import collections 7 import collections
8 import logging 8 import logging
9 import os 9 import os
10 import posixpath 10 import posixpath
(...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after
609 default_rev = "refs/heads/master" 609 default_rev = "refs/heads/master"
610 if options.upstream: 610 if options.upstream:
611 if self._GetCurrentBranch(): 611 if self._GetCurrentBranch():
612 upstream_branch = scm.GIT.GetUpstreamBranch(self.checkout_path) 612 upstream_branch = scm.GIT.GetUpstreamBranch(self.checkout_path)
613 default_rev = upstream_branch or default_rev 613 default_rev = upstream_branch or default_rev
614 _, deps_revision = gclient_utils.SplitUrlRevision(self.url) 614 _, deps_revision = gclient_utils.SplitUrlRevision(self.url)
615 if not deps_revision: 615 if not deps_revision:
616 deps_revision = default_rev 616 deps_revision = default_rev
617 if deps_revision.startswith('refs/heads/'): 617 if deps_revision.startswith('refs/heads/'):
618 deps_revision = deps_revision.replace('refs/heads/', self.remote + '/') 618 deps_revision = deps_revision.replace('refs/heads/', self.remote + '/')
619 deps_revision = self.GetUsableRev(deps_revision, options)
619 620
620 if file_list is not None: 621 if file_list is not None:
621 files = self._Capture(['diff', deps_revision, '--name-only']).split() 622 files = self._Capture(['diff', deps_revision, '--name-only']).split()
622 623
623 self._Run(['reset', '--hard', deps_revision], options) 624 self._Run(['reset', '--hard', deps_revision], options)
624 self._Run(['clean', '-f', '-d'], options) 625 self._Run(['clean', '-f', '-d'], options)
625 626
626 if file_list is not None: 627 if file_list is not None:
627 file_list.extend([os.path.join(self.checkout_path, f) for f in files]) 628 file_list.extend([os.path.join(self.checkout_path, f) for f in files])
628 629
(...skipping 914 matching lines...) Expand 10 before | Expand all | Expand 10 after
1543 new_command.append('--force') 1544 new_command.append('--force')
1544 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: 1545 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]:
1545 new_command.extend(('--accept', 'theirs-conflict')) 1546 new_command.extend(('--accept', 'theirs-conflict'))
1546 elif options.manually_grab_svn_rev: 1547 elif options.manually_grab_svn_rev:
1547 new_command.append('--force') 1548 new_command.append('--force')
1548 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: 1549 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]:
1549 new_command.extend(('--accept', 'postpone')) 1550 new_command.extend(('--accept', 'postpone'))
1550 elif command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: 1551 elif command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]:
1551 new_command.extend(('--accept', 'postpone')) 1552 new_command.extend(('--accept', 'postpone'))
1552 return new_command 1553 return new_command
OLDNEW
« no previous file with comments | « no previous file | tests/gclient_smoketest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698