Skip to content

Commit 9264b35

Browse files
committed
Add tool to bring in upstream commits
0 parents  commit 9264b35

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

devtools/upstream.sh

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/bin/bash -e
2+
#
3+
# Assumes that the allwpilib repo is checked out to the correct branch
4+
# that needs to be added to this repo
5+
#
6+
# This script is only intended to be used by maintainers of this
7+
# repository, users should not need to use it.
8+
#
9+
10+
abspath() {
11+
# $1 : relative filename
12+
echo "$(cd "$(dirname "$1")" && pwd)/$(basename "$1")"
13+
}
14+
15+
if [ "$1" == "" ]; then
16+
echo "Usage: $0 /path/to/allwpilib"
17+
exit 1
18+
fi
19+
20+
ALLWPILIB=$(abspath "$1")
21+
22+
cd $(dirname "$0")/..
23+
24+
if [ ! -z "$(git status --porcelain --untracked-files=no)" ]; then
25+
echo "Working tree is dirty, exiting"
26+
exit 1
27+
fi
28+
29+
ORIG_BRANCH="$(git symbolic-ref --short HEAD 2>/dev/null)"
30+
31+
32+
pushd "$ALLWPILIB"
33+
34+
# TODO: this takes awhile
35+
git subtree split --prefix=wpilibNewCommands/src/main/native/ -b cmd-v2-upstream
36+
37+
popd
38+
39+
40+
git checkout upstream
41+
42+
git subtree pull --prefix commands2/src $ALLWPILIB cmd-v2-upstream
43+
44+
git checkout $ORIG_BRANCH

0 commit comments

Comments
 (0)