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

Unified Diff: Tools/Scripts/webkitpy/tool/commands/rebaseline.py

Issue 1187483002: Setup git-svn and handle detached HEAD state in auto-rebaseline script. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: git auto-svn only when neccessary, add tests Created 5 years, 6 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
Index: Tools/Scripts/webkitpy/tool/commands/rebaseline.py
diff --git a/Tools/Scripts/webkitpy/tool/commands/rebaseline.py b/Tools/Scripts/webkitpy/tool/commands/rebaseline.py
index 9d238f4fd3dc3ddf7a1f0b28a1d2f54fd2eedd30..bb2ff336a08e989de7bd44c0a59240dded076ede 100644
--- a/Tools/Scripts/webkitpy/tool/commands/rebaseline.py
+++ b/Tools/Scripts/webkitpy/tool/commands/rebaseline.py
@@ -829,7 +829,18 @@ class AutoRebaseline(AbstractParallelRebaselineCommand):
did_finish = False
try:
- old_branch_name = tool.scm().current_branch()
Xianzhu 2015/07/14 20:40:04 What will tool.scm().current_branch() return when
joelo 2015/07/14 23:51:01 Is it possible to create a branch with '\n' in it'
Xianzhu 2015/07/15 15:57:12 Just tried: $ git checkout -tb 'a
+ # Setup git-svn for dcommit if necessary.
+ if tool.executive.run_command(
+ ['git', 'config', '--local', '--get-regexp', r'^svn-remote\.'],
+ return_exit_code=True):
+ tool.executive.run_command(['git', 'auto-svn'])
+
+ # Save the current branch name and checkout a clean branch for the patch.
+ old_branch_name = tool.executive.run_command(
+ ["git", "rev-parse", "--symbolic-full-name", "HEAD"])
+ if old_branch_name == "HEAD":
+ # If HEAD is detached use commit SHA instead.
+ old_branch_name = tool.executive.run_command(["git", "rev-parse", "HEAD"])
tool.scm().delete_branch(self.AUTO_REBASELINE_BRANCH_NAME)
tool.scm().create_clean_branch(self.AUTO_REBASELINE_BRANCH_NAME)
« no previous file with comments | « Tools/Scripts/webkitpy/common/system/executive_mock.py ('k') | Tools/Scripts/webkitpy/tool/commands/rebaseline_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698