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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 # Copyright (c) 2010 Google Inc. All rights reserved. 1 # Copyright (c) 2010 Google Inc. All rights reserved.
2 # 2 #
3 # Redistribution and use in source and binary forms, with or without 3 # Redistribution and use in source and binary forms, with or without
4 # modification, are permitted provided that the following conditions are 4 # modification, are permitted provided that the following conditions are
5 # met: 5 # met:
6 # 6 #
7 # * Redistributions of source code must retain the above copyright 7 # * Redistributions of source code must retain the above copyright
8 # notice, this list of conditions and the following disclaimer. 8 # notice, this list of conditions and the following disclaimer.
9 # * Redistributions in binary form must reproduce the above 9 # * Redistributions in binary form must reproduce the above
10 # copyright notice, this list of conditions and the following disclaimer 10 # copyright notice, this list of conditions and the following disclaimer
(...skipping 811 matching lines...) Expand 10 before | Expand all | Expand 10 after
822 if self.tree_status() == 'closed': 822 if self.tree_status() == 'closed':
823 _log.info('Cannot proceed. Tree is closed.') 823 _log.info('Cannot proceed. Tree is closed.')
824 return 824 return
825 825
826 _log.info('Rebaselining %s for r%s by %s.' % (list(tests), revision, aut hor)) 826 _log.info('Rebaselining %s for r%s by %s.' % (list(tests), revision, aut hor))
827 827
828 test_prefix_list, lines_to_remove = self.get_test_prefix_list(tests) 828 test_prefix_list, lines_to_remove = self.get_test_prefix_list(tests)
829 829
830 did_finish = False 830 did_finish = False
831 try: 831 try:
832 old_branch_name = tool.scm().current_branch() 832 # Setup git-svn for dcommit if necessary.
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
833 if tool.executive.run_command(
834 ['git', 'config', '--local', '--get-regexp', r'^svn-remote\. '],
835 return_exit_code=True):
836 tool.executive.run_command(['git', 'auto-svn'])
837
838 # Save the current branch name and checkout a clean branch for the p atch.
839 old_branch_name = tool.executive.run_command(
840 ["git", "rev-parse", "--symbolic-full-name", "HEAD"])
841 if old_branch_name == "HEAD":
842 # If HEAD is detached use commit SHA instead.
843 old_branch_name = tool.executive.run_command(["git", "rev-parse" , "HEAD"])
833 tool.scm().delete_branch(self.AUTO_REBASELINE_BRANCH_NAME) 844 tool.scm().delete_branch(self.AUTO_REBASELINE_BRANCH_NAME)
834 tool.scm().create_clean_branch(self.AUTO_REBASELINE_BRANCH_NAME) 845 tool.scm().create_clean_branch(self.AUTO_REBASELINE_BRANCH_NAME)
835 846
836 # If the tests are passing everywhere, then this list will be empty. We don't need 847 # If the tests are passing everywhere, then this list will be empty. We don't need
837 # to rebaseline, but we'll still need to update TestExpectations. 848 # to rebaseline, but we'll still need to update TestExpectations.
838 if test_prefix_list: 849 if test_prefix_list:
839 self._rebaseline(options, test_prefix_list) 850 self._rebaseline(options, test_prefix_list)
840 851
841 tool.scm().commit_locally_with_message(self.commit_message(author, r evision, bugs)) 852 tool.scm().commit_locally_with_message(self.commit_message(author, r evision, bugs))
842 853
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
934 self._tool.scm().checkout_branch(old_branch_name) 945 self._tool.scm().checkout_branch(old_branch_name)
935 else: 946 else:
936 self._log_queue.put(self.QUIT_LOG) 947 self._log_queue.put(self.QUIT_LOG)
937 log_thread.join() 948 log_thread.join()
938 949
939 def execute(self, options, args, tool): 950 def execute(self, options, args, tool):
940 self._verbose = options.verbose 951 self._verbose = options.verbose
941 while True: 952 while True:
942 self._do_one_rebaseline() 953 self._do_one_rebaseline()
943 time.sleep(self.SLEEP_TIME_IN_SECONDS) 954 time.sleep(self.SLEEP_TIME_IN_SECONDS)
OLDNEW
« 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