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

Side by Side Diff: gclient_scm.py

Issue 11148019: Restore previous behavior of GetSha1ForSvnRev, so unit tests pass. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools/
Patch Set: Created 8 years, 2 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 | scm.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 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
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
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
OLDNEW
« no previous file with comments | « no previous file | scm.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698