Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(167)

Unified Diff: tools/sync_google3.sh

Issue 1526593003: Update sync_google3.sh to match autoroller.py. (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/sync_google3.sh
diff --git a/tools/sync_google3.sh b/tools/sync_google3.sh
index 7978f1986349fd24468e0e337d5a39b387d5c99d..2a1cc4b874e584b09b9f3524338139dd1110d344 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 <<EOF
+${CHANGES}
+EOF
+)"
+DESC="$(cat <<EOF
+Roll Skia ${COMMIT_RANGE} (${COMMITS} commits)
+
+https://chromium.googlesource.com/skia.git/+log/${COMMIT_RANGE}
+
+$ git log ${COMMIT_RANGE} --date=short --no-merges --format='%ad %ae %s'
+${CHANGES}
+
+Change created by sync_google3.sh on ${CURRENT_DATE} by ${USER}
+EOF
+)"
+
# Create a new CL.
-CHANGE="$(g4 change --desc "Update skia HEAD to ${SKIA_REV}.")"
+CHANGE="$(g4 change --desc "${DESC}.")"
CL="$(echo "${CHANGE}" | sed "s/Change \([0-9]\+\) created.*/\1/")"
echo "Created CL ${CL} (http://cl/${CL})"
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698