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 import logging | 7 import logging |
| 8 import os | 8 import os |
| 9 import posixpath | 9 import posixpath |
| 10 import re | 10 import re |
| (...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 645 | 645 |
| 646 Once we've cloned the repo, we checkout a working branch if the specified | 646 Once we've cloned the repo, we checkout a working branch if the specified |
| 647 revision is a branch head. If it is a tag or a specific commit, then we | 647 revision is a branch head. If it is a tag or a specific commit, then we |
| 648 leave HEAD detached as it makes future updates simpler -- in this case the | 648 leave HEAD detached as it makes future updates simpler -- in this case the |
| 649 user should first create a new branch or switch to an existing branch before | 649 user should first create a new branch or switch to an existing branch before |
| 650 making changes in the repo.""" | 650 making changes in the repo.""" |
| 651 if not options.verbose: | 651 if not options.verbose: |
| 652 # git clone doesn't seem to insert a newline properly before printing | 652 # git clone doesn't seem to insert a newline properly before printing |
| 653 # to stdout | 653 # to stdout |
| 654 print('') | 654 print('') |
| 655 | 655 template_path = os.path.join(os.path.dirname(__file__), 'git-templates') |
|
M-A Ruel
2013/04/16 20:52:37
Make this a global ALL_CAPS varaible at the top of
szager1
2013/04/16 21:01:25
Done.
| |
| 656 clone_cmd = ['clone', '--progress'] | 656 clone_cmd = ['clone', '--progress', '--template=%s' % template_path] |
| 657 if revision.startswith('refs/heads/'): | 657 if revision.startswith('refs/heads/'): |
| 658 clone_cmd.extend(['-b', revision.replace('refs/heads/', '')]) | 658 clone_cmd.extend(['-b', revision.replace('refs/heads/', '')]) |
| 659 detach_head = False | 659 detach_head = False |
| 660 else: | 660 else: |
| 661 detach_head = True | 661 detach_head = True |
| 662 if options.verbose: | 662 if options.verbose: |
| 663 clone_cmd.append('--verbose') | 663 clone_cmd.append('--verbose') |
| 664 clone_cmd.extend([url, self.checkout_path]) | 664 clone_cmd.extend([url, self.checkout_path]) |
| 665 | 665 |
| 666 # If the parent directory does not exist, Git clone on Windows will not | 666 # If the parent directory does not exist, Git clone on Windows will not |
| (...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1257 new_command.append('--force') | 1257 new_command.append('--force') |
| 1258 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: | 1258 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: |
| 1259 new_command.extend(('--accept', 'theirs-conflict')) | 1259 new_command.extend(('--accept', 'theirs-conflict')) |
| 1260 elif options.manually_grab_svn_rev: | 1260 elif options.manually_grab_svn_rev: |
| 1261 new_command.append('--force') | 1261 new_command.append('--force') |
| 1262 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: | 1262 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: |
| 1263 new_command.extend(('--accept', 'postpone')) | 1263 new_command.extend(('--accept', 'postpone')) |
| 1264 elif command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: | 1264 elif command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: |
| 1265 new_command.extend(('--accept', 'postpone')) | 1265 new_command.extend(('--accept', 'postpone')) |
| 1266 return new_command | 1266 return new_command |
| OLD | NEW |