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

Side by Side Diff: checkout.py

Issue 577203002: Use three-way merge when applying Git patches. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Fix test Created 6 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
« no previous file with comments | « no previous file | tests/checkout_test.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 # coding=utf8 1 # coding=utf8
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 """Manages a project checkout. 5 """Manages a project checkout.
6 6
7 Includes support for svn, git-svn and git. 7 Includes support for svn, git-svn and git.
8 """ 8 """
9 9
10 import ConfigParser 10 import ConfigParser
(...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after
669 with open(filepath, 'wb') as f: 669 with open(filepath, 'wb') as f:
670 f.write(content) 670 f.write(content)
671 stdout.append('Added binary file %d bytes' % len(content)) 671 stdout.append('Added binary file %d bytes' % len(content))
672 cmd = ['add', p.filename] 672 cmd = ['add', p.filename]
673 if verbose: 673 if verbose:
674 cmd.append('--verbose') 674 cmd.append('--verbose')
675 stdout.append(self._check_output_git(cmd)) 675 stdout.append(self._check_output_git(cmd))
676 else: 676 else:
677 # No need to do anything special with p.is_new or if not 677 # No need to do anything special with p.is_new or if not
678 # p.diff_hunks. git apply manages all that already. 678 # p.diff_hunks. git apply manages all that already.
679 cmd = ['apply', '--index', '-p%s' % p.patchlevel] 679 cmd = ['apply', '--index', '-3', '-p%s' % p.patchlevel]
680 if verbose: 680 if verbose:
681 cmd.append('--verbose') 681 cmd.append('--verbose')
682 stdout.append(self._check_output_git(cmd, stdin=p.get(True))) 682 stdout.append(self._check_output_git(cmd, stdin=p.get(True)))
683 for key, value in p.svn_properties: 683 for key, value in p.svn_properties:
684 # Ignore some known auto-props flags through .subversion/config, 684 # Ignore some known auto-props flags through .subversion/config,
685 # bails out on the other ones. 685 # bails out on the other ones.
686 # TODO(maruel): Read ~/.subversion/config and detect the rules that 686 # TODO(maruel): Read ~/.subversion/config and detect the rules that
687 # applies here to figure out if the property will be correctly 687 # applies here to figure out if the property will be correctly
688 # handled. 688 # handled.
689 stdout.append('Property %s=%s' % (key, value)) 689 stdout.append('Property %s=%s' % (key, value))
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
829 def revisions(self, rev1, rev2): 829 def revisions(self, rev1, rev2):
830 return self.checkout.revisions(rev1, rev2) 830 return self.checkout.revisions(rev1, rev2)
831 831
832 @property 832 @property
833 def project_name(self): 833 def project_name(self):
834 return self.checkout.project_name 834 return self.checkout.project_name
835 835
836 @property 836 @property
837 def project_path(self): 837 def project_path(self):
838 return self.checkout.project_path 838 return self.checkout.project_path
OLDNEW
« no previous file with comments | « no previous file | tests/checkout_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698