@@ -64,8 +64,13 @@ def process_changed_file(filename):
64
64
def main (argv ):
65
65
parser = argparse .ArgumentParser ()
66
66
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)' )
67
69
args = parser .parse_args ()
68
70
71
+ if args .clear_cache :
72
+ run (['emcc' , '--clear-cache' ])
73
+
69
74
if not args .skip_tests :
70
75
if run (['git' , 'status' , '-uno' , '--porcelain' ]).strip ():
71
76
print ('tree is not clean' )
@@ -91,14 +96,18 @@ def main(argv):
91
96
The following ({ len (filenames )} ) test expectation files were updated by
92
97
running the tests with `--rebaseline`:
93
98
99
+ ```
94
100
'''
95
101
96
102
for file in filenames :
97
103
commit_message += process_changed_file (file )
98
104
99
105
commit_message += f'\n Average change: { statistics .mean (all_deltas ):+.2f} % ({ min (all_deltas ):+.2f} % - { max (all_deltas ):+.2f} %)\n '
100
106
101
- run (['git' , 'checkout' , '-b' , 'rebaseline_tests' ])
107
+ commit_message += '```\n '
108
+
109
+ if args .new_branch :
110
+ run (['git' , 'checkout' , '-b' , 'rebaseline_tests' ])
102
111
run (['git' , 'add' , '-u' , '.' ])
103
112
run (['git' , 'commit' , '-F' , '-' ], input = commit_message )
104
113
0 commit comments