1 #! /usr/bin/env python3
3 # This Source Code Form is subject to the terms of the Mozilla Public
4 # License, v. 2.0. If a copy of the MPL was not distributed with this
5 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 assert __name__
== "__main__"
11 from pathlib
import Path
13 REL_PATH
= "/dom/canvas/test/webgl-conf"
15 DIR_IN_GECKO
= Path(__file__
).parent
16 assert not REPO_DIR
.samefile(
18 ), "Run this script from the source git checkout."
19 assert DIR_IN_GECKO
.as_posix().endswith(REL_PATH
) # Be paranoid with rm -rf.
21 gecko_base_dir
= DIR_IN_GECKO
.as_posix()[: -len(REL_PATH
)]
22 angle_dir
= Path(gecko_base_dir
, "gfx/angle").as_posix()
23 sys
.path
.append(angle_dir
)
24 from vendor_from_git
import print_now
, record_cherry_picks
28 (MERGE_BASE_ORIGIN
,) = sys
.argv
[1:] # Not always 'origin'!
29 record_cherry_picks(DIR_IN_GECKO
, MERGE_BASE_ORIGIN
)
33 src_dir
= Path(REPO_DIR
, "sdk/tests")
34 dest_dir
= Path(DIR_IN_GECKO
, "checkout")
35 print_now("Nuking old checkout...")
36 shutil
.rmtree(dest_dir
, True)
37 print_now("Writing new checkout...")
38 shutil
.copytree(src_dir
, dest_dir
, copy_function
=shutil
.copy
)