Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2011 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 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 475 self._Run(['diff', '--name-status', merge_base], options) | 475 self._Run(['diff', '--name-status', merge_base], options) |
| 476 files = self._Capture(['diff', '--name-only', merge_base]).split() | 476 files = self._Capture(['diff', '--name-only', merge_base]).split() |
| 477 file_list.extend([os.path.join(self.checkout_path, f) for f in files]) | 477 file_list.extend([os.path.join(self.checkout_path, f) for f in files]) |
| 478 | 478 |
| 479 def FullUrlForRelativeUrl(self, url): | 479 def FullUrlForRelativeUrl(self, url): |
| 480 # Strip from last '/' | 480 # Strip from last '/' |
| 481 # Equivalent to unix basename | 481 # Equivalent to unix basename |
| 482 base_url = self.url | 482 base_url = self.url |
| 483 return base_url[:base_url.rfind('/')] + url | 483 return base_url[:base_url.rfind('/')] + url |
| 484 | 484 |
| 485 def Sha1FromSvnRevision(self, rev): | |
| 486 # Returns the git sha1 for the corresponding svn revision. | |
| 487 return self._Capture(['svn', 'find-rev', 'r' + rev]).split('\n')[-1] | |
|
M-A Ruel
2011/10/25 13:11:14
return self._Capture(['svn', 'find-rev', 'r' + rev
| |
| 488 | |
| 485 def _Clone(self, revision, url, options): | 489 def _Clone(self, revision, url, options): |
| 486 """Clone a git repository from the given URL. | 490 """Clone a git repository from the given URL. |
| 487 | 491 |
| 488 Once we've cloned the repo, we checkout a working branch if the specified | 492 Once we've cloned the repo, we checkout a working branch if the specified |
| 489 revision is a branch head. If it is a tag or a specific commit, then we | 493 revision is a branch head. If it is a tag or a specific commit, then we |
| 490 leave HEAD detached as it makes future updates simpler -- in this case the | 494 leave HEAD detached as it makes future updates simpler -- in this case the |
| 491 user should first create a new branch or switch to an existing branch before | 495 user should first create a new branch or switch to an existing branch before |
| 492 making changes in the repo.""" | 496 making changes in the repo.""" |
| 493 if not options.verbose: | 497 if not options.verbose: |
| 494 # git clone doesn't seem to insert a newline properly before printing | 498 # git clone doesn't seem to insert a newline properly before printing |
| (...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1028 new_command.append('--force') | 1032 new_command.append('--force') |
| 1029 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: | 1033 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: |
| 1030 new_command.extend(('--accept', 'theirs-conflict')) | 1034 new_command.extend(('--accept', 'theirs-conflict')) |
| 1031 elif options.manually_grab_svn_rev: | 1035 elif options.manually_grab_svn_rev: |
| 1032 new_command.append('--force') | 1036 new_command.append('--force') |
| 1033 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: | 1037 if command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: |
| 1034 new_command.extend(('--accept', 'postpone')) | 1038 new_command.extend(('--accept', 'postpone')) |
| 1035 elif command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: | 1039 elif command[0] != 'checkout' and scm.SVN.AssertVersion('1.6')[0]: |
| 1036 new_command.extend(('--accept', 'postpone')) | 1040 new_command.extend(('--accept', 'postpone')) |
| 1037 return new_command | 1041 return new_command |
| OLD | NEW |