Remove old unused SVN related scripts from depot_tools
BUG= Review-Url: https://codereview.chromium.org/2253013004changes/00/373500/1
parent
e53c935fe7
commit
196aa81d8a
@ -1,52 +0,0 @@
|
||||
@echo off
|
||||
:: Copyright (c) 2009 The Chromium Authors. All rights reserved.
|
||||
:: Use of this source code is governed by a BSD-style license that can be
|
||||
:: found in the LICENSE file.
|
||||
|
||||
setlocal
|
||||
|
||||
:: This script will create a scheduled task to run chrome-update every day
|
||||
:: at the time you specify. This script expects to be live in
|
||||
:: depot_tools\latest.
|
||||
::
|
||||
:: Usage: this-script <time to run task> <path to chrome trunk>
|
||||
|
||||
set Out=%USERPROFILE%\chrome-update-task.bat
|
||||
set TaskTime=%1
|
||||
set Trunk=%~f2
|
||||
|
||||
if not exist "%Trunk%" (
|
||||
echo Usage: %~n0 ^<time^> ^<c:\path\to\chrome\trunk^>
|
||||
echo ^<time^> is the time in HH:MM:SS format at which to run the task.
|
||||
echo Example: %~n0 02:00:00 c:\src\chrome\trunk
|
||||
goto :EOF
|
||||
)
|
||||
|
||||
if not exist "%Out%" goto CreateScript
|
||||
|
||||
echo WARNING: %Out% already exists.
|
||||
set Choice=
|
||||
set /P Choice=Overwrite file [Y/N]?
|
||||
if not "%Choice%"=="y" goto CreateTask
|
||||
|
||||
:CreateScript
|
||||
|
||||
echo.
|
||||
echo Creating %Out%
|
||||
|
||||
echo>"%Out%" @echo off
|
||||
echo>>"%Out%" "%~dp0chrome-update.bat" "%Trunk%" --solution chrome.sln --target Debug --build-dir src/chrome ^> "%Trunk%\chrome-update-results.txt"
|
||||
|
||||
:CreateTask
|
||||
|
||||
echo.
|
||||
echo ***********************************************************************
|
||||
echo Creating a Scheduled Task to run chrome-update each day at %TaskTime%.
|
||||
echo The batch file being run will live at %Out%.
|
||||
echo.
|
||||
echo WARNING: The password you enter will be displayed in cleartext.
|
||||
echo If you're paranoid, you can enter blank here and then fix the password
|
||||
echo by editing the scheduled task manually from the Control Panel.
|
||||
echo ***********************************************************************
|
||||
echo.
|
||||
schtasks /create /tn chrome-update /tr "\"%Out%\"" /sc daily /st %TaskTime%
|
@ -1,5 +0,0 @@
|
||||
@echo off
|
||||
setlocal
|
||||
:: This is required with cygwin only.
|
||||
PATH=%~dp0;%PATH%
|
||||
call python "%~dp0chrome-update.py" %*
|
@ -1,91 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
|
||||
import os
|
||||
import re
|
||||
import subprocess
|
||||
import sys
|
||||
import urllib
|
||||
|
||||
IS_WIN = sys.platform.startswith('win')
|
||||
BASE_URL = 'http://src.chromium.org/svn/trunk/tools/buildbot/scripts/'
|
||||
COMPILE_URL = BASE_URL + 'slave/compile.py'
|
||||
UTILS_URL = BASE_URL + 'common/chromium_utils.py'
|
||||
|
||||
|
||||
def Fetch(url, filename):
|
||||
if not os.path.exists(filename):
|
||||
urllib.urlretrieve(url, filename)
|
||||
|
||||
|
||||
def GetLastestRevision():
|
||||
"""Returns the revision number of the last build that was archived, or
|
||||
None on failure."""
|
||||
url = 'http://build.chromium.org/buildbot/continuous/'
|
||||
if sys.platform.startswith('win'):
|
||||
url += 'win/'
|
||||
elif sys.platform.startswith('linux'):
|
||||
url += 'linux/'
|
||||
elif sys.platform.startswith('darwin'):
|
||||
url += 'mac/'
|
||||
else:
|
||||
# This path is actually win.
|
||||
pass
|
||||
url += 'LATEST/REVISION'
|
||||
text = urllib.urlopen(url).read()
|
||||
if text:
|
||||
match = re.search(r"(\d+)", text)
|
||||
if match:
|
||||
return int(match.group(1))
|
||||
return None
|
||||
|
||||
|
||||
def DoUpdate(chrome_root):
|
||||
"""gclient sync to the latest build."""
|
||||
cmd = ["gclient", "sync"]
|
||||
rev = GetLastestRevision()
|
||||
if rev:
|
||||
cmd.extend(['--revision', 'src@%d' % rev])
|
||||
return subprocess.call(cmd, cwd=chrome_root, shell=IS_WIN)
|
||||
|
||||
|
||||
def DoBuild(chrome_root, args):
|
||||
"""Download compile.py and run it."""
|
||||
compile_path = os.path.join(chrome_root, 'compile.py')
|
||||
Fetch(COMPILE_URL, compile_path)
|
||||
Fetch(UTILS_URL, os.path.join(chrome_root, 'chromium_utils.py'))
|
||||
cmd = ['python', compile_path] + args
|
||||
return subprocess.call(cmd, cwd=chrome_root, shell=IS_WIN)
|
||||
|
||||
|
||||
def main(args):
|
||||
if len(args) < 3:
|
||||
print('Usage: chrome-update.py <path> [options]')
|
||||
print('See options from compile.py at')
|
||||
print(' %s' % COMPILE_URL)
|
||||
print('\nFor more example, see the compile steps on the waterfall')
|
||||
return 1
|
||||
|
||||
chrome_root = args[1]
|
||||
if not os.path.isdir(chrome_root):
|
||||
print('Path to chrome root (%s) not found.' % chrome_root)
|
||||
return 1
|
||||
|
||||
rv = DoUpdate(chrome_root)
|
||||
if rv != 0:
|
||||
print('Update Failed. Bailing.')
|
||||
return rv
|
||||
|
||||
DoBuild(chrome_root, args[2:])
|
||||
print('Success!')
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
try:
|
||||
sys.exit(main(sys.argv))
|
||||
except KeyboardInterrupt:
|
||||
sys.stderr.write('interrupted\n')
|
||||
sys.exit(1)
|
@ -1,200 +0,0 @@
|
||||
#!/usr/bin/env -S bash -e
|
||||
#
|
||||
# Copyright (c) 2009 The Chromium Authors. All rights reserved.
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
#
|
||||
# create-chromium-git-src
|
||||
#
|
||||
# Create and configure a local Chromium git repository.
|
||||
#
|
||||
|
||||
GITSERVER="${GITSERVER:-git.chromium.org}"
|
||||
SVNSERVER="${SVNSERVER:-svn://svn.chromium.org/chrome}"
|
||||
TMP=".create_chromium_git_src.$$"
|
||||
|
||||
function cleanup {
|
||||
rm -rf "${TMP}"
|
||||
}
|
||||
|
||||
trap 'cleanup; echo Failure!; tput bel; exit 1' TERM QUIT HUP INT EXIT
|
||||
|
||||
function get_email {
|
||||
# Get user email address.
|
||||
EMAIL=""
|
||||
while [ "x${EMAIL}" = "x" ]; do
|
||||
echo -n "Email address git should configure in your checkout: "
|
||||
read EMAIL
|
||||
if [ "x${EMAIL}" = "x${EMAIL%@*}" ]; then
|
||||
echo "Invalid email address (must contain @)!"
|
||||
EMAIL=""
|
||||
fi
|
||||
done
|
||||
echo -n "Using ${EMAIL} for email address... "
|
||||
sleep 1
|
||||
echo OK
|
||||
}
|
||||
|
||||
# Verify we can write to particular directories.
|
||||
function check_dirs {
|
||||
if [ -d src ]; then
|
||||
echo "Found a src directory, do you already have a Chromium checkout?"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
# Test git and git --version.
|
||||
function test_git {
|
||||
echo -n "Trying git... "
|
||||
local GITV="$(git --version)" || {
|
||||
echo "git isn't installed, please install it"
|
||||
exit 1
|
||||
}
|
||||
|
||||
GITV="${GITV##* }" # Only examine last word (i.e. version number)
|
||||
local GITD=( ${GITV//./ } ) # Split version number into decimals
|
||||
if ((GITD[0] < 1 || (GITD[0] == 1 && GITD[1] < 6) )); then
|
||||
echo "git version is ${GITV}, please update to a version later than 1.6"
|
||||
exit 1
|
||||
fi
|
||||
echo "found git version ${GITV}"
|
||||
}
|
||||
|
||||
# Test git svn and git svn --version.
|
||||
function test_git_svn {
|
||||
echo -n "Trying git-svn... "
|
||||
rm -rf "${TMP}"
|
||||
git clone git://github.com/git/hello-world.git "${TMP}" &>/dev/null &&
|
||||
local GITV="$(cd "${TMP}" && git svn --version)" || {
|
||||
echo "git-svn isn't installed, please install it"
|
||||
exit 1
|
||||
}
|
||||
|
||||
GITV="${GITV#* version }" # git svn --version has extra output to remove.
|
||||
GITV="${GITV% (svn*}"
|
||||
local GITD=( ${GITV//./ } ) # Split version number into decimals
|
||||
if ((GITD[0] < 1 || (GITD[0] == 1 && GITD[1] < 6) )); then
|
||||
echo "git version is ${GITV}, please update to a version later than 1.6"
|
||||
exit 1
|
||||
fi
|
||||
echo "found git-svn version ${GITV}"
|
||||
|
||||
echo "Testing git svn init..."
|
||||
(cd "${TMP}" && git svn init --username="${EMAIL}" --prefix=origin/ \
|
||||
-T trunk/src "${SVNSERVER}") &
|
||||
local pid="$!"
|
||||
{ sleep 10 && kill "${pid}"; } &>/dev/null &
|
||||
wait "${pid}" &>/dev/null || {
|
||||
echo "Could not initialize repository, is SVN server ${SVNSERVER} correct?"
|
||||
echo "The supplied username and password may be incorrect."
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
|
||||
# Verify we can reach our main git URL.
|
||||
function test_git_url {
|
||||
echo -n "Testing Chromium git URL... "
|
||||
mkdir -p "${TMP}"
|
||||
(cd "${TMP}" &&
|
||||
rm -rf .git .gitignore &&
|
||||
git init &&
|
||||
git remote add origin git://"${GITSERVER}"/chromium.git &&
|
||||
git remote show origin) &>/dev/null &
|
||||
local pid="$!"
|
||||
{ sleep 10 && kill "${pid}"; } &>/dev/null &
|
||||
wait "${pid}" &>/dev/null || {
|
||||
echo "timeout accessing Chromium git URL, is ${GITSERVER} correct?"
|
||||
exit 1
|
||||
}
|
||||
echo OK
|
||||
}
|
||||
|
||||
# Grab a clone of the Chromium git repository.
|
||||
function cr_git_clone {
|
||||
echo "Grabbing Chromium git repository..."
|
||||
git clone git://"${GITSERVER}"/chromium.git src || {
|
||||
echo "git clone exited with error"
|
||||
echo "You should probably remove 'src' before retrying"
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
|
||||
# Configure the git repository to know about the upstream SVN server.
|
||||
function cr_git_svn_init {
|
||||
echo "Configuring upstream SVN..."
|
||||
(cd src && git svn init --username="${EMAIL}" --prefix=origin/ -T trunk/src \
|
||||
"${SVNSERVER}") || {
|
||||
echo "'git svn init' exited with error"
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
|
||||
# Initialize the SVN history in the repository, also sanity checks our upstream
|
||||
# SVN configuration.
|
||||
function cr_git_svn_fetch {
|
||||
echo "Fetching SVN history..."
|
||||
(cd src && git svn fetch && git pull) || {
|
||||
echo "'git svn fetch' exited with error"
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
|
||||
# Remaining configuration of the git repository:
|
||||
# - associate with codereview/rietveld
|
||||
# - set the repository's email address
|
||||
# - disable crlf munging
|
||||
# - grab a stock .gclient file
|
||||
function git_config {
|
||||
echo -n "Associating with Rietveld... "
|
||||
(cd src && git cl config http://src.chromium.org/svn/)
|
||||
echo OK
|
||||
|
||||
echo -n "Configuring email address... "
|
||||
(cd src && git config user.email "${EMAIL}")
|
||||
echo OK
|
||||
|
||||
echo -n "Disabling crlf munging... "
|
||||
(cd src && git config --global core.autocrlf false)
|
||||
echo OK
|
||||
|
||||
echo -n "Creating a .gclient file... "
|
||||
gclient config http://src.chromium.org/svn/trunk/src
|
||||
echo OK
|
||||
}
|
||||
|
||||
get_email
|
||||
check_dirs
|
||||
test_git
|
||||
test_git_svn
|
||||
test_git_url
|
||||
cr_git_clone
|
||||
cr_git_svn_init
|
||||
cr_git_svn_fetch
|
||||
git_config
|
||||
|
||||
echo
|
||||
echo "A Chromium Git repository was created in 'src'."
|
||||
echo
|
||||
echo " To create a CL..."
|
||||
echo " Update: git pull && gclient sync"
|
||||
echo " Create and use a branch mychange: git checkout -q -b mychange origin"
|
||||
echo " Edit files and commit: git commit -a -v"
|
||||
echo " Upload CL: git cl upload"
|
||||
echo " Try a change: git try origin"
|
||||
echo " Commit a CL: git cl dcommit"
|
||||
echo " Switch to the trunk: git checkout trunk"
|
||||
echo " Delete a branch mychange: git branch -d mychange"
|
||||
echo
|
||||
echo " If while on a branch you need to switch back to the trunk..."
|
||||
echo " Switch to the trunk: git checkout trunk"
|
||||
echo " List all branches: git branch"
|
||||
echo " Switch to branch mychange: git checkout mychange"
|
||||
echo
|
||||
echo " Examining files and changes..."
|
||||
echo " Log with patches: git log -p"
|
||||
echo " Changes to DEPS: git log -p DEPS"
|
||||
echo " View latest commit: git cat-file commit HEAD"
|
||||
echo
|
||||
echo "You should run: gclient sync"
|
||||
echo
|
||||
trap cleanup EXIT
|
Loading…
Reference in New Issue