MCPcopy
hub / github.com/pyodide/pyodide / rebase

Function rebase

tools/update_emscripten.py:37–61  ·  view source on GitHub ↗
(oldtag: str, newtag: str)

Source from the content-addressed store, hash-verified

35
36
37def rebase(oldtag: str, newtag: str) -> None:
38 run(["git", "checkout", oldtag, "--quiet"], cwd=EMSCRIPTEN)
39 run(["git", "switch", "-C", f"pyodide-{newtag}"], cwd=EMSCRIPTEN)
40 patches = sorted(PATCHES.glob("*"))
41 result = run(["git", "am", *patches], cwd=EMSCRIPTEN, check=False)
42 if result.returncode:
43 run(["git", "am", "--quit"], cwd=EMSCRIPTEN, check=False)
44 sys.exit(result.returncode)
45 result = run(
46 ["git", "rebase", oldtag, "--onto", newtag], cwd=EMSCRIPTEN, check=False
47 )
48 while True:
49 if result.returncode == 0:
50 return
51 result = run(
52 ["git", "diff", "--quiet"],
53 check=False,
54 cwd=EMSCRIPTEN,
55 )
56 if result.returncode != 0:
57 print(
58 "There were rebase conflicts. Resolve the conflicts and then run again."
59 )
60 sys.exit(1)
61 result = run(["git", "rebase", "--continue"], check=False, cwd=EMSCRIPTEN)
62
63
64def update_patches(newtag: str) -> None:

Callers 1

mainFunction · 0.85

Calls 1

runFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…