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 685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
696 for _ in range(3): | 696 for _ in range(3): |
697 try: | 697 try: |
698 # Add the "branch-heads" refspecs. Do this separately from the clone | 698 # Add the "branch-heads" refspecs. Do this separately from the clone |
699 # command since apparently some versions of git don't support 'clone | 699 # command since apparently some versions of git don't support 'clone |
700 # --config'. | 700 # --config'. |
701 # Don't assume 'with_branch_heads' is added by 'gclient sync' setup, | 701 # Don't assume 'with_branch_heads' is added by 'gclient sync' setup, |
702 # since _Clone() can by reached in roundabout ways (e.g. 'gclient | 702 # since _Clone() can by reached in roundabout ways (e.g. 'gclient |
703 # revert'). | 703 # revert'). |
704 if hasattr(options, 'with_branch_heads') and options.with_branch_heads: | 704 if hasattr(options, 'with_branch_heads') and options.with_branch_heads: |
705 config_cmd = ['config', 'remote.origin.fetch', | 705 config_cmd = ['config', 'remote.origin.fetch', |
706 '+refs/branch-heads/*:refs/remotes/branch-heads/*'] | 706 '+refs/branch-heads/*:refs/remotes/branch-heads/*', |
| 707 '^\\+refs/branch-heads/\\*:.*$'] |
707 self._Run(config_cmd, options) | 708 self._Run(config_cmd, options) |
708 | 709 |
709 # Update the "branch-heads" remote-tracking branches, since we might | 710 # Update the "branch-heads" remote-tracking branches, since we might |
710 # need it to checkout a specific revision below. | 711 # need it to checkout a specific revision below. |
711 fetch_cmd = ['fetch', 'origin'] | 712 fetch_cmd = ['fetch', 'origin'] |
712 if options.verbose: | 713 if options.verbose: |
713 fetch_cmd.append('--verbose') | 714 fetch_cmd.append('--verbose') |
714 self._Run(fetch_cmd, options) | 715 self._Run(fetch_cmd, options) |
715 break | 716 break |
716 except subprocess2.CalledProcessError, e: | 717 except subprocess2.CalledProcessError, e: |
(...skipping 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1254 new_command.append('--force') | 1255 new_command.append('--force') |
1255 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: | 1256 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: |
1256 new_command.extend(('--accept', 'theirs-conflict')) | 1257 new_command.extend(('--accept', 'theirs-conflict')) |
1257 elif options.manually_grab_svn_rev: | 1258 elif options.manually_grab_svn_rev: |
1258 new_command.append('--force') | 1259 new_command.append('--force') |
1259 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: | 1260 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: |
1260 new_command.extend(('--accept', 'postpone')) | 1261 new_command.extend(('--accept', 'postpone')) |
1261 elif command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: | 1262 elif command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: |
1262 new_command.extend(('--accept', 'postpone')) | 1263 new_command.extend(('--accept', 'postpone')) |
1263 return new_command | 1264 return new_command |
OLD | NEW |