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

Side by Side Diff: checkout.py

Issue 204013002: Revert making apply_issue assume 'master' (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 6 years, 9 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
« apply_issue.py ('K') | « apply_issue.py ('k') | 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 # 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 544 matching lines...) Expand 10 before | Expand all | Expand 10 after
555 555
556 class GitCheckout(CheckoutBase): 556 class GitCheckout(CheckoutBase):
557 """Manages a git checkout.""" 557 """Manages a git checkout."""
558 def __init__(self, root_dir, project_name, remote_branch, git_url, 558 def __init__(self, root_dir, project_name, remote_branch, git_url,
559 commit_user, post_processors=None, base_ref=None): 559 commit_user, post_processors=None, base_ref=None):
560 super(GitCheckout, self).__init__(root_dir, project_name, post_processors) 560 super(GitCheckout, self).__init__(root_dir, project_name, post_processors)
561 self.base_ref = base_ref 561 self.base_ref = base_ref
562 self.git_url = git_url 562 self.git_url = git_url
563 self.commit_user = commit_user 563 self.commit_user = commit_user
564 self.remote_branch = remote_branch 564 self.remote_branch = remote_branch
565 assert self.remote_branch
566 # The working branch where patches will be applied. It will track the 565 # The working branch where patches will be applied. It will track the
567 # remote branch. 566 # remote branch.
568 self.working_branch = 'working_branch' 567 self.working_branch = 'working_branch'
569 # There is no reason to not hardcode origin. 568 # There is no reason to not hardcode origin.
570 self.pull_remote = 'origin' 569 self.pull_remote = 'origin'
571 self.push_remote = 'upstream' 570 self.push_remote = 'upstream'
572 571
573 def prepare(self, revision): 572 def prepare(self, revision):
574 """Resets the git repository in a clean state. 573 """Resets the git repository in a clean state.
575 574
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
618 617
619 Also commits the changes on the local branch. 618 Also commits the changes on the local branch.
620 619
621 Ignores svn properties and raise an exception on unexpected ones. 620 Ignores svn properties and raise an exception on unexpected ones.
622 """ 621 """
623 post_processors = post_processors or self.post_processors or [] 622 post_processors = post_processors or self.post_processors or []
624 # It this throws, the checkout is corrupted. Maybe worth deleting it and 623 # It this throws, the checkout is corrupted. Maybe worth deleting it and
625 # trying again? 624 # trying again?
626 if self.remote_branch: 625 if self.remote_branch:
627 self._check_call_git( 626 self._check_call_git(
628 ['checkout', 627 ['checkout', '-b', self.working_branch,
629 '-b', self.working_branch,
630 '-t', '%s/%s' % (self.pull_remote, self.remote_branch), 628 '-t', '%s/%s' % (self.pull_remote, self.remote_branch),
631 '--quiet']) 629 '--quiet'])
632 630
633 for index, p in enumerate(patches): 631 for index, p in enumerate(patches):
634 stdout = [] 632 stdout = []
635 try: 633 try:
636 filepath = os.path.join(self.project_path, p.filename) 634 filepath = os.path.join(self.project_path, p.filename)
637 if p.is_delete: 635 if p.is_delete:
638 if (not os.path.exists(filepath) and 636 if (not os.path.exists(filepath) and
639 any(p1.source_filename == p.filename for p1 in patches[0:index])): 637 any(p1.source_filename == p.filename for p1 in patches[0:index])):
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
822 def revisions(self, rev1, rev2): 820 def revisions(self, rev1, rev2):
823 return self.checkout.revisions(rev1, rev2) 821 return self.checkout.revisions(rev1, rev2)
824 822
825 @property 823 @property
826 def project_name(self): 824 def project_name(self):
827 return self.checkout.project_name 825 return self.checkout.project_name
828 826
829 @property 827 @property
830 def project_path(self): 828 def project_path(self):
831 return self.checkout.project_path 829 return self.checkout.project_path
OLDNEW
« apply_issue.py ('K') | « apply_issue.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698