@@ -64,8 +64,13 @@ def process_changed_file(filename):
6464def main (argv ):
6565 parser = argparse .ArgumentParser ()
6666 parser .add_argument ('-s' , '--skip-tests' , action = 'store_true' , help = "don't actually run the tests, just analyze the existing results" )
67+ parser .add_argument ('-b' , '--new-branch' , action = 'store_true' , help = 'create a new branch containing the updates' )
68+ parser .add_argument ('-c' , '--clear-cache' , action = 'store_true' , help = 'clear the cache before rebaselining (useful when working with llvm changes)' )
6769 args = parser .parse_args ()
6870
71+ if args .clear_cache :
72+ run (['emcc' , '--clear-cache' ])
73+
6974 if not args .skip_tests :
7075 if run (['git' , 'status' , '-uno' , '--porcelain' ]).strip ():
7176 print ('tree is not clean' )
@@ -91,14 +96,18 @@ def main(argv):
9196The following ({ len (filenames )} ) test expectation files were updated by
9297running the tests with `--rebaseline`:
9398
99+ ```
94100'''
95101
96102 for file in filenames :
97103 commit_message += process_changed_file (file )
98104
99105 commit_message += f'\n Average change: { statistics .mean (all_deltas ):+.2f} % ({ min (all_deltas ):+.2f} % - { max (all_deltas ):+.2f} %)\n '
100106
101- run (['git' , 'checkout' , '-b' , 'rebaseline_tests' ])
107+ commit_message += '```\n '
108+
109+ if args .new_branch :
110+ run (['git' , 'checkout' , '-b' , 'rebaseline_tests' ])
102111 run (['git' , 'add' , '-u' , '.' ])
103112 run (['git' , 'commit' , '-F' , '-' ], input = commit_message )
104113
0 commit comments