forked from IronLanguages/ironpython3
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdate-stdlib.sh
More file actions
executable file
·35 lines (27 loc) · 795 Bytes
/
update-stdlib.sh
File metadata and controls
executable file
·35 lines (27 loc) · 795 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/sh
if [ -z "$1" ]; then echo "Must specify CPython repo." && exit 1; fi
git diff-index --quiet HEAD
if [ $? -ne 0 ]
then
echo "There are uncomitted changes. Commit or stash before proceeding."
exit 1
fi
curbranch=$(git rev-parse --abbrev-ref HEAD)
if [ "$curbranch" != "python-stdlib" ]
then
echo "This should only be run on the python-stdlib branch (on $curbranch)."
exit 1
fi
pyrepo=$1
hgrev=$(hg -R "$pyrepo" id -i)
stdlibdir=$(dirname $0)
rsync -qcr --delete --exclude="plat-*" --exclude="__pycache__" --exclude="*.pyc" ~/repos/cpython/Lib "$stdlibdir"
git update-index --refresh -q > /dev/null
git add -A "$stdlibdir/Lib"
git diff-index --quiet HEAD
if [ $? -eq 0 ]
then
echo "No changes found."
else
git commit -am "Import python stdlib @ $hgrev"
fi