From 2796767eda9536a1336fe5e1b50bbf0d05d2a338 Mon Sep 17 00:00:00 2001 From: benjaminwagner Date: Mon, 14 Dec 2015 12:41:10 -0800 Subject: [PATCH] Update sync_google3.sh to match autoroller.py. BUG=skia: Review URL: https://codereview.chromium.org/1526593003 --- tools/sync_google3.sh | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/tools/sync_google3.sh b/tools/sync_google3.sh index 7978f19863..2a1cc4b874 100755 --- a/tools/sync_google3.sh +++ b/tools/sync_google3.sh @@ -30,16 +30,38 @@ ${MY_DIR}/git_clone_to_google3.sh --skia_rev "${SKIA_REV}" echo "Synced client ${CLIENT_NAME} to ${SKIA_REV}" +# Grab previous Git revision. +GOOGLE3_REV="$(grep "Version: " README.google | cut -d ' ' -f 2)" + # Update README.google. sed --in-place "s/^Version: .*/Version: ${SKIA_REV}/" README.google -sed --in-place "s/URL: http:\/\/skia.googlesource.com\/skia\/+archive\/.*\.tar\.gz/URL: http:\/\/skia.googlesource.com\/skia\/+archive\/${SKIA_REV}.tar.gz/" README.google -CURRENT_DATE=`date '+%d %B %Y'` -echo "Updated using sync_google3.sh on $CURRENT_DATE by $USER@google.com" >> README.google +sed --in-place "s/URL: https:\/\/skia.googlesource.com\/skia\/+archive\/.*\.tar\.gz/URL: https:\/\/skia.googlesource.com\/skia\/+archive\/${SKIA_REV}.tar.gz/" README.google # Add README.google to the default change. g4 reopen + +# Generate commit description. +CURRENT_DATE=`date '+%d %B %Y'` +COMMIT_RANGE="${GOOGLE3_REV:0:9}..${SKIA_REV:0:9}" +CHANGES="$(git log ${COMMIT_RANGE} --date=short --no-merges --format='%ad %ae %s')" +COMMITS="$(wc -l <