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

Unified Diff: tools/push-to-trunk/common_includes.py

Issue 544153002: Add ability to make pure svn commits to roll scripts (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/push-to-trunk/bump_up_version.py ('k') | tools/push-to-trunk/test_scripts.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/push-to-trunk/common_includes.py
diff --git a/tools/push-to-trunk/common_includes.py b/tools/push-to-trunk/common_includes.py
index f98008a0b2453153c9b1452c7a78368f5f7ecf4c..b10f7df5b2f5a8575bcca9c795763a3643d65333 100644
--- a/tools/push-to-trunk/common_includes.py
+++ b/tools/push-to-trunk/common_includes.py
@@ -529,6 +529,20 @@ class Step(GitRecipesMixin):
output += "%s\n" % line
TextToFile(output, version_file)
+ def SVNCommit(self, root, commit_message):
+ patch = self.GitDiff("HEAD^", "HEAD")
+ TextToFile(patch, self._config[PATCH_FILE])
+ if not self.Command("patch", "-d %s -p1 -i %s" %
+ (root, self._config[PATCH_FILE]),
+ cwd=self._options.svn):
+ self.Die("Could not apply patch.")
+ self.Command(
+ "svn",
+ "commit --non-interactive --username=%s --config-dir=%s -m \"%s\"" %
+ (self._options.author, self._options.svn_config, commit_message),
+ cwd=self._options.svn)
+
+
class UploadStep(Step):
MESSAGE = "Upload for code review."
@@ -631,6 +645,11 @@ class ScriptsBase(object):
help=("Determine current sheriff to review CLs. On "
"success, this will overwrite the reviewer "
"option."))
+ parser.add_argument("--svn",
+ help=("Optional full svn checkout for the commit."
+ "The folder needs to be the svn root."))
+ parser.add_argument("--svn-config",
+ help=("Optional folder used as svn --config-dir."))
parser.add_argument("-s", "--step",
help="Specify the step where to start work. Default: 0.",
default=0, type=int)
@@ -650,6 +669,10 @@ class ScriptsBase(object):
print "To determine the current sheriff, requires the googler mapping"
parser.print_help()
return None
+ if options.svn and not options.svn_config:
+ print "Using pure svn for committing requires also --svn-config"
+ parser.print_help()
+ return None
# Defaults for options, common to all scripts.
options.manual = getattr(options, "manual", True)
« no previous file with comments | « tools/push-to-trunk/bump_up_version.py ('k') | tools/push-to-trunk/test_scripts.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698