Add Chromium-only Blender WebEngine parity work
This commit is contained in:
54759
blender-5.2.0/tools/git/git_sh1_to_svn_rev.fossils
Normal file
54759
blender-5.2.0/tools/git/git_sh1_to_svn_rev.fossils
Normal file
File diff suppressed because it is too large
Load Diff
68
blender-5.2.0/tools/git/git_sh1_to_svn_rev.py
Executable file
68
blender-5.2.0/tools/git/git_sh1_to_svn_rev.py
Executable file
@@ -0,0 +1,68 @@
|
||||
#!/usr/bin/env python3
|
||||
# SPDX-FileCopyrightText: 2023 Blender Authors
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
# generate svn rev-sha1 mapping
|
||||
|
||||
__all__ = (
|
||||
"main",
|
||||
)
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
CURRENT_DIR = os.path.abspath(os.path.dirname(__file__))
|
||||
SOURCE_DIR = os.path.normpath(os.path.abspath(os.path.normpath(os.path.join(CURRENT_DIR, "..", ".."))))
|
||||
|
||||
|
||||
def main() -> int:
|
||||
print("creating git-log of %r" % SOURCE_DIR)
|
||||
os.chdir(SOURCE_DIR)
|
||||
os.system('git log --all --format="%H %cd" --date=iso > "' + CURRENT_DIR + '/git_log.txt"')
|
||||
|
||||
print("creating mapping...")
|
||||
os.chdir(CURRENT_DIR)
|
||||
time_to_sha1 = {}
|
||||
f = "git_log.txt"
|
||||
with open(f, "r", encoding="utf-8") as fh:
|
||||
for l in fh:
|
||||
sha1 = l[:40]
|
||||
time = l[41:60]
|
||||
time_to_sha1[time] = sha1
|
||||
os.remove("git_log.txt")
|
||||
|
||||
# for reverse mapping
|
||||
rev_sha1_ls = []
|
||||
|
||||
with open("rev_to_sha1.py", "w", encoding="utf-8") as fh_dst:
|
||||
fh_dst.write("data = {\n")
|
||||
|
||||
f = "git_sh1_to_svn_rev.fossils"
|
||||
with open(f, "r", encoding="utf-8") as fh:
|
||||
for l in fh:
|
||||
# skip 'SVN:'
|
||||
rev, time = l[4:].split("\t", 1)
|
||||
time = time.split("Z", 1)[0].replace("T", " ", 1)
|
||||
sha1 = time_to_sha1.get(time)
|
||||
if sha1 is not None:
|
||||
fh_dst.write('%s: "%s",\n' % (rev, sha1))
|
||||
|
||||
rev_sha1_ls.append((rev, sha1))
|
||||
|
||||
fh_dst.write('}\n')
|
||||
|
||||
print("written: rev_to_sha1.py")
|
||||
|
||||
with open("sha1_to_rev.py", "w", encoding="utf-8") as fh_dst:
|
||||
fh_dst.write("data = {\n")
|
||||
for rev, sha1 in rev_sha1_ls:
|
||||
fh_dst.write('"%s": %s,\n' % (sha1, rev))
|
||||
fh_dst.write('}\n')
|
||||
|
||||
print("written: sha1_to_rev.py")
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
||||
50
blender-5.2.0/tools/git/git_sort_commits.py
Executable file
50
blender-5.2.0/tools/git/git_sort_commits.py
Executable file
@@ -0,0 +1,50 @@
|
||||
#!/usr/bin/env python3
|
||||
# SPDX-FileCopyrightText: 2023 Blender Authors
|
||||
#
|
||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
"""
|
||||
Sort commits by date (oldest first)
|
||||
(useful for collecting commits to cherry pick)
|
||||
|
||||
Example:
|
||||
|
||||
git_sort_commits.py < commits.txt
|
||||
"""
|
||||
|
||||
__all__ = (
|
||||
"main",
|
||||
)
|
||||
|
||||
import sys
|
||||
import os
|
||||
|
||||
MODULE_DIR = os.path.normpath(os.path.join(os.path.dirname(__file__), "..", "utils"))
|
||||
SOURCE_DIR = os.path.normpath(os.path.join(MODULE_DIR, "..", "..", ".git"))
|
||||
|
||||
sys.path.append(MODULE_DIR)
|
||||
|
||||
import git_log
|
||||
|
||||
|
||||
def main():
|
||||
|
||||
import re
|
||||
re_sha1_prefix = re.compile("^r[A-Z]+")
|
||||
|
||||
def strip_sha1(sha1):
|
||||
# strip rB, rBA ... etc
|
||||
sha1 = re.sub(re_sha1_prefix, "", sha1)
|
||||
return sha1
|
||||
|
||||
commits = [git_log.GitCommit(strip_sha1(l), SOURCE_DIR)
|
||||
for l in sys.stdin.read().split()]
|
||||
|
||||
commits.sort(key=lambda c: c.date)
|
||||
|
||||
for c in commits:
|
||||
print(c.sha1)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user