Chromium Code Reviews| 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 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 699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 710 default_rev = "refs/heads/master" | 710 default_rev = "refs/heads/master" |
| 711 if options.upstream: | 711 if options.upstream: |
| 712 if self._GetCurrentBranch(): | 712 if self._GetCurrentBranch(): |
| 713 upstream_branch = scm.GIT.GetUpstreamBranch(self.checkout_path) | 713 upstream_branch = scm.GIT.GetUpstreamBranch(self.checkout_path) |
| 714 default_rev = upstream_branch or default_rev | 714 default_rev = upstream_branch or default_rev |
| 715 _, deps_revision = gclient_utils.SplitUrlRevision(self.url) | 715 _, deps_revision = gclient_utils.SplitUrlRevision(self.url) |
| 716 if not deps_revision: | 716 if not deps_revision: |
| 717 deps_revision = default_rev | 717 deps_revision = default_rev |
| 718 if deps_revision.startswith('refs/heads/'): | 718 if deps_revision.startswith('refs/heads/'): |
| 719 deps_revision = deps_revision.replace('refs/heads/', self.remote + '/') | 719 deps_revision = deps_revision.replace('refs/heads/', self.remote + '/') |
| 720 deps_revision = self.GetUsableRev(deps_revision, options) | 720 try: |
| 721 deps_revision = self.GetUsableRev(deps_revision, options) | |
| 722 except gclient_utils.Error as e: | |
| 723 # If the DEPS entry's url and hash changed, try to update the origin. | |
| 724 # See also http://crbug.com/520067. | |
| 725 if 'safesync_url response "%s"' % deps_revision in e.message: | |
|
nodir
2015/08/12 17:04:26
Define a new exception class and raise it in lines
tandrii(chromium)
2015/08/12 17:17:33
Good idea, I was just lazy. Done.
| |
| 726 return self.update(options, [], file_list) | |
| 727 raise | |
| 721 | 728 |
| 722 if file_list is not None: | 729 if file_list is not None: |
| 723 files = self._Capture(['diff', deps_revision, '--name-only']).split() | 730 files = self._Capture(['diff', deps_revision, '--name-only']).split() |
| 724 | 731 |
| 725 self._Run(['reset', '--hard', deps_revision], options) | 732 self._Run(['reset', '--hard', deps_revision], options) |
| 726 self._Run(['clean', '-f', '-d'], options) | 733 self._Run(['clean', '-f', '-d'], options) |
| 727 | 734 |
| 728 if file_list is not None: | 735 if file_list is not None: |
| 729 file_list.extend([os.path.join(self.checkout_path, f) for f in files]) | 736 file_list.extend([os.path.join(self.checkout_path, f) for f in files]) |
| 730 | 737 |
| (...skipping 911 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1642 new_command.append('--force') | 1649 new_command.append('--force') |
| 1643 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: | 1650 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: |
| 1644 new_command.extend(('--accept', 'theirs-conflict')) | 1651 new_command.extend(('--accept', 'theirs-conflict')) |
| 1645 elif options.manually_grab_svn_rev: | 1652 elif options.manually_grab_svn_rev: |
| 1646 new_command.append('--force') | 1653 new_command.append('--force') |
| 1647 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: | 1654 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: |
| 1648 new_command.extend(('--accept', 'postpone')) | 1655 new_command.extend(('--accept', 'postpone')) |
| 1649 elif command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: | 1656 elif command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: |
| 1650 new_command.extend(('--accept', 'postpone')) | 1657 new_command.extend(('--accept', 'postpone')) |
| 1651 return new_command | 1658 return new_command |
| OLD | NEW |