michael@0: #!/bin/bash michael@0: # This Source Code Form is subject to the terms of the Mozilla Public michael@0: # License, v. 2.0. If a copy of the MPL was not distributed with this file, michael@0: # You can obtain one at http://mozilla.org/MPL/2.0/. michael@0: michael@0: # First, get a new copy of the tree to play with michael@0: # They both want to be named 'trunk'... michael@0: mkdir webrtc_update michael@0: cd webrtc_update michael@0: michael@0: # Note: must be in trunk; won't work with --name (error during sync) michael@0: gclient config --name trunk http://webrtc.googlecode.com/svn/trunk/peerconnection michael@0: gclient sync --force michael@0: if [ $2 ] ; then michael@0: if [ $3 ] ; then michael@0: echo michael@0: else michael@0: sed -i -e "s/\"webrtc_revision\":.*,/\"webrtc_revision\": \"$1\",/" -e "s/\"libjingle_revision\":.*,/\"libjingle_revision\": \"$2\",/" trunk/DEPS michael@0: gclient sync --force michael@0: fi michael@0: fi michael@0: michael@0: if [ $3 ] ; then michael@0: echo "Updating from $3..." michael@0: rm -rf trunk/third_party/webrtc michael@0: mkdir trunk/src michael@0: cp -a $3/webrtc/* trunk/src michael@0: fi michael@0: michael@0: cd trunk michael@0: michael@0: export date=`date` michael@0: export revision=`svnversion -n` michael@0: if [ $1 ] ; then michael@0: echo "WebRTC revision overridden from $revision to $1" michael@0: export revision=$1 michael@0: else michael@0: echo "WebRTC revision = $revision" michael@0: fi michael@0: michael@0: cd ../../media/webrtc michael@0: michael@0: # safety - make it easy to find our way out of the forest michael@0: hg tag -f -l old-tip michael@0: michael@0: # Ok, now we have a copy of the source. See what changed michael@0: # (webrtc-import-last is a bookmark) michael@0: # FIX! verify no changes in webrtc! michael@0: hg update --clean webrtc-import-last michael@0: michael@0: rm -rf trunk michael@0: mv ../../webrtc_update/trunk trunk michael@0: mv -f ../../webrtc_update/.g* . michael@0: rmdir ../../webrtc_update michael@0: (hg addremove --exclude "**webrtcsessionobserver.h" --exclude "**webrtcjson.h" --exclude "**.svn" --exclude "**.git" --exclude "**.pyc" --exclude "**.yuv" --similarity 70 --dry-run trunk; hg status -m; echo "************* Please look at the filenames found by rename and see if they match!!! ***********" ) | less michael@0: michael@0: # FIX! Query user about add-removes better!! michael@0: echo "Waiting 30 seconds - Hit ^C now to stop addremove and commit!" michael@0: sleep 30 # let them ^C michael@0: michael@0: # Add/remove files, detect renames michael@0: hg addremove --exclude "**webrtcsessionobserver.h" --exclude "**webrtcjson.h" --exclude "**.svn" --exclude "**.git" --exclude "**.pyc" --exclude "**.yuv" --similarity 70 trunk michael@0: hg status -a -r >/tmp/changed_webrtc_files michael@0: michael@0: # leave this for the user for now until we're comfortable it works safely michael@0: michael@0: # Commit the vendor branch michael@0: echo "Commit, merge and push to server - cut and paste" michael@0: echo "You probably want to do these from another shell so you can look at these" michael@0: hg commit -m "Webrtc import $revision" michael@0: # webrtc-import-last is auto-updated (bookmark) michael@0: michael@0: #echo "" michael@0: #hg update --clean webrtc-pending michael@0: #hg merge -r webrtc-import-last michael@0: #hg commit -m "merge latest import to pending, $revision" michael@0: # webrtc-pending is auto-updated (bookmark) michael@0: michael@0: echo "" michael@0: echo "hg update --clean webrtc-trim" michael@0: echo "hg merge -r webrtc-import-last" michael@0: echo "hg commit -m 'merge latest import to trim, $revision'" michael@0: # webrtc-trim is auto-updated (bookmark) michael@0: michael@0: # commands to pull - never do more than echo them for the user michael@0: echo "" michael@0: echo "Here's how to pull this update into the mozilla repo:" michael@0: echo "cd your_tree" michael@0: echo "hg qpop -a" michael@0: echo "hg pull --bookmark webrtc-trim path-to-webrtc-import-repo" michael@0: echo "hg merge" michael@0: echo "echo '#define WEBRTC_SVNVERSION $revision' >media/webrtc/webrtc_version.h" michael@0: echo "echo '#define WEBRTC_PULL_DATE \"$date\"' >>media/webrtc/webrtc_version.h" michael@0: echo "hg commit -m 'Webrtc updated to $revision; pull made on $date'" michael@0: echo "" michael@0: echo "Please check for added/removed/moved .gyp/.gypi files, and if so update EXTRA_CONFIG_DEPS in client.mk!" michael@0: echo "possible gyp* file changes:" michael@0: grep gyp /tmp/changed_webrtc_files michael@0: echo "" michael@0: echo "Once you feel safe:" michael@0: echo "hg push"