Chromium Code Reviews| Index: checkout.py |
| diff --git a/checkout.py b/checkout.py |
| index f58dedd75c6d7c2ca4aa665022db47f1cda2c2f2..84577bc43820fddbe80a7b649410260c6b993604 100644 |
| --- a/checkout.py |
| +++ b/checkout.py |
| @@ -131,8 +131,7 @@ class CheckoutBase(object): |
| """ |
| raise NotImplementedError() |
| - def apply_patch(self, patches, post_processors=None, verbose=False, |
| - name=None, email=None): |
| + def apply_patch(self, patches, post_processors=None, verbose=False): |
| """Applies a patch and returns the list of modified files. |
| This function should throw patch.UnsupportedPatchFormat or |
| @@ -166,8 +165,7 @@ class RawCheckout(CheckoutBase): |
| """Stubbed out.""" |
| pass |
| - def apply_patch(self, patches, post_processors=None, verbose=False, |
| - name=None, email=None): |
| + def apply_patch(self, patches, post_processors=None, verbose=False): |
| """Ignores svn properties.""" |
| post_processors = post_processors or self.post_processors or [] |
| for p in patches: |
| @@ -351,8 +349,7 @@ class SvnCheckout(CheckoutBase, SvnMixIn): |
| (self.project_name, self.project_path)) |
| return self._revert(revision) |
| - def apply_patch(self, patches, post_processors=None, verbose=False, |
| - name=None, email=None): |
| + def apply_patch(self, patches, post_processors=None, verbose=False): |
| post_processors = post_processors or self.post_processors or [] |
| for p in patches: |
| stdout = [] |
| @@ -556,9 +553,8 @@ class SvnCheckout(CheckoutBase, SvnMixIn): |
| class GitCheckout(CheckoutBase): |
| """Manages a git checkout.""" |
| def __init__(self, root_dir, project_name, remote_branch, git_url, |
| - commit_user, post_processors=None, base_ref=None): |
| + commit_user, post_processors=None): |
| super(GitCheckout, self).__init__(root_dir, project_name, post_processors) |
| - self.base_ref = base_ref |
| self.git_url = git_url |
| self.commit_user = commit_user |
| self.remote_branch = remote_branch |
| @@ -631,11 +627,10 @@ class GitCheckout(CheckoutBase): |
| """Gets the current revision (in unicode) from the local branch.""" |
| return unicode(self._check_output_git(['rev-parse', 'HEAD']).strip()) |
| - def apply_patch(self, patches, post_processors=None, verbose=False, |
| - name=None, email=None): |
| + def apply_patch(self, patches, post_processors=None, verbose=False): |
|
iannucci
2014/05/08 07:29:48
(also, this code terrifies me to no end. There is
M-A Ruel
2014/05/08 16:40:18
It is simple;
- It properly applies svn generated
|
| """Applies a patch on 'working_branch' and switches to it. |
| - Also commits the changes on the local branch. |
| + The changes remain staged on the current branch. |
| Ignores svn properties and raise an exception on unexpected ones. |
| """ |
| @@ -709,22 +704,9 @@ class GitCheckout(CheckoutBase): |
| ' '.join(e.cmd), |
| align_stdout(stdout), |
| align_stdout([getattr(e, 'stdout', '')]))) |
| - # Once all the patches are processed and added to the index, commit the |
| - # index. |
| - cmd = ['commit', '-m', 'Committed patch'] |
| - if name and email: |
| - cmd = ['-c', 'user.email=%s' % email, '-c', 'user.name=%s' % name] + cmd |
| - if verbose: |
| - cmd.append('--verbose') |
| - self._check_call_git(cmd) |
| - if self.base_ref: |
| - base_ref = self.base_ref |
| - else: |
| - base_ref = '%s/%s' % (self.remote, |
| - self.remote_branch or self.master_branch) |
| found_files = self._check_output_git( |
| - ['diff', base_ref, '--ignore-submodules', |
| - '--name-only']).splitlines(False) |
| + ['diff', '--ignore-submodules', |
| + '--name-only', '--staged']).splitlines(False) |
| assert sorted(patches.filenames) == sorted(found_files), ( |
| 'Found extra %s locally, %s not patched' % ( |
| sorted(set(found_files) - set(patches.filenames)), |
| @@ -826,8 +808,7 @@ class ReadOnlyCheckout(object): |
| def get_settings(self, key): |
| return self.checkout.get_settings(key) |
| - def apply_patch(self, patches, post_processors=None, verbose=False, |
| - name=None, email=None): |
| + def apply_patch(self, patches, post_processors=None, verbose=False): |
| return self.checkout.apply_patch( |
| patches, post_processors or self.post_processors, verbose) |