Bug 1343336 Include commit date in Mozilla README draft
authorTom Ritter <tom@mozilla.com>
Tue, 28 Feb 2017 14:33:18 -0600
changeset 490570 9b668cf096aafb0d245113e319592974d2f79b33
parent 490165 a3cae7f2f7728762b829fef98a578d504aaf4c67
child 493274 04f1474dbef10d67b643e2cb26045ae087f70535
push id47141
push userbmo:tom@mozilla.com
push dateTue, 28 Feb 2017 20:34:28 +0000
bugs1343336
milestone54.0a1
Bug 1343336 Include commit date in Mozilla README MozReview-Commit-ID: 1tROG2vpdqH
modules/fdlibm/README.mozilla
modules/fdlibm/update.sh
--- a/modules/fdlibm/README.mozilla
+++ b/modules/fdlibm/README.mozilla
@@ -6,12 +6,12 @@ Upstream code can be viewed at
 
 Each file is downloaded separately, as cloning whole repository takes so much
 resources.
 
 The in-tree copy is updated by running
   sh update.sh
 from within the modules/fdlibm directory.
 
-Current version: [commit f2287da07ac7a26ac08745cac66eec82ab9ba384].
+Current version: [commit f2287da07ac7a26ac08745cac66eec82ab9ba384 (2016-09-04T12:01:32Z)].
 
 patches 01-14 fixes files to be usable within mozilla-central tree.
 See https://bugzilla.mozilla.org/show_bug.cgi?id=933257
--- a/modules/fdlibm/update.sh
+++ b/modules/fdlibm/update.sh
@@ -6,30 +6,35 @@
 set -e
 
 API_BASE_URL=https://api.github.com/repos/freebsd/freebsd
 
 get_commit() {
     curl -s "${API_BASE_URL}/commits?path=lib/msun/src&per_page=1" \
         | python -c 'import json, sys; print(json.loads(sys.stdin.read())[0]["sha"])'
 }
+get_date() {
+    curl -s "${API_BASE_URL}/commits?path=lib/msun/src&per_page=1" \
+        | python -c 'import json, sys; print(json.loads(sys.stdin.read())[0]["commit"]["committer"]["date"])'
+}
 
 mv ./src/moz.build ./src_moz.build
 rm -rf src
 BEFORE_COMMIT=$(get_commit)
 sh ./import.sh
 mv ./src_moz.build ./src/moz.build
 COMMIT=$(get_commit)
+COMMITDATE=$(get_date)
 if [ ${BEFORE_COMMIT} != ${COMMIT} ]; then
     echo "Latest commit is changed during import.  Please run again."
     exit 1
 fi
 for FILE in $(ls patches/*.patch | sort); do
     patch -p3 < ${FILE}
 done
 hg add src
 
-perl -p -i -e "s/\[commit [0-9a-f]{40}\]/[commit ${COMMIT}]/" README.mozilla
+perl -p -i -e "s/\[commit [0-9a-f]{40} \(.{1,100}\)\]/[commit ${COMMIT} (${COMMITDATE})]/" README.mozilla
 
 echo "###"
 echo "### Updated fdlibm/src to ${COMMIT}."
 echo "### Remember to verify and commit the changes to source control!"
 echo "###"