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 logging | 7 import logging |
8 import os | 8 import os |
9 import posixpath | 9 import posixpath |
10 import re | 10 import re |
(...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
583 if scm.GIT.Capture(['config', '--get', 'svn-remote.svn.fetch'], | 583 if scm.GIT.Capture(['config', '--get', 'svn-remote.svn.fetch'], |
584 cwd=self.checkout_path): | 584 cwd=self.checkout_path): |
585 scm.GIT.Capture(['fetch'], cwd=self.checkout_path) | 585 scm.GIT.Capture(['fetch'], cwd=self.checkout_path) |
586 except subprocess2.CalledProcessError: | 586 except subprocess2.CalledProcessError: |
587 logging.debug('git config --get svn-remote.svn.fetch failed, ' | 587 logging.debug('git config --get svn-remote.svn.fetch failed, ' |
588 'ignoring possible optimization.') | 588 'ignoring possible optimization.') |
589 if options.verbose: | 589 if options.verbose: |
590 print('Running git svn fetch. This might take a while.\n') | 590 print('Running git svn fetch. This might take a while.\n') |
591 scm.GIT.Capture(['svn', 'fetch'], cwd=self.checkout_path) | 591 scm.GIT.Capture(['svn', 'fetch'], cwd=self.checkout_path) |
592 try: | 592 try: |
593 sha1 = scm.GIT.GetSha1ForSvnRev(cwd=self.checkout_path, rev=rev) | 593 sha1 = scm.GIT.GetBlessedSha1ForSvnRev( |
| 594 cwd=self.checkout_path, rev=rev) |
594 except gclient_utils.Error, e: | 595 except gclient_utils.Error, e: |
595 sha1 = e.message | 596 sha1 = e.message |
596 print('\nWarning: Could not find a git revision with accurate\n' | 597 print('\nWarning: Could not find a git revision with accurate\n' |
597 '.DEPS.git that maps to SVN revision %s. Sync-ing to\n' | 598 '.DEPS.git that maps to SVN revision %s. Sync-ing to\n' |
598 'the closest sane git revision, which is:\n' | 599 'the closest sane git revision, which is:\n' |
599 ' %s\n' % (rev, e.message)) | 600 ' %s\n' % (rev, e.message)) |
600 if not sha1: | 601 if not sha1: |
601 raise gclient_utils.Error( | 602 raise gclient_utils.Error( |
602 ( 'It appears that either your git-svn remote is incorrectly\n' | 603 ( 'It appears that either your git-svn remote is incorrectly\n' |
603 'configured or the revision in your safesync_url is\n' | 604 'configured or the revision in your safesync_url is\n' |
(...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1207 new_command.append('--force') | 1208 new_command.append('--force') |
1208 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: | 1209 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: |
1209 new_command.extend(('--accept', 'theirs-conflict')) | 1210 new_command.extend(('--accept', 'theirs-conflict')) |
1210 elif options.manually_grab_svn_rev: | 1211 elif options.manually_grab_svn_rev: |
1211 new_command.append('--force') | 1212 new_command.append('--force') |
1212 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: | 1213 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: |
1213 new_command.extend(('--accept', 'postpone')) | 1214 new_command.extend(('--accept', 'postpone')) |
1214 elif command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: | 1215 elif command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: |
1215 new_command.extend(('--accept', 'postpone')) | 1216 new_command.extend(('--accept', 'postpone')) |
1216 return new_command | 1217 return new_command |
OLD | NEW |