diff options
author | Ramon Fernandez <ramon@mongodb.com> | 2015-11-20 18:27:43 -0500 |
---|---|---|
committer | Ramon Fernandez <ramon@mongodb.com> | 2015-11-20 18:27:43 -0500 |
commit | 6f2a7e6cfb69e186ee2d5ca8653dda5bf0633ef7 (patch) | |
tree | e8a4dee77c6b9e14f6bc77cfd1f3650a8f41950a | |
parent | 8ab8e32549fe9f6103c646765a0b684d522470fb (diff) | |
download | mongo-6f2a7e6cfb69e186ee2d5ca8653dda5bf0633ef7.tar.gz |
Add verbose revision history for WiredTiger imports
-rwxr-xr-x | buildscripts/update-vendor-wiredtiger | 45 |
1 files changed, 40 insertions, 5 deletions
diff --git a/buildscripts/update-vendor-wiredtiger b/buildscripts/update-vendor-wiredtiger index 2a88ec75f9b..4ab52c09bbd 100755 --- a/buildscripts/update-vendor-wiredtiger +++ b/buildscripts/update-vendor-wiredtiger @@ -14,9 +14,6 @@ STARTPWD=$(pwd) TOPLEVEL=$(git rev-parse --show-toplevel) cd ${TOPLEVEL}/src/third_party -# Begin tracing commands -set -o xtrace - # Write file according to "Content-Disposition: attachment" header. Example: # Content-Disposition: attachment; filename=wiredtiger-wiredtiger-2.4.0-109-ge5aec44.tar.gz @@ -46,10 +43,48 @@ tar -x --strip-components 1 \ --exclude '*/tools/wtstats/template' \ -C wiredtiger -f ${TARBALL} +# Add wiredtiger as a remote called 'wt'; ignore errors if it already +# exists -- fetch will catch any problems +echo "Fetching latest wiredtiger code; this may take a while..." +git remote add wt git@github.com:wiredtiger/wiredtiger.git > /dev/null 2>&1 || true +git fetch wt + +# Build a changelog for the revision history +# - get the githash for this drop from the tarball name +newhash="`echo $TARBALL | sed -e 's/.*-g\([0-9a-f]*\)\..*/\1/'`" +[ -z "$newhash" ] && echo "Can't find hash for this drop" && exit 1 + +# - find the githash from the previous drop from the summary +oldhash="`git log --format=%s | grep 'Import wiredtiger' | head -n 1 | sed -e's/.*-g\([0-9a-f]*\)\..*/\1/g'`" +[ -z "$oldhash" ] && echo "Can't find hash for previous drop" && exit 1 + +# - build the changelog; unfortunately the format is branch-dependant +case ${REMOTEBRANCH} in + "mongodb-3.0") format="--format=\"%h %s\"" ;; + "mongodb-3.2") format="--grep=\"Merge pull\" --format=\"%h %b\"" ;; + *) echo "${REMOTEBRANCH} is not supported; bailing out" ; exit 1 ;; +esac +gitlog="git log $format ${oldhash}..${newhash} wt/${REMOTEBRANCH}" +changelog="`eval $gitlog`" + +echo git add wiredtiger -git commit -m "Import ${TARBALL} from wiredtiger branch ${REMOTEBRANCH}" +git commit -m "Import ${TARBALL} from wiredtiger branch ${REMOTEBRANCH}" \ + -m "ref: ${oldhash}..${newhash}" \ + -m "$changelog" +echo git log -n 1 set -o errexit cd $STARTPWD -echo "Done applying $TARBALL to $LOCALBRANCH" +echo " +Done applying $TARBALL to $LOCALBRANCH. +The revision history was computed as follows: + + $gitlog + +Please review it before you push. You can edit it with: + + git commit --amend + +" |