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

Unified Diff: checkout.py

Issue 175543006: Pass in "--author 'name <email@somewhere.com>" when doing git patches in apply_issue.py (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Removed unneeded if Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « apply_issue.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: checkout.py
diff --git a/checkout.py b/checkout.py
index cc570082c01219def42be817a84c0296ac950104..2c9c68a7fd24ec5bcaa3df2cdd1ae89cd36bb59a 100644
--- a/checkout.py
+++ b/checkout.py
@@ -131,7 +131,8 @@ class CheckoutBase(object):
"""
raise NotImplementedError()
- def apply_patch(self, patches, post_processors=None, verbose=False):
+ def apply_patch(self, patches, post_processors=None, verbose=False,
+ name=None, email=None):
"""Applies a patch and returns the list of modified files.
This function should throw patch.UnsupportedPatchFormat or
@@ -165,7 +166,8 @@ class RawCheckout(CheckoutBase):
"""Stubbed out."""
pass
- def apply_patch(self, patches, post_processors=None, verbose=False):
+ def apply_patch(self, patches, post_processors=None, verbose=False,
+ name=None, email=None):
"""Ignores svn properties."""
post_processors = post_processors or self.post_processors or []
for p in patches:
@@ -349,7 +351,8 @@ class SvnCheckout(CheckoutBase, SvnMixIn):
(self.project_name, self.project_path))
return self._revert(revision)
- def apply_patch(self, patches, post_processors=None, verbose=False):
+ def apply_patch(self, patches, post_processors=None, verbose=False,
+ name=None, email=None):
post_processors = post_processors or self.post_processors or []
for p in patches:
stdout = []
@@ -628,7 +631,8 @@ 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):
+ def apply_patch(self, patches, post_processors=None, verbose=False,
+ name=None, email=None):
"""Applies a patch on 'working_branch' and switches to it.
Also commits the changes on the local branch.
@@ -708,6 +712,9 @@ class GitCheckout(CheckoutBase):
# Once all the patches are processed and added to the index, commit the
# index.
cmd = ['commit', '-m', 'Committed patch']
+ if name and email:
+ author = '%s <%s>' % (name, email)
+ cmd.extend(['--author', author])
if verbose:
cmd.append('--verbose')
self._check_call_git(cmd)
@@ -818,7 +825,8 @@ class ReadOnlyCheckout(object):
def get_settings(self, key):
return self.checkout.get_settings(key)
- def apply_patch(self, patches, post_processors=None, verbose=False):
+ def apply_patch(self, patches, post_processors=None, verbose=False,
+ name=None, email=None):
return self.checkout.apply_patch(
patches, post_processors or self.post_processors, verbose)
« no previous file with comments | « apply_issue.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698