OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |