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

Side by Side Diff: gclient_scm.py

Issue 24360009: Don't allow 'detached head' branch creation to fail. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools/
Patch Set: Created 7 years, 3 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 | no next file » | 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 1000 matching lines...) Expand 10 before | Expand all | Expand 10 after
1011 # Punt to the user 1011 # Punt to the user
1012 raise gclient_utils.Error('\n____ %s%s\n' 1012 raise gclient_utils.Error('\n____ %s%s\n'
1013 '\tAlready in a conflict, i.e. (no branch).\n' 1013 '\tAlready in a conflict, i.e. (no branch).\n'
1014 '\tFix the conflict and run gclient again.\n' 1014 '\tFix the conflict and run gclient again.\n'
1015 '\tOr to abort run:\n\t\tgit-rebase --abort\n' 1015 '\tOr to abort run:\n\t\tgit-rebase --abort\n'
1016 '\tSee man git-rebase for details.\n' 1016 '\tSee man git-rebase for details.\n'
1017 % (self.relpath, rev_str)) 1017 % (self.relpath, rev_str))
1018 # Let's just save off the commit so we can proceed. 1018 # Let's just save off the commit so we can proceed.
1019 name = ('saved-by-gclient-' + 1019 name = ('saved-by-gclient-' +
1020 self._Capture(['rev-parse', '--short', 'HEAD'])) 1020 self._Capture(['rev-parse', '--short', 'HEAD']))
1021 self._Capture(['branch', name]) 1021 self._Capture(['branch', '-f', name])
1022 print('\n_____ found an unreferenced commit and saved it as \'%s\'' % 1022 print('\n_____ found an unreferenced commit and saved it as \'%s\'' %
1023 name) 1023 name)
1024 1024
1025 def _GetCurrentBranch(self): 1025 def _GetCurrentBranch(self):
1026 # Returns name of current branch or None for detached HEAD 1026 # Returns name of current branch or None for detached HEAD
1027 branch = self._Capture(['rev-parse', '--abbrev-ref=strict', 'HEAD']) 1027 branch = self._Capture(['rev-parse', '--abbrev-ref=strict', 'HEAD'])
1028 if branch == 'HEAD': 1028 if branch == 'HEAD':
1029 return None 1029 return None
1030 return branch 1030 return branch
1031 1031
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after
1474 new_command.append('--force') 1474 new_command.append('--force')
1475 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: 1475 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]:
1476 new_command.extend(('--accept', 'theirs-conflict')) 1476 new_command.extend(('--accept', 'theirs-conflict'))
1477 elif options.manually_grab_svn_rev: 1477 elif options.manually_grab_svn_rev:
1478 new_command.append('--force') 1478 new_command.append('--force')
1479 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: 1479 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]:
1480 new_command.extend(('--accept', 'postpone')) 1480 new_command.extend(('--accept', 'postpone'))
1481 elif command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: 1481 elif command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]:
1482 new_command.extend(('--accept', 'postpone')) 1482 new_command.extend(('--accept', 'postpone'))
1483 return new_command 1483 return new_command
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698